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.

45 lines
1.9 KiB

  1. #pragma once
  2. #define TOLOWER(a) (((a) >= L'A' && (a) <= L'Z') ? (L'a' + (a - L'A')) : (a))
  3. #define SAFEDELETEARRAY(p) if ((p) != NULL) { delete[] (p); (p) = NULL; };
  4. #define SAFERELEASE(p) if ((p) != NULL) { (p)->Release(); (p) = NULL; };
  5. class __declspec(uuid("f6d90f11-9c73-11d3-b32e-00c04f990bb4")) private_MSXML_DOMDocument30;
  6. CString g_sSourceManifest, g_sSourceBase, g_sDestBase;
  7. /////////////////////////////////////////////////////////////////////////
  8. // HashString
  9. ///////////////////////////////////////////////////////////////////////
  10. inline DWORD HashString(LPCWSTR wzKey, DWORD dwHashSize, BOOL bCaseSensitive)
  11. {
  12. DWORD dwHash = 0;
  13. DWORD dwLen;
  14. DWORD i;
  15. dwLen = lstrlenW(wzKey);
  16. for (i = 0; i < dwLen; i++)
  17. {
  18. if (bCaseSensitive)
  19. dwHash = (dwHash * 65599) + (DWORD)wzKey[i];
  20. else
  21. dwHash = (dwHash * 65599) + (DWORD)TOLOWER(wzKey[i]);
  22. }
  23. dwHash %= dwHashSize;
  24. return dwHash;
  25. }
  26. HRESULT CreateDirectoryHierarchy(LPWSTR pwzRootDir, LPWSTR pwzFilePath);
  27. HRESULT PathNormalize(LPWSTR pwzPath, LPWSTR *ppwzAbsolutePath, DWORD dwFlag, BOOL bCreate);
  28. HRESULT IsValidManifestImport (LPWSTR pwzManifestPath);
  29. HRESULT FindAllFiles (LPWSTR pwzDir, List<LPWSTR> *pFileList);
  30. HRESULT CrossReferenceFiles (LPWSTR pwzDir, List<LPWSTR> *pFileList, List<LPWSTR> *pPatchableFiles);
  31. BOOL CALLBACK MyProgressCallback(PVOID CallbackContext, ULONG CurrentPosition, ULONG MaximumPosition);
  32. HRESULT ApplyPatchToFiles (List<LPWSTR> *pPatchableFiles, List<LPWSTR> *pPatchedFiles, LPWSTR pwzSourceDir, LPWSTR pwzDestDir, LPWSTR pwzPatchDir);
  33. HRESULT CheckForDuplicate(LPWSTR pwzSourceManifestPath, LPWSTR pwzDestManifestPath);
  34. HRESULT GetPatchDirectory(LPWSTR pwzSourceManifestPath, LPWSTR *pwzPatchDir);