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.

157 lines
5.8 KiB

  1. #ifndef _UNICWRAP_H_
  2. #define _UNICWRAP_H_
  3. #include <shellapi.h> // LPSHFILEOPSTRUCT
  4. #include <advpub.h>
  5. #include <inseng.h>
  6. //----- tchar wrappers for functions we need to thunk on our own ----
  7. // for functions which don't have their W versions implemented on 9x be sure to undef
  8. // the TCHAR macro below so that the appropriate wrapper will be used for W version calls
  9. // advpack
  10. HRESULT ExtractFilesWrapW(LPCWSTR pszCabName, LPCWSTR pszExpandDir, DWORD dwFlags,
  11. LPCWSTR pszFileList, LPVOID lpReserved, DWORD dwReserved);
  12. HRESULT GetVersionFromFileWrapW(LPWSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion);
  13. HRESULT RunSetupCommandWrapW(HWND hWnd, LPCWSTR szCmdName, LPCWSTR szInfSection, LPCWSTR szDir,
  14. LPCWSTR lpszTitle, HANDLE *phEXE, DWORD dwFlags, LPVOID pvReserved );
  15. // inseng
  16. HRESULT CheckTrustExWrapW(LPCWSTR wszUrl, LPCWSTR wszFilename, HWND hwndForUI, BOOL bShowBadUI, DWORD dwReserved);
  17. // kernel32
  18. DWORD GetPrivateProfileStringW_p(LPCWSTR lpAppName, LPCWSTR lpSectionName, LPCWSTR lpDefault,
  19. LPWSTR lpReturnedString, DWORD nSize, LPCWSTR lpFileName);
  20. DWORD GetPrivateProfileSectionWrapW(LPCWSTR lpAppName, LPWSTR lpReturnedString, DWORD nSize, LPCWSTR lpFileName);
  21. BOOL WritePrivateProfileSectionWrapW(LPCWSTR lpAppName, LPCWSTR lpString, LPCWSTR lpFileName);
  22. UINT GetDriveTypeWrapW(LPCWSTR lpRootPathName);
  23. HANDLE OpenMutexWrapW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName);
  24. // advapi32
  25. BOOL LookupPrivilegeValueWrapW(LPCWSTR lpSystemName, LPCWSTR lpName, PLUID lpLuid);
  26. LONG RegLoadKeyWrapW(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpFile);
  27. LONG RegUnLoadKeyWrapW(HKEY hKey, LPCWSTR lpSubKey);
  28. LONG RegSaveKeyWrapW(HKEY hKey, LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
  29. // shell32
  30. int SHFileOperationW_p(LPSHFILEOPSTRUCT lpFileOp);
  31. // util
  32. BOOL RunAndWaitA(LPSTR pszCmd, LPCSTR pcszDir, WORD wShow, LPDWORD lpExitCode = NULL);
  33. BOOL RunAndWaitW(LPWSTR pwszCmd, LPCWSTR pcwszDir, WORD wShow, LPDWORD lpExitCode = NULL);
  34. #ifdef UNICODE
  35. #define ExtractFilesWrap ExtractFilesWrapW
  36. #define GetVersionFromFileWrap GetVersionFromFileWrapW
  37. #define RunSetupCommandWrap RunSetupCommandWrapW
  38. #define CheckTrustExWrap CheckTrustExWrapW
  39. #define GetPrivateProfileString_p GetPrivateProfileStringW_p
  40. #define GetPrivateProfileSectionWrap GetPrivateProfileSectionWrapW
  41. #define WritePrivateProfileSectionWrap WritePrivateProfileSectionWrapW
  42. #define GetDriveTypeWrap GetDriveTypeWrapW
  43. #define OpenMutexWrap OpenMutexWrapW
  44. #define LookupPrivilegeValueWrap LookupPrivilegeValueWrapW
  45. #define RegLoadKeyWrap RegLoadKeyWrapW
  46. #define RegUnLoadKeyWrap RegUnLoadKeyWrapW
  47. #define RegSaveKeyWrap RegSaveKeyWrapW
  48. #define SHFileOperation_p SHFileOperationW_p
  49. #define RunAndWait RunAndWaitW
  50. #else
  51. #define ExtractFilesWrap ExtractFiles
  52. #define GetVersionFromFileWrap GetVersionFromFile
  53. #define RunSetupCommandWrap RunSetupCommand
  54. #define CheckTrustExWrap CheckTrustEx
  55. #define GetPrivateProfileString_p GetPrivateProfileStringA
  56. #define GetPrivateProfileSectionWrap GetPrivateProfileSectionA
  57. #define WritePrivateProfileSectionWrap WritePrivateProfileSectionA
  58. #define GetDriveTypeWrap GetDriveTypeA
  59. #define OpenMutexWrap OpenMutexA
  60. #define LookupPrivilegeValueWrap LookupPrivilegeValueA
  61. #define RegLoadKeyWrap RegLoadKeyA
  62. #define RegUnLoadKeyWrap RegUnLoadKeyA
  63. #define RegSaveKeyWrap RegSaveKeyA
  64. #define SHFileOperation_p SHFileOperationA
  65. #define RunAndWait RunAndWaitA
  66. #endif
  67. // undef the macros to resolve these calls we wrap so that we can resolve them to our wrappers
  68. // make sure the win header actually defines the macro you undef, otherwise you'll have to
  69. // call the Wrap explicitly everywhere
  70. #ifndef GetPrivateProfileString
  71. #error GetPrivateProfileString undefined
  72. #else
  73. #undef GetPrivateProfileString
  74. #endif
  75. #define GetPrivateProfileString GetPrivateProfileString_p
  76. #ifndef GetPrivateProfileSection
  77. #error GetPrivateProfileSection undefined
  78. #else
  79. #undef GetPrivateProfileSection
  80. #endif
  81. #define GetPrivateProfileSection GetPrivateProfileSectionWrap
  82. #ifndef WritePrivateProfileSection
  83. #error WritePrivateProfileSection undefined
  84. #else
  85. #undef WritePrivateProfileSection
  86. #endif
  87. #define WritePrivateProfileSection WritePrivateProfileSectionWrap
  88. #ifndef GetDriveType
  89. #error GetDriveType undefined
  90. #else
  91. #undef GetDriveType
  92. #endif
  93. #define GetDriveType GetDriveTypeWrap
  94. #ifndef OpenMutex
  95. #error OpenMutex undefined
  96. #else
  97. #undef OpenMutex
  98. #endif
  99. #define OpenMutex OpenMutexWrap
  100. #ifndef LookupPrivilegeValue
  101. #error LookupPrivilegeValue undefined
  102. #else
  103. #undef LookupPrivilegeValue
  104. #endif
  105. #define LookupPrivilegeValue LookupPrivilegeValueWrap
  106. #ifndef RegLoadKey
  107. #error RegLoadKey undefined
  108. #else
  109. #undef RegLoadKey
  110. #endif
  111. #define RegLoadKey RegLoadKeyWrap
  112. #ifndef RegUnLoadKey
  113. #error RegUnLoadKey undefined
  114. #else
  115. #undef RegUnLoadKey
  116. #define RegUnLoadKey RegUnLoadKeyWrap
  117. #endif
  118. #ifndef RegSaveKey
  119. #error RegSaveKey undefined
  120. #else
  121. #undef RegSaveKey
  122. #define RegSaveKey RegSaveKeyWrap
  123. #endif
  124. #ifndef SHFileOperation
  125. #error SHFileOperation undefined
  126. #else
  127. #undef SHFileOperation
  128. #endif
  129. #define SHFileOperation SHFileOperation_p
  130. #endif // _UNICWRAP_H_