Source code of Windows XP (NT5)
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.

338 lines
6.5 KiB

  1. // common (shared) routines
  2. VOID SetErrorText( DWORD ResID );
  3. VOID SetReturnText( LPSTR Text );
  4. BOOL FFileExist(LPSTR);
  5. BOOL
  6. GenerateSortedIndexList (
  7. IN DWORD cArgs,
  8. IN LPSTR Args[],
  9. OUT LPSTR *TextOut
  10. );
  11. // routines in nt_io.c
  12. HANDLE OpenDisk(PSTR DriveName,BOOL WriteAccessDesired);
  13. HANDLE OpenDiskNT(CHAR *NTStylePathName);
  14. ULONG OpenDiskStatus(PSTR NTDeviceName,PHANDLE Handle);
  15. BOOL CloseDisk(HANDLE Handle);
  16. ULONG GetSectorSize(HANDLE Handle);
  17. ULONG GetPartitionSize(CHAR *DriveName);
  18. BOOL ReadDiskSectors (HANDLE Handle,ULONG Sector,ULONG NumSectors,PVOID Buffer,ULONG SectorSize);
  19. BOOL WriteDiskSectors(HANDLE Handle,ULONG Sector,ULONG NumSectors,PVOID Buffer,ULONG SectorSize);
  20. BOOL ShutdownSystemWorker(IN BOOL Reboot);
  21. //BOOL MakePartitionWorker(DWORD Disk,DWORD Size);
  22. // workers for DLL entry points
  23. BOOL LayBootCodeWorker(IN LPSTR DOSDriveName,IN LPSTR FileSys,IN LPSTR BootCodeFile,IN LPSTR BootSectorSaveFile);
  24. BOOL ConfigFileSubstWorker(IN LPSTR File,IN DWORD NumSubsts,IN LPSTR *Substs);
  25. BOOL BinaryFileSubstWorker(IN LPSTR File,IN DWORD NumSubsts,IN LPSTR *Substs);
  26. BOOL ConfigFileAppendWorker(IN LPSTR File,IN DWORD NumSubsts, IN LPSTR *Substs);
  27. BOOL CheckConfigTypeWorker( IN LPSTR File );
  28. BOOL VdmFixupWorker( LPSTR szAddOnConfig, LPSTR szAddOnBatch);
  29. //=====================================================
  30. // Registry.c declarations
  31. //=====================================================
  32. //
  33. // 1. Registry routines of general use
  34. //
  35. BOOL
  36. GetMaxSizeValueInKey(
  37. HKEY hKey,
  38. LPDWORD cbData
  39. );
  40. PVOID
  41. GetValueEntry(
  42. HKEY hKey,
  43. LPSTR szValueName
  44. );
  45. BOOL
  46. GenerateUniqueFileName(
  47. IN LPSTR TempPath,
  48. IN LPSTR Prefix,
  49. IN OUT LPSTR TempFile
  50. );
  51. //
  52. // 2. Install workers
  53. //
  54. BOOL
  55. SetMyComputerNameWorker(
  56. LPSTR ComputerName
  57. );
  58. BOOL
  59. SetEnvVarWorker(
  60. LPSTR UserOrSystem,
  61. LPSTR Name,
  62. LPSTR Title,
  63. LPSTR RegType,
  64. LPSTR Data
  65. );
  66. BOOL
  67. ExpandSzWorker(
  68. LPSTR EnvironmentString,
  69. LPSTR ReturnBuffer,
  70. DWORD cbReturnBuffer
  71. );
  72. VOID
  73. DoDelnode(
  74. IN PCHAR Directory
  75. );
  76. //=====================================================
  77. // Security.c declarations
  78. //=====================================================
  79. #define ENABLE_PRIVILEGE 0
  80. #define DISABLE_PRIVILEGE 1
  81. #define RESTORE_PRIVILEGE 2
  82. //
  83. // 1. Security routines of general use
  84. //
  85. BOOL
  86. AdjustPrivilege(
  87. IN LONG PrivilegeType,
  88. IN INT Action,
  89. IN PTOKEN_PRIVILEGES PrevState,
  90. IN PULONG ReturnLength
  91. );
  92. BOOL
  93. RestorePrivilege(
  94. IN PTOKEN_PRIVILEGES PrevState
  95. );
  96. //
  97. // 2. Workers for install entry points
  98. //
  99. BOOL
  100. CheckPrivilegeExistsWorker(
  101. IN LPSTR PrivilegeType
  102. );
  103. BOOL
  104. EnablePrivilegeWorker(
  105. LPSTR PrivilegeType,
  106. LPSTR Action
  107. );
  108. //======================================================
  109. // Printer.c declarations
  110. //======================================================
  111. BOOL
  112. AddPrinterDriverWorker(
  113. LPSTR Model,
  114. LPSTR Environment,
  115. LPSTR Driver,
  116. LPSTR DataFile,
  117. LPSTR ConfigFile,
  118. LPSTR Server
  119. );
  120. BOOL
  121. AddPrinterWorker(
  122. LPSTR Name,
  123. LPSTR Port,
  124. LPSTR Model,
  125. LPSTR Description,
  126. LPSTR PrintProcessor,
  127. DWORD Attributes,
  128. LPSTR Server
  129. );
  130. BOOL
  131. AddPrinterMonitorWorker(
  132. IN LPSTR Model,
  133. IN LPSTR Environment,
  134. IN LPSTR Driver,
  135. IN LPSTR Server
  136. );
  137. //======================================================
  138. // Netcon.c declarations
  139. //======================================================
  140. BOOL
  141. AddNetConnectionWorker(
  142. IN LPSTR szUNCName,
  143. IN LPSTR szPassword,
  144. IN LPSTR szLocalName
  145. );
  146. BOOL
  147. DeleteNetConnectionWorker(
  148. IN LPSTR szLocalName,
  149. IN LPSTR szForceClosure
  150. );
  151. CHAR CheckNetConnection(
  152. LPSTR szUNCName
  153. );
  154. VOID
  155. DeleteAllConnectionsWorker(
  156. VOID
  157. );
  158. //======================================================
  159. // Nls.c declarations
  160. //======================================================
  161. BOOL
  162. SetCurrentLocaleWorker(
  163. LPSTR Locale,
  164. LPSTR ModifyCPL
  165. );
  166. //======================================================
  167. // sc.c declarations (service controller)
  168. //======================================================
  169. BOOL
  170. TestAdminWorker(
  171. );
  172. BOOL
  173. SetupCreateServiceWorker(
  174. LPSTR lpServiceName,
  175. LPSTR lpDisplayName,
  176. DWORD dwServiceType,
  177. DWORD dwStartType,
  178. DWORD dwErrorControl,
  179. LPSTR lpBinaryPathName,
  180. LPSTR lpLoadOrderGroup,
  181. LPSTR lpDependencies,
  182. LPSTR lpServiceStartName,
  183. LPSTR lpPassword
  184. );
  185. BOOL
  186. SetupChangeServiceStartWorker(
  187. LPSTR lpServiceName,
  188. DWORD dwStartType
  189. );
  190. BOOL
  191. SetupChangeServiceConfigWorker(
  192. LPSTR lpServiceName,
  193. DWORD dwServiceType,
  194. DWORD dwStartType,
  195. DWORD dwErrorControl,
  196. LPSTR lpBinaryPathName,
  197. LPSTR lpLoadOrderGroup,
  198. LPSTR lpDependencies,
  199. LPSTR lpServiceStartName,
  200. LPSTR lpPassword,
  201. LPSTR lpDisplayName
  202. );
  203. LPSTR
  204. ProcessDependencyList(
  205. LPSTR lpDependenciesList
  206. );
  207. //======================================================
  208. // Mips NVRAM var functions
  209. //======================================================
  210. BOOL GetEnvironmentString(IN LPSTR lpVar, OUT LPSTR lpValue,IN USHORT MaxLengthValue);
  211. BOOL SetEnvironmentString(IN LPSTR lpVar, IN LPSTR lpValue);
  212. //
  213. // Object directory manipulation functions
  214. //
  215. BOOL
  216. GetSymbolicLinkSource(
  217. IN PUNICODE_STRING pObjDir_U,
  218. IN PUNICODE_STRING pTarget_U,
  219. OUT PUNICODE_STRING pSource_U
  220. );
  221. BOOL
  222. GetSymbolicLinkTarget(
  223. IN PUNICODE_STRING pSourceString_U,
  224. IN OUT PUNICODE_STRING pDestString_U
  225. );
  226. //
  227. // DOS Name and Arc Name space manipulation
  228. //
  229. BOOL
  230. DosPathToNtPathWorker(
  231. IN LPSTR DosPath,
  232. OUT LPSTR NtPath
  233. );
  234. BOOL
  235. NtPathToDosPathWorker(
  236. IN LPSTR NtPath,
  237. OUT LPSTR DosPath
  238. );
  239. BOOL
  240. DosPathToArcPathWorker(
  241. IN LPSTR DosPath,
  242. OUT LPSTR ArcPath
  243. );
  244. BOOL
  245. ArcPathToDosPathWorker(
  246. IN LPSTR ArcPath,
  247. OUT LPSTR DosPath
  248. );
  249. BOOL
  250. IsDriveExternalScsi(
  251. IN LPSTR DosDrive,
  252. OUT BOOL *IsExternalScsi
  253. );
  254. // external data
  255. extern HANDLE MyDllModuleHandle;
  256. extern ULONG SectorSize;
  257. // data structs
  258. typedef struct _tagTEMPFILE {
  259. struct _tagTEMPFILE *Next; // *MUST* BE THE FIRST FIELD!!!
  260. LPSTR Filename;
  261. } TEMPFILE,*PTEMPFILE;
  262. // the following are used for portable access to various
  263. // in-memory copies of disk structures
  264. #define LoadBYTE(x) ((DWORD)(*(PBYTE)(x)))
  265. #define LoadWORD(x) ((DWORD)( (USHORT)(* (PBYTE)(x) ) \
  266. | ((USHORT)(*((PBYTE)(x) + 1)) << 8) ))
  267. #define LoadDWORD(x) ((LoadWORD((PBYTE)(x)+2) << 16) | LoadWORD(x))