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.

47 lines
1.2 KiB

  1. #include "precomp.h"
  2. #include "arrtempl.h" // for CDeleteMe
  3. #include "md5wbem.h" // for MD5
  4. #include "winmgmt.h"
  5. #include "wbemdelta.h"
  6. DWORD WINAPI
  7. DeltaDredge2(DWORD dwNumServicesArgs,
  8. LPWSTR *lpServiceArgVectors)
  9. {
  10. DWORD bDredge = FULL_DREDGE;
  11. // check the MULTI_SZ key
  12. LONG lRet;
  13. HKEY hKey;
  14. lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
  15. WBEM_REG_WINMGMT,
  16. NULL,
  17. KEY_READ,
  18. &hKey);
  19. if (ERROR_SUCCESS == lRet)
  20. {
  21. OnDelete<HKEY,LONG(*)(HKEY),RegCloseKey> cm(hKey);
  22. DWORD dwSize = 0;
  23. DWORD dwType;
  24. lRet = RegQueryValueEx(hKey,
  25. KNOWN_SERVICES,
  26. NULL,
  27. &dwType,
  28. NULL,
  29. &dwSize);
  30. if (ERROR_SUCCESS == lRet && REG_MULTI_SZ == dwType && (dwSize > 2)) // empty MULTI_SZ is 2 bytes
  31. {
  32. bDredge = NO_DREDGE;
  33. }
  34. }
  35. return bDredge;
  36. }