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.

153 lines
5.0 KiB

  1. #ifndef INSTALL_H
  2. #define INSTALL_H
  3. ///////////////////////////////////////////////////////////////////////////////
  4. #define SECTION 512 // Maximum size of section
  5. #define MAXSTR 256
  6. #define UNLIST_LINE 1
  7. #define NO_UNLIST_LINE 0
  8. #define WEC_RESTART 0x42
  9. #define DESC_ERROR 4
  10. #define DESC_SYS 3
  11. #define DESC_INF 2
  12. #define DESC_EXE 1
  13. #define DESC_NOFILE 0
  14. #define FALLOC(n) ((VOID *)GlobalAlloc(GPTR, n))
  15. #define FFREE(n) GlobalFree(n)
  16. #define ALLOC(n) (VOID *)LocalAlloc(LPTR,n)
  17. #define FREE(p) LocalFree(p)
  18. #define REALLOC(p,n) LocalRealloc(p,n,LMEM_MOVEABLE)
  19. #define SEEK_CUR 1
  20. #define SEEK_END 2
  21. #define SEEK_SET 0
  22. #define MAXFILESPECLEN MAX_PATH /* drive: + path length max + Null Byte */
  23. #define MAX_INF_LINE_LEN 256 /* Maximum length of any .inf line */
  24. #define MAX_SYS_INF_LEN 256 /* ##: + 8.3 + NULL */
  25. #define MAX_SECT_NAME_LEN 40 /* Max length of a section Name. */
  26. #define MAX_FILE_SPEC MAX_PATH // 8.3 + X: + NULL.
  27. #define DISK_SECT TEXT("disks")
  28. #define OEMDISK_SECT TEXT("oemdisks")
  29. /* Return codes from 'file exists' dialog */
  30. enum {
  31. CopyNeither, // User wants to cancel if file exists
  32. CopyCurrent, // User wants to use current file
  33. CopyNew // User wants to copy new file
  34. };
  35. #define SLASH(c) ((c) == TEXT('/')|| (c) == TEXT('\\'))
  36. #define CHSEPSTR TEXT("\\")
  37. #define COMMA TEXT(',')
  38. #define SPACE TEXT(' ')
  39. /* Globals and routines for .inf file parsing */
  40. typedef LPTSTR PINF;
  41. /* Message types for FileCopy callback function */
  42. typedef BOOL (*FPFNCOPY) (int,DWORD_PTR,LPTSTR);
  43. #define COPY_ERROR 0x0001
  44. #define COPY_INSERTDISK 0x0003
  45. #define COPY_QUERYCOPY 0x0004
  46. #define COPY_START 0x0005
  47. #define COPY_END 0x0006
  48. #define COPY_EXISTS 0x0007
  49. /* Option Flag values for FileCopy */
  50. #define FC_FILE 0x0000
  51. #define FC_LIST 0x0001
  52. #define FC_SECTION 0x0002
  53. #define FC_QUALIFIED 0x0008
  54. #define FC_DEST_QUALIFIED 0x0010
  55. #define FC_LISTTYPE 0x0020
  56. #define FC_CALLBACK_WITH_VER 0x0040
  57. #define FC_ABORT 0
  58. #define FC_IGNORE 1
  59. #define FC_RETRY 2
  60. #define FC_ERROR_LOADED_DRIVER 0x80
  61. /*******************************************************************
  62. *
  63. * Global Variables
  64. *
  65. *******************************************************************/
  66. // Path to the directory where we found the .inf file
  67. extern char szSetupPath[MAX_PATH];
  68. // Path to the user's disk(s)
  69. extern char szDiskPath[MAX_PATH]; // Path to the default drive -
  70. //
  71. extern BOOL bRetry;
  72. // Name of the driver being installed
  73. extern char szDrv[120];
  74. //
  75. extern char szFileError[50];
  76. // Parent window for file copy dialogues
  77. extern HWND hMesgBoxParent;
  78. // TRUE on copying first file to prompt user if file already exists
  79. // FALSE for subsequent copies
  80. extern BOOL bQueryExist;
  81. ///////////////////////////////////////////////////////////////////////////////
  82. BOOL DefCopyCallback(int msg, DWORD_PTR n, LPTSTR szFile);
  83. UINT FileCopy (LPTSTR szSource, LPTSTR szDir, FPFNCOPY fpfnCopy, UINT fCopy, HWND hPar, BOOL fQuery);
  84. LONG TryCopy(LPTSTR, LPTSTR, LPTSTR, FPFNCOPY);
  85. LONG GetDiskPath(LPTSTR Disk, LPTSTR szPath, size_t cchPath);
  86. LONG ExpandFileName(LPTSTR szFile, LPTSTR szPath);
  87. void catpath(LPTSTR path, LPTSTR sz);
  88. LPTSTR FileName(LPTSTR szPath);
  89. LPTSTR RemoveDiskId(LPTSTR szPath);
  90. LPTSTR StripPathName(LPTSTR szPath);
  91. BOOL IsFileKernelDriver(LPTSTR szPath);
  92. UINT ConvertFlagToValue(DWORD dwFlags);
  93. BOOL IsValidDiskette(int iDrive);
  94. BOOL IsDiskInDrive(int iDisk);
  95. BOOL GetInstallPath(LPTSTR szDirOfSrc);
  96. BOOL wsInfParseInit(void);
  97. void wsStartWait();
  98. void wsEndWait();
  99. int fDialog(int id, HWND hwnd, DLGPROC fpfn);
  100. UINT wsCopyError(int n, LPTSTR szFile);
  101. UINT wsInsertDisk(LPTSTR Disk, LPTSTR szSrcPath);
  102. INT_PTR wsDiskDlg(HWND hDlg, UINT uiMessage, UINT wParam, LPARAM lParam);
  103. UINT wsCopySingleStatus(int msg, DWORD_PTR n, LPTSTR szFile);
  104. INT_PTR wsExistDlg(HWND hDlg, UINT uiMessage, UINT wParam, LPARAM lParam);
  105. VOID RemoveSpaces(LPTSTR szPath, LPTSTR szEdit);
  106. PINF infLoadFile(int fh);
  107. PINF infOpen(LPTSTR szInf);
  108. void infClose(PINF pinf);
  109. UINT_PTR FindSection(PINF pInf, LPTSTR pszSect);
  110. LONG fnGetDataString(PINF npszData, LPTSTR szDataStr, LPTSTR szBuf, size_t cchBuf);
  111. PINF infSetDefault(PINF pinf);
  112. PINF infFindSection(PINF pinf, LPTSTR szSection);
  113. LONG infGetProfileString(PINF pinf, LPTSTR szSection, LPTSTR szItem, LPTSTR szBuf, size_t cchBuf);
  114. LONG infParseField(PINF szData, int n, LPTSTR szBuf, size_t cchBuf);
  115. int infLineCount(PINF pinf);
  116. PINF infNextLine(PINF pinf);
  117. int infLineCount(PINF pinf);
  118. PINF infFindInstallableDriversSection(PINF pinf);
  119. #endif