init.c
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 1k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. /*
  2.  * init.c - DLL startup routines module.
  3.  */
  4. /* Headers
  5.  **********/
  6. #include "project.h"
  7. #pragma hdrstop
  8. #include "init.h"
  9. /****************************** Public Functions *****************************/
  10. #pragma warning(disable:4100) /* "unreferenced formal parameter" warning */
  11. /*
  12. ** LibMain()
  13. **
  14. ** 
  15. **
  16. ** Arguments:
  17. **
  18. ** Returns:
  19. **
  20. ** Side Effects:  none
  21. */
  22. PUBLIC_CODE BOOL APIENTRY LibMain(HANDLE hModule, DWORD dwReason, PVOID pvReserved)
  23. {
  24.    BOOL bResult;
  25.    DebugEntry(LibMain);
  26.    switch (dwReason)
  27.    {
  28.       case DLL_PROCESS_ATTACH:
  29.          bResult = AttachProcess(hModule);
  30.          break;
  31.       case DLL_PROCESS_DETACH:
  32.          bResult = DetachProcess(hModule);
  33.          break;
  34.       case DLL_THREAD_ATTACH:
  35.          bResult = AttachThread(hModule);
  36.          break;
  37.       case DLL_THREAD_DETACH:
  38.          bResult = DetachThread(hModule);
  39.          break;
  40.       default:
  41.          ERROR_OUT((TEXT("LibMain() called with unrecognized dwReason %lu."),
  42.                     dwReason));
  43.          bResult = FALSE;
  44.          break;
  45.    }
  46.    DebugExitBOOL(LibMain, bResult);
  47.    return(bResult);
  48. }
  49. #pragma warning(default:4100) /* "unreferenced formal parameter" warning */