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.

59 lines
1.2 KiB

  1. #include <stdlib.h>
  2. #include <windows.h>
  3. BOOL WINAPI _CRT_INIT (HANDLE hDll, DWORD dwReason, LPVOID lpReserved);
  4. #ifdef HAS_LIBMAIN
  5. BOOL __cdecl LibMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved);
  6. #else
  7. #define LibMain(h, d, l) TRUE
  8. #endif
  9. #if WIN32 == 50
  10. BOOL fWin32s = FALSE;
  11. extern void DfDebug(ULONG, ULONG);
  12. #endif
  13. int __cdecl atexit(void (__cdecl *pfn)(void))
  14. {
  15. // Do nothing
  16. return 0;
  17. }
  18. BOOL __stdcall DllEntryPoint (HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
  19. {
  20. BOOL fRc;
  21. // char msg[80];
  22. #if WIN32 == 50
  23. DWORD dwVer;
  24. #endif
  25. switch(dwReason)
  26. {
  27. case DLL_PROCESS_ATTACH:
  28. // DebugBreak();
  29. #if DBG == 1 && WIN32 == 50
  30. dwVer = GetVersion();
  31. if (dwVer & 0x80000000)
  32. {
  33. ULONG uOLevel;
  34. fWin32s = TRUE;
  35. uOLevel = (ULONG)GetPrivateProfileIntA("Win32sDbg", "docfile",
  36. 0, "system.ini");
  37. DfDebug(uOLevel, uOLevel);
  38. }
  39. #endif
  40. break;
  41. }
  42. if (fRc = _CRT_INIT(hDll, dwReason, lpReserved))
  43. fRc = LibMain(hDll, dwReason, lpReserved);
  44. switch(dwReason)
  45. {
  46. case DLL_PROCESS_ATTACH:
  47. // wsprintfA(msg, "Storag32 returning %d on attach\r\n", fRc);
  48. // OutputDebugStringA(msg);
  49. break;
  50. }
  51. return fRc;
  52. }