home *** CD-ROM | disk | FTP | other *** search
- /*
- * (C) Copyright 1995-1999, Microsoft Corporation. All rights reserved.
- *
- * Definition of Microsoft virtual machine class loader hooks.
- */
-
-
- #ifndef __JCLSHOOK_H__
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- /* Types
- ********/
-
- #ifdef JAVA_VM
- /* Java class loader hook APIs are exported from the MS VM. */
- #define JAVA_CLASS_LOADER_HOOK_PROC __declspec(dllexport)
- #else
- /* Java class loader hook APIs are imported from client modules. */
- #define JAVA_CLASS_LOADER_HOOK_PROC __declspec(dllimport)
- #endif
-
- /*
- * Callback function called after a class has been read in. Allows a class
- * loader hook to modify the definition of a class.
- *
- * Parameters: pcbyteClass - array of original class bytes
- * ncbClassLen - length of pbyteClass array
- * ppbyteReplacementClass - pointer to array of bytes to be used
- * instead of pbyteClass to define the
- * given class
- * pncbReplacementClassLen - length of ppbyteReplacementClass
- * array
- *
- * Returns: void
- */
- typedef void (__cdecl *DefineClassStartProc)(const unsigned char *pcbyteClass,
- int ncbClassLen,
- unsigned char **ppbyteReplacementClass,
- int *pncbReplacementClassLen);
-
- /*
- * Callback function called after the replacement class data from
- * DefineClassStartProc() has been used to define a class. Typically used to
- * free its buffer parameter.
- *
- * Parameters: pbyteReplacementClass - array of bytes provided to
- * DefineClassStartProc()
- *
- * Returns: void
- */
- typedef void (__cdecl *DefineClassDoneProc)(unsigned char *pbyteReplacementClass);
-
-
- /* Prototypes
- *************/
-
- /*
- * Register a class loader hook. The MS VM only supports a single class loader
- * hook at a time. While a class loader hook is registered, attempts to
- * register another class loader hook will fail.
- *
- * Parameters: dcsp - callback function to be called after a class is read in
- * dcdp - callback function to be called after replacement class
- * data has been used
- *
- * Returns: BOOL - TRUE if class loader hook registered successfully.
- * FALSE if not.
- */
- BOOL JAVA_CLASS_LOADER_HOOK_PROC __cdecl RegisterDefineClassHook(DefineClassStartProc dcsp,
- DefineClassDoneProc dcdp);
-
- /*
- * Deregister a class loader hook registered by RegisterDefineClassHook().
- *
- * Parameters: none
- *
- * Returns: BOOL - TRUE if class loader hook deregistered successfully.
- * FALSE if not.
- */
- BOOL JAVA_CLASS_LOADER_HOOK_PROC __cdecl DeregisterDefineClassHook(void);
-
-
- #ifdef __cplusplus
- }
- #endif
-
-
- #endif /* __JCLSHOOK_H__ */
-
-