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.2 KiB

  1. // dllreg.cpp -- autmatic registration and unregistration
  2. //
  3. #include "priv.h"
  4. #include <advpub.h>
  5. /*----------------------------------------------------------
  6. Purpose: Calls the ADVPACK entry-point which executes an inf
  7. file section.
  8. Returns:
  9. Cond: --
  10. */
  11. HRESULT CallRegInstall(HINSTANCE hinstWebvw, HINSTANCE hinstAdvPack, LPSTR szSection)
  12. {
  13. HRESULT hr = E_FAIL;
  14. if (hinstAdvPack)
  15. {
  16. REGINSTALL pfnri = (REGINSTALL)GetProcAddress(hinstAdvPack, "RegInstall");
  17. if (pfnri)
  18. {
  19. STRENTRY seReg[] = {
  20. // These two NT-specific entries must be at the end
  21. { "25", "%SystemRoot%" },
  22. { "11", "%SystemRoot%\\system32" },
  23. };
  24. STRTABLE stReg = { ARRAYSIZE(seReg) - 2, seReg };
  25. hr = pfnri(hinstWebvw, szSection, &stReg);
  26. }
  27. }
  28. return hr;
  29. }
  30. STDAPI RegisterStuff(HINSTANCE hinstWebvw)
  31. {
  32. HRESULT hr;
  33. HINSTANCE hinstAdvPack = LoadLibrary(TEXT("ADVPACK.DLL"));
  34. hr = CallRegInstall(hinstWebvw, hinstAdvPack, "WebViewInstall");
  35. if (hinstAdvPack)
  36. FreeLibrary(hinstAdvPack);
  37. return hr;
  38. }