Advertisement
Appu82

dll.specification.h

Aug 9th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.16 KB | None | 0 0
  1. /*
  2. for some older dll if there is no APIENTRY pointer to DllMain(),
  3. you can includes this header to such old dll code, just in the '.c' section of the dll.
  4. ***Do not include this into the '.h' part of the dll.***
  5. */
  6.  
  7. #ifndef __DLL_SPECIFICATION_H__
  8. #define __DLL_SPECIFICATION_H__
  9.  
  10. #if defined(__DMC__) && !( defined(__TINYC__) || defined(__MINGW32__) || defined(_MSC_VER) )
  11.   #include <windows.h>
  12.   #include <errno.h>
  13.   #include <stdint.h>
  14.   #include <stdio.h>
  15.   #include <stdlib.h>
  16. #endif
  17.  
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22.  
  23. BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
  24.                        DWORD reason        /* Reason this function is being called. */ ,
  25.                        LPVOID reserved     /* Not used. */ )
  26. {
  27.     switch (reason)
  28.     {
  29.       case DLL_PROCESS_ATTACH:
  30.         break;
  31.  
  32.       case DLL_PROCESS_DETACH:
  33.         break;
  34.  
  35.       case DLL_THREAD_ATTACH:
  36.         break;
  37.  
  38.       case DLL_THREAD_DETACH:
  39.         break;
  40.     }
  41.  
  42.     /* Returns TRUE on success, FALSE on failure */
  43.     return TRUE;
  44. }
  45.  
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif //__DLL_SPECIFICATION_H__
  50.         // "dll.specification.h"
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement