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.

152 lines
5.3 KiB

  1. #ifndef _UTIL2_H_
  2. #include "sdsutils.h"
  3. #include "advpub.h"
  4. #include "util.h"
  5. // TODO: advpext.h needs to move to a public location
  6. #include "..\\..\\iexpress\\advpext\\advpext.h"
  7. #define COPYANSISTR(x) MakeAnsiStrFromAnsi(x)
  8. #define ALLOC_CHUNK_SIZE 1024
  9. #define SEARCHFORCONFLICT_CLASS 32770
  10. // Copied from sage.h
  11. #define ENABLE_AGENT 1
  12. #define DISABLE_AGENT 2
  13. #define GET_AGENT_STATUS 3
  14. extern char szLogBuf[];
  15. void EnableSage(BOOL bRestore);
  16. void EnableScreenSaver(BOOL bRestore);
  17. void EnableDiskCleaner(BOOL bRestore);
  18. BOOL PathIsFileSpec(LPCSTR lpszPath);
  19. BOOL IsNT();
  20. LPWSTR ParseURLW(BSTR str);
  21. LPSTR ParseURLA(LPCSTR str);
  22. LPSTR MakeAnsiStrFromAnsi(LPSTR psz);
  23. LPSTR CopyAnsiStr(LPCSTR);
  24. HWND GetVersionConflictHWND();
  25. HRESULT CreateTempDir(DWORD dwDownloadSize, DWORD dwExtractSize,
  26. char chInstallDrive, DWORD dwInstallSize,
  27. DWORD dwWindowsDriveSize,
  28. LPSTR pszPath, DWORD cbPathSize,
  29. DWORD dwFlags);
  30. void AddTempToLikelyExtractDrive(DWORD dwTempDLSpace, DWORD dwTempEXSpace,
  31. char chInstallDrive, char chDownloadDrive,
  32. DWORD *pdwWinDirReq, DWORD *pdwInsDirReq,
  33. DWORD *pdwDownloadDirReq);
  34. int CompareLocales(LPCSTR pcszLoc1, LPCSTR pcszLoc2);
  35. BOOL IsEnoughSpace( LPCSTR szPath, DWORD dwInstNeedSize );
  36. HRESULT LaunchProcess(LPCSTR pszCmdLine, HANDLE *hProc, LPCSTR pszDir, UINT uShow);
  37. HRESULT LaunchAndWait(LPSTR pszCommandLine, HANDLE hAbort, HANDLE *hProc, LPSTR pszDir, UINT uShow);
  38. int VersionCmp(WORD rwVer1[], WORD rwVer2[]);
  39. void ConvertVersionStr(LPSTR pszVer, WORD rwVer[]);
  40. void ConvertVersionStrToDwords(LPSTR pszVer, LPDWORD pdwVer, LPDWORD pdwBuild);
  41. int ErrMsgBox(LPSTR pszText, LPCSTR pszTitle, UINT mbFlags);
  42. int LoadSz(UINT id, LPSTR pszBuf, UINT cMaxSize);
  43. void DeleteFilelist(LPCSTR pszFilelist);
  44. BOOL FNeedGrpConv();
  45. // Function is in extract.cpp
  46. LPSTR FindChar(LPSTR, char);
  47. LPSTR StripQuotes(LPSTR pszStr);
  48. typedef struct
  49. {
  50. char szInfname[MAX_PATH];
  51. char szSection[MAX_PATH];
  52. char szDir[MAX_PATH];
  53. char szCab[MAX_PATH];
  54. DWORD dwFlags;
  55. DWORD dwType;
  56. } INF_ARGUEMENTS;
  57. DWORD WINAPI LaunchInfCommand(void *p);
  58. DWORD GetStringField(LPSTR szStr, UINT uField, LPSTR szBuf, UINT cBufSize);
  59. DWORD GetIntField(LPSTR szStr, UINT uField, DWORD dwDefault);
  60. LPSTR BuildDependencyString(LPSTR pszName,LPSTR pszOwner);
  61. int StringFromGuid(const CLSID* piid, LPTSTR pszBuf);
  62. BOOL DeleteKeyAndSubKeys(HKEY hkIn, LPSTR pszSubKey);
  63. DWORD WINAPI CleanUpAllDirs(LPVOID pv);
  64. BOOL UninstallKeyExists(LPCSTR pszUninstallKey);
  65. BOOL SuccessCheck(LPSTR pszSuccessKey);
  66. void SafeAddPath(LPSTR szPath, LPCSTR szName, DWORD dwPathSize );
  67. void ExpandString( LPSTR lpBuf, DWORD dwSize );
  68. VOID IndicateWinsockActivity(VOID);
  69. HRESULT MyTranslateString( LPCSTR pszCif, LPCSTR pszID, LPCSTR pszTranslateKey,
  70. LPSTR pszBuffer, DWORD dwBufferSize);
  71. HRESULT MyTranslateInfString( PCSTR pszInfFilename, PCSTR pszInstallSection,
  72. PCSTR pszTranslateSection, PCSTR pszTranslateKey,
  73. PSTR pszBuffer, DWORD dwBufferSize,
  74. PDWORD pdwRequiredSize, HINF hInf );
  75. HRESULT WriteTokenizeString(LPCSTR pszCif, LPCSTR pszID, LPCSTR pszTranslateKey, LPCSTR pszBuffer);
  76. DWORD MyWritePrivateProfileString( LPCSTR pszSec, LPCSTR pszKey, LPCSTR pszData, LPCSTR pszFile);
  77. void CopyCifString(LPCSTR pszSect, LPCSTR pszKey, LPCSTR pszCifSrc, LPCSTR pszCifDest);
  78. HRESULT CreateTempDirOnMaxDrive(LPSTR pszDir, DWORD dwBufSize);
  79. HINSTANCE InitSetupLib(LPCSTR pszInfName, HINF *phinf);
  80. void FreeSetupLib(HINSTANCE hInst, HINF hInf);
  81. HRESULT GetIEPath(LPSTR pszPath, DWORD dwSize);
  82. DWORD MyGetFileSize(LPCSTR pszFilename);
  83. void CleanUpTempDir(LPCSTR pszTemp);
  84. typedef HRESULT (WINAPI *PFNGETFILELIST)(HINF, PDOWNLOAD_FILEINFO*, DWORD*);
  85. typedef HRESULT (WINAPI *PFNDOWNLOADANDPATCHFILES)(HWND, DWORD, DOWNLOAD_FILEINFO*,
  86. LPCSTR, LPCSTR, PATCH_DOWNLOAD_CALLBACK, LPVOID);
  87. typedef HRESULT (WINAPI *PFNPROCESSFILESECTION)(HINF, HWND, BOOL, LPCSTR, LPCSTR, PATCH_DOWNLOAD_CALLBACK, LPVOID);
  88. BOOL IsPatchableINF(LPTSTR pszInf);
  89. BOOL InitSRLiteLibs();
  90. BOOL IsCorrectAdvpExt();
  91. void FreeSRLiteLibs();
  92. BOOL IsPatchableIEVersion();
  93. extern PFNGETFILELIST g_pfnGetFileList;
  94. extern PFNDOWNLOADANDPATCHFILES g_pfnDownloadAndPatchFiles;
  95. extern PFNPROCESSFILESECTION g_pfnProcessFileSection;
  96. #define EVENTWAIT_QUIT 0
  97. #define EVENTWAIT_DONE 1
  98. DWORD WaitForEvent(HANDLE hEvent, HWND hwnd);
  99. BOOL WaitForMutex(HANDLE hMutex);
  100. DWORD GetCurrentPlatform();
  101. void DllAddRef(void);
  102. void DllRelease(void);
  103. void * _cdecl malloc(size_t n);
  104. void * _cdecl calloc(size_t n, size_t s);
  105. void * _cdecl realloc(void* p, size_t n);
  106. void _cdecl free(void* p);
  107. extern char g_szWindowsDir[MAX_PATH];
  108. void GetTimeDateStamp(LPSTR lpLogBuf);
  109. #ifdef __cplusplus
  110. extern "C" {
  111. #endif
  112. HRESULT WINAPI DownloadFile(LPCSTR szURL, LPCSTR szFilename, HWND hwnd, BOOL bCheckTrust, BOOL bShowBadUI);
  113. #ifdef __cplusplus
  114. } // end of extern "C"
  115. #endif
  116. #define _UTIL2_H_
  117. #endif