Leaked source code of windows server 2003
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.

51 lines
1.3 KiB

  1. #include <fusenetincludes.h>
  2. #include <msxml2.h>
  3. #include <manifestimport.h>
  4. #include <manifestemit.h>
  5. HINSTANCE g_hInst = NULL;
  6. //----------------------------------------------------------------------------
  7. BOOL WINAPI DllMain( HINSTANCE hInst, DWORD dwReason, LPVOID pvReserved )
  8. {
  9. BOOL bReturn = TRUE;
  10. HRESULT hr = S_OK;
  11. MAKE_ERROR_MACROS_STATIC(hr);
  12. switch (dwReason)
  13. {
  14. case DLL_PROCESS_ATTACH:
  15. g_hInst = hInst;
  16. DisableThreadLibraryCalls(hInst);
  17. IF_FAILED_EXIT(CAssemblyManifestImport::InitGlobalCritSect());
  18. IF_FAILED_EXIT(CAssemblyManifestEmit::InitGlobalCritSect());
  19. IF_FAILED_EXIT(CAssemblyManifestImport::InitGlobalStringTable());
  20. srand(GetTickCount() + GetCurrentProcessId());
  21. break;
  22. case DLL_PROCESS_DETACH:
  23. CAssemblyManifestImport::FreeGlobalStringTable();
  24. CAssemblyManifestEmit::DelGlobalCritSect();
  25. CAssemblyManifestImport::DelGlobalCritSect();
  26. break;
  27. case DLL_THREAD_ATTACH:
  28. case DLL_THREAD_DETACH:
  29. break;
  30. }
  31. exit :
  32. if(FAILED(hr))
  33. bReturn = FALSE;
  34. return bReturn;
  35. }
  36. STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine)
  37. {
  38. return S_OK;
  39. }