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.

573 lines
8.7 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. osc.h
  5. Abstract:
  6. This file containes definitions for the OS chooser server part.
  7. Author:
  8. Adam Barr (adamba) 08-Jul-1997
  9. Environment:
  10. User Mode - Win32 - MIDL
  11. Revision History:
  12. --*/
  13. #ifndef _OSCSERVER_
  14. #define _OSCSERVER_
  15. //
  16. // Functions in osc.c.
  17. //
  18. DWORD
  19. OscInitialize(
  20. VOID
  21. );
  22. VOID
  23. OscUninitialize(
  24. VOID
  25. );
  26. DWORD
  27. OscProcessMessage(
  28. LPBINL_REQUEST_CONTEXT RequestContext
  29. );
  30. DWORD
  31. OscVerifyLastResponseSize(
  32. PCLIENT_STATE clientState
  33. );
  34. DWORD
  35. OscProcessNegotiate(
  36. LPBINL_REQUEST_CONTEXT RequestContext,
  37. PCLIENT_STATE clientState
  38. );
  39. DWORD
  40. OscProcessAuthenticate(
  41. LPBINL_REQUEST_CONTEXT RequestContext,
  42. PCLIENT_STATE clientState
  43. );
  44. DWORD
  45. OscProcessScreenArguments(
  46. LPBINL_REQUEST_CONTEXT RequestContext,
  47. PCLIENT_STATE clientState,
  48. PUCHAR *NameLoc
  49. );
  50. DWORD
  51. OscProcessRequestUnsigned(
  52. LPBINL_REQUEST_CONTEXT RequestContext,
  53. PCLIENT_STATE clientState
  54. );
  55. OscInstallClient(
  56. LPBINL_REQUEST_CONTEXT RequestContext,
  57. PCLIENT_STATE clientState,
  58. PCREATE_DATA createData
  59. );
  60. DWORD
  61. OscGetCreateData(
  62. LPBINL_REQUEST_CONTEXT RequestContext,
  63. PCLIENT_STATE clientState,
  64. PCREATE_DATA CreateData
  65. );
  66. DWORD
  67. OscProcessRequestSigned(
  68. LPBINL_REQUEST_CONTEXT RequestContext,
  69. PCLIENT_STATE clientState
  70. );
  71. DWORD
  72. OscProcessSetupRequest(
  73. LPBINL_REQUEST_CONTEXT RequestContext,
  74. PCLIENT_STATE clientState
  75. );
  76. DWORD
  77. OscProcessLogoff(
  78. LPBINL_REQUEST_CONTEXT RequestContext,
  79. PCLIENT_STATE clientState
  80. );
  81. DWORD
  82. OscProcessNetcardRequest(
  83. LPBINL_REQUEST_CONTEXT RequestContext
  84. );
  85. DWORD
  86. OscProcessHalRequest(
  87. LPBINL_REQUEST_CONTEXT RequestContext,
  88. PCLIENT_STATE clientState
  89. );
  90. DWORD
  91. OscProcessSifFile(
  92. PCLIENT_STATE clientState,
  93. LPWSTR TemplateFile,
  94. LPWSTR WinntSifPath
  95. );
  96. DWORD
  97. OscSetupClient(
  98. PCLIENT_STATE clientState,
  99. BOOLEAN ErrorDuplicateName
  100. );
  101. VOID
  102. OscUndoSetupClient(
  103. PCLIENT_STATE clientState
  104. );
  105. USHORT
  106. OscPlatformToArchitecture(
  107. PCLIENT_STATE clientState
  108. );
  109. //
  110. // client.c
  111. //
  112. DWORD
  113. OscUpdatePassword(
  114. IN PCLIENT_STATE ClientState,
  115. IN PWCHAR SamAccountName,
  116. IN PWCHAR Password,
  117. IN LDAP * LdapHandle,
  118. IN PLDAPMessage LdapMessage
  119. );
  120. VOID
  121. FreeClient(
  122. PCLIENT_STATE client
  123. );
  124. VOID
  125. OscFreeClientVariables(
  126. PCLIENT_STATE clientState
  127. );
  128. BOOLEAN
  129. OscInitializeClientVariables(
  130. PCLIENT_STATE clientState
  131. );
  132. DWORD
  133. OscFindClient(
  134. ULONG RemoteIp,
  135. BOOL Remove,
  136. PCLIENT_STATE * pClientState
  137. );
  138. VOID
  139. OscFreeClients(
  140. VOID
  141. );
  142. VOID
  143. SearchAndReplace(
  144. LPSAR psarList,
  145. LPSTR *pszString,
  146. DWORD ArraySize,
  147. DWORD dwSize,
  148. DWORD dwExtraSize
  149. );
  150. VOID
  151. ProcessUniqueUdb(
  152. LPSTR *pszString,
  153. DWORD dwSize,
  154. LPWSTR UniqueUdbPath,
  155. LPWSTR UniqueUdbId
  156. );
  157. LPSTR
  158. OscFindVariableA(
  159. PCLIENT_STATE clientState,
  160. LPSTR variableName
  161. );
  162. LPWSTR
  163. OscFindVariableW(
  164. PCLIENT_STATE clientState,
  165. LPSTR variableName
  166. );
  167. BOOLEAN
  168. OscCheckVariableLength(
  169. PCLIENT_STATE clientState,
  170. LPSTR variableName,
  171. ULONG variableLength
  172. );
  173. DWORD
  174. OscAddVariableA(
  175. PCLIENT_STATE clientState,
  176. LPSTR variableName,
  177. LPSTR variableValue
  178. );
  179. DWORD
  180. OscAddVariableW(
  181. PCLIENT_STATE clientState,
  182. LPSTR variableName,
  183. LPWSTR variableValue
  184. );
  185. VOID
  186. OscResetVariable(
  187. PCLIENT_STATE clientState,
  188. LPSTR variableName
  189. );
  190. //
  191. // ds.c
  192. //
  193. DWORD
  194. OscGetUserDetails (
  195. PCLIENT_STATE clientState
  196. );
  197. DWORD
  198. OscCreateAccount(
  199. PCLIENT_STATE clientState,
  200. PCREATE_DATA CreateData
  201. );
  202. DWORD
  203. CheckForDuplicateMachineName(
  204. PCLIENT_STATE clientState,
  205. LPWSTR pszMachineName
  206. );
  207. DWORD
  208. GenerateMachineName(
  209. PCLIENT_STATE clientState
  210. );
  211. DWORD
  212. OscCheckMachineDN(
  213. PCLIENT_STATE clientState
  214. );
  215. DWORD
  216. OscGetDefaultContainerForDomain (
  217. PCLIENT_STATE clientState,
  218. PWCHAR DomainDN
  219. );
  220. //
  221. // menu.c
  222. //
  223. DWORD
  224. OscAppendTemplatesMenus(
  225. PCHAR *GeneratedScreen,
  226. PDWORD dwGeneratedSize,
  227. PCHAR DirToEnum,
  228. PCLIENT_STATE clientState,
  229. BOOLEAN RecoveryOptionsOnly
  230. );
  231. DWORD
  232. SearchAndGenerateOSMenu(
  233. PCHAR *GeneratedScreen,
  234. PDWORD dwGeneratedSize,
  235. PCHAR DirToEnum,
  236. PCLIENT_STATE clientState
  237. );
  238. DWORD
  239. FilterFormOptions(
  240. PCHAR OutMessage,
  241. PCHAR FilterStart,
  242. PULONG OutMessageLength,
  243. PCHAR SectionName,
  244. PCLIENT_STATE ClientState
  245. );
  246. //
  247. // utils.c
  248. //
  249. void
  250. OscCreateWin32SubError(
  251. PCLIENT_STATE clientState,
  252. DWORD Error
  253. );
  254. void
  255. OscCreateLDAPSubError(
  256. PCLIENT_STATE clientState,
  257. DWORD Error
  258. );
  259. VOID
  260. OscGenerateSeed(
  261. UCHAR Seed[1]
  262. );
  263. DWORD
  264. OscRunEncode(
  265. IN PCLIENT_STATE ClientState,
  266. IN LPSTR Data,
  267. OUT LPSTR * EncodedData
  268. );
  269. DWORD
  270. OscRunDecode(
  271. IN PCLIENT_STATE ClientState,
  272. IN LPSTR EncodedData,
  273. OUT LPSTR * Data
  274. );
  275. BOOLEAN
  276. OscGenerateRandomBits(
  277. PUCHAR Buffer,
  278. ULONG BufferLen
  279. );
  280. VOID
  281. OscGeneratePassword(
  282. OUT PWCHAR Password,
  283. OUT PULONG PasswordLength
  284. );
  285. DWORD
  286. GenerateErrorScreen(
  287. PCHAR *OutMessage,
  288. PULONG OutMessageLength,
  289. DWORD Error,
  290. PCLIENT_STATE clientState
  291. );
  292. PCHAR
  293. FindNext(
  294. PCHAR Start,
  295. CHAR ch,
  296. PCHAR End
  297. );
  298. PCHAR
  299. FindScreenName(
  300. PCHAR Screen
  301. );
  302. DWORD
  303. OscImpersonate(
  304. PCLIENT_STATE ClientState
  305. );
  306. DWORD
  307. OscRevert(
  308. PCLIENT_STATE ClientState
  309. );
  310. DWORD
  311. OscGuidToBytes(
  312. LPSTR pszGuid,
  313. LPBYTE Guid
  314. );
  315. BOOLEAN
  316. OscSifIsSysPrep(
  317. PWCHAR pSysPrepSifPath
  318. );
  319. BOOLEAN
  320. OscSifIsCmdConsA(
  321. PCHAR pSysPrepSifPath
  322. );
  323. BOOLEAN
  324. OscSifIsASR(
  325. PCHAR pSysPrepSifPath
  326. );
  327. BOOLEAN
  328. OscGetClosestNt(
  329. IN LPWSTR PathToKernel,
  330. IN DWORD SkuType,
  331. IN PCLIENT_STATE ClientState,
  332. OUT LPWSTR SetupPath,
  333. OUT PBOOLEAN ExactMatch
  334. );
  335. BOOLEAN
  336. OscGetNtVersionInfo(
  337. PULONGLONG Version,
  338. PWCHAR SearchDir,
  339. PCLIENT_STATE ClientState
  340. );
  341. DWORD
  342. SendUdpMessage(
  343. LPBINL_REQUEST_CONTEXT RequestContext,
  344. PCLIENT_STATE clientState,
  345. BOOL bFragment,
  346. BOOL bResend
  347. );
  348. DWORD
  349. OscVerifySignature(
  350. PCLIENT_STATE clientState,
  351. SIGNED_PACKET UNALIGNED * signedMessage
  352. );
  353. DWORD
  354. OscSendSignedMessage(
  355. LPBINL_REQUEST_CONTEXT RequestContext,
  356. PCLIENT_STATE clientState,
  357. PCHAR Message,
  358. ULONG MessageLength
  359. );
  360. DWORD
  361. OscSendUnsignedMessage(
  362. LPBINL_REQUEST_CONTEXT RequestContext,
  363. PCLIENT_STATE clientState,
  364. PCHAR Message,
  365. ULONG MessageLength
  366. );
  367. DWORD
  368. OscSendSetupMessage(
  369. LPBINL_REQUEST_CONTEXT RequestContext,
  370. PCLIENT_STATE clientState,
  371. ULONG RequestType,
  372. PCHAR Message,
  373. ULONG MessageLength
  374. );
  375. DWORD
  376. OscConstructSecret(
  377. PCLIENT_STATE clientState,
  378. PWCHAR UnicodePassword,
  379. ULONG UnicodePasswordLength,
  380. PCREATE_DATA CreateData
  381. );
  382. #if defined(SET_ACLS_ON_CLIENT_DIRS)
  383. DWORD
  384. OscSetClientDirectoryPermissions(
  385. PCLIENT_STATE clientState
  386. );
  387. #endif
  388. #if 0
  389. VOID
  390. OscGetFlipServerList(
  391. PUCHAR FlipServerList,
  392. PULONG FlipServerListLength
  393. );
  394. #endif
  395. #if defined(REMOTE_BOOT)
  396. DWORD
  397. OscCopyTemplateFiles(
  398. LPWSTR SourcePath,
  399. LPWSTR ImagePath,
  400. LPWSTR TemplateFile
  401. );
  402. #endif // defined(REMOTE_BOOT)
  403. #if DBG && defined(REMOTE_BOOT)
  404. DWORD
  405. OscCreateNullFile(
  406. LPWSTR Image,
  407. LPWSTR MAC
  408. );
  409. #endif // DBG && defined(REMOTE_BOOT)
  410. DWORD
  411. OscSetupMachinePassword(
  412. PCLIENT_STATE clientState,
  413. PCWSTR SifFile
  414. );
  415. DWORD
  416. MyGetDcHandle(
  417. PCLIENT_STATE clientState,
  418. PCSTR DomainName,
  419. PHANDLE Handle
  420. );
  421. DWORD
  422. GetDomainNetBIOSName(
  423. IN PCWSTR DomainNameInAnyFormat,
  424. OUT PWSTR *NetBIOSName
  425. );
  426. //
  427. // OSC packet definitions.
  428. //
  429. #define OSC_REQUEST 0x81
  430. //
  431. // Miscellaneous definitions.
  432. //
  433. #define DESCRIPTION_SIZE 70 // 70 cols
  434. #define HELPLINES_SIZE 4 * 70 // 4 lines of text
  435. #define OSCHOOSER_SIF_SECTIONA "OSChooser"
  436. #define OSCHOOSER_SIF_SECTIONW L"OSChooser"
  437. #define COMPUTER_DEFAULT_CONTAINER_IN_B32_FORM L"B:32:AA312825768811D1ADED00C04FD8D5CD:"
  438. //
  439. // Default "default screen" (the first one sent down) if none is specified
  440. // in the registry. Note that this is the actual filename, not the NAME
  441. // value within it.
  442. //
  443. #define DEFAULT_SCREEN_NAME L"welcome.osc"
  444. //
  445. // This defines the size by which the generated screen buffers will grow.
  446. //
  447. #define GENERATED_SCREEN_GROW_SIZE 512
  448. //
  449. // Make English default
  450. //
  451. #define DEFAULT_LANGUAGE L"English"
  452. //
  453. // Default value for %ORGNAME%
  454. //
  455. #define DEFAULT_ORGNAME L""
  456. //
  457. // Default value for %TIMEZONE% (GMT)
  458. //
  459. #define DEFAULT_TIMEZONE L"085"
  460. //
  461. // Name of the tmp directory we create below the REMINST share.
  462. //
  463. #define TEMP_DIRECTORY L"tmp"
  464. #endif