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.

53 lines
1.1 KiB

  1. #include "precomp.hxx"
  2. HRESULT
  3. SR_DLL::InstallIntoRegistry( HKEY * RegistryKey)
  4. {
  5. HRESULT hr;
  6. HINSTANCE hDll;
  7. HRESULT (STDAPICALLTYPE *pfnDllRegisterServer)();
  8. HKEY hKey;
  9. hDll = LoadLibraryEx(GetPackageName(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
  10. if(hDll != 0)
  11. {
  12. pfnDllRegisterServer = (HRESULT (STDAPICALLTYPE *)())
  13. GetProcAddress(hDll, "DllRegisterServer");
  14. if(pfnDllRegisterServer == 0)
  15. hr = HRESULT_FROM_WIN32(GetLastError());
  16. else
  17. {
  18. hr = (*pfnDllRegisterServer)();
  19. }
  20. FreeLibrary(hDll);
  21. }
  22. else
  23. {
  24. hr = HRESULT_FROM_WIN32(GetLastError());
  25. }
  26. return hr;
  27. }
  28. HRESULT
  29. SR_DLL::InitRegistryKeyToInstallInto(
  30. HKEY * phKey )
  31. {
  32. return CreateMappedRegistryKey( phKey );
  33. }
  34. HRESULT
  35. SR_DLL::RestoreRegistryKey( HKEY *phKey )
  36. {
  37. return RestoreMappedRegistryKey( phKey);
  38. }
  39. HRESULT
  40. SR_DLL::DeleteTempKey(HKEY hKey, FILETIME ftLow, FILETIME ftHigh)
  41. {
  42. CleanMappedRegistryKey(hKey, ftLow, ftHigh);
  43. return S_OK;
  44. }