Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
898 B

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. main.c
  5. Created:
  6. 20-Apr-1994
  7. Revision History:
  8. --*/
  9. #include <nt.h>
  10. #include <ntrtl.h>
  11. #include <nturtl.h>
  12. #include <windows.h>
  13. #include <ntlsapi.h>
  14. #include <malloc.h>
  15. #include <lpcstub.h>
  16. extern RTL_CRITICAL_SECTION LPCInitLock;
  17. //
  18. // DLL Startup code
  19. //
  20. BOOL WINAPI DllMain(
  21. HANDLE hDll,
  22. DWORD dwReason,
  23. LPVOID lpReserved)
  24. {
  25. NTSTATUS status = STATUS_SUCCESS;
  26. switch(dwReason)
  27. {
  28. case DLL_PROCESS_ATTACH:
  29. DisableThreadLibraryCalls(hDll);
  30. status = LLSInitLPC();
  31. break;
  32. case DLL_PROCESS_DETACH:
  33. LLSCloseLPC();
  34. RtlDeleteCriticalSection(&LPCInitLock);
  35. break;
  36. } // end switch()
  37. return NT_SUCCESS(status);
  38. } // DllMain