home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / sdkjava40.exe / data1.cab / fg_Include / Include / jclshook.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-04  |  3.0 KB  |  95 lines

  1. /*
  2.  * (C) Copyright 1995-1999, Microsoft Corporation.  All rights reserved.
  3.  *
  4.  * Definition of Microsoft virtual machine class loader hooks.
  5.  */
  6.  
  7.  
  8. #ifndef __JCLSHOOK_H__
  9.  
  10.  
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14.  
  15.  
  16. /* Types
  17.  ********/
  18.  
  19. #ifdef JAVA_VM
  20. /* Java class loader hook APIs are exported from the MS VM. */
  21. #define JAVA_CLASS_LOADER_HOOK_PROC __declspec(dllexport)
  22. #else
  23. /* Java class loader hook APIs are imported from client modules. */
  24. #define JAVA_CLASS_LOADER_HOOK_PROC __declspec(dllimport)
  25. #endif
  26.  
  27. /*
  28.  * Callback function called after a class has been read in.  Allows a class
  29.  * loader hook to modify the definition of a class.
  30.  *
  31.  * Parameters:  pcbyteClass - array of original class bytes
  32.  *              ncbClassLen - length of pbyteClass array
  33.  *              ppbyteReplacementClass - pointer to array of bytes to be used
  34.  *                                       instead of pbyteClass to define the
  35.  *                                       given class
  36.  *              pncbReplacementClassLen - length of ppbyteReplacementClass
  37.  *                                        array
  38.  *
  39.  * Returns:     void
  40.  */
  41. typedef void (__cdecl *DefineClassStartProc)(const unsigned char *pcbyteClass,
  42.                                              int ncbClassLen,
  43.                                              unsigned char **ppbyteReplacementClass,
  44.                                              int *pncbReplacementClassLen);
  45.  
  46. /*
  47.  * Callback function called after the replacement class data from
  48.  * DefineClassStartProc() has been used to define a class.  Typically used to
  49.  * free its buffer parameter.
  50.  *
  51.  * Parameters:  pbyteReplacementClass - array of bytes provided to
  52.  *                                      DefineClassStartProc()
  53.  *
  54.  * Returns:     void
  55.  */
  56. typedef void (__cdecl *DefineClassDoneProc)(unsigned char *pbyteReplacementClass);
  57.  
  58.  
  59. /* Prototypes
  60.  *************/
  61.  
  62. /*
  63.  * Register a class loader hook.  The MS VM only supports a single class loader
  64.  * hook at a time.  While a class loader hook is registered, attempts to
  65.  * register another class loader hook will fail.
  66.  *
  67.  * Parameters:  dcsp - callback function to be called after a class is read in
  68.  *              dcdp - callback function to be called after replacement class
  69.  *                     data has been used
  70.  *
  71.  * Returns:     BOOL - TRUE if class loader hook registered successfully.
  72.  *                     FALSE if not.
  73.  */
  74. BOOL JAVA_CLASS_LOADER_HOOK_PROC __cdecl RegisterDefineClassHook(DefineClassStartProc dcsp,
  75.                                                                  DefineClassDoneProc dcdp);
  76.  
  77. /*
  78.  * Deregister a class loader hook registered by RegisterDefineClassHook().
  79.  *
  80.  * Parameters:  none
  81.  *
  82.  * Returns:     BOOL - TRUE if class loader hook deregistered successfully.
  83.  *                     FALSE if not.
  84.  */
  85. BOOL JAVA_CLASS_LOADER_HOOK_PROC __cdecl DeregisterDefineClassHook(void);
  86.  
  87.  
  88. #ifdef __cplusplus
  89. }
  90. #endif
  91.  
  92.  
  93. #endif  /* __JCLSHOOK_H__ */
  94.  
  95.