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.

341 lines
4.7 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. proto.h
  5. Abstract:
  6. This file contain function prototypes for the BINL service.
  7. Author:
  8. Colin Watson (colinw) 11-Aug-1997
  9. Environment:
  10. User Mode - Win32 - MIDL
  11. Revision History:
  12. --*/
  13. //
  14. // network.c
  15. //
  16. DWORD
  17. BinlWaitForMessage(
  18. BINL_REQUEST_CONTEXT *pRequestContext
  19. );
  20. DWORD
  21. BinlSendMessage(
  22. LPBINL_REQUEST_CONTEXT BinlRequestContext
  23. );
  24. DHCP_IP_ADDRESS
  25. BinlGetMyNetworkAddress (
  26. LPBINL_REQUEST_CONTEXT RequestContext
  27. );
  28. NTSTATUS
  29. GetIpAddressInfo (
  30. ULONG Delay
  31. );
  32. VOID
  33. FreeIpAddressInfo (
  34. VOID
  35. );
  36. //
  37. // main.c
  38. //
  39. DWORD
  40. ReadDWord(
  41. HKEY KeyHandle,
  42. LPTSTR lpValueName,
  43. DWORD DefaultValue
  44. );
  45. DWORD
  46. BinlRegGetValue(
  47. HKEY KeyHandle,
  48. LPWSTR ValueName,
  49. DWORD ValueType,
  50. LPBYTE * BufferPtr
  51. );
  52. DWORD
  53. GetBinlServerParameters(
  54. BOOL GlobalSearch);
  55. DWORD
  56. BinlInitializeEndpoint(
  57. PENDPOINT pEndpoint,
  58. PDHCP_IP_ADDRESS pIpAddress,
  59. DWORD Port
  60. );
  61. VOID
  62. SendWakeup(
  63. PENDPOINT pEndpoint
  64. );
  65. DWORD
  66. MaybeInitializeEndpoint(
  67. PENDPOINT pEndpoint,
  68. PDHCP_IP_ADDRESS pIpAddress,
  69. DWORD Port
  70. );
  71. VOID
  72. MaybeCloseEndpoint(
  73. PENDPOINT pEndpoint
  74. );
  75. VOID
  76. BinlMessageLoop(
  77. LPVOID Parameter
  78. );
  79. DWORD
  80. BinlStartWorkerThread(
  81. BINL_REQUEST_CONTEXT **ppContext
  82. );
  83. VOID
  84. BinlProcessingLoop(
  85. VOID
  86. );
  87. BOOL
  88. BinlIsProcessMessageExecuting(
  89. VOID
  90. );
  91. BOOL
  92. BinlIsProcessMessageBusy(
  93. VOID
  94. );
  95. DWORD
  96. Scavenger(
  97. VOID
  98. );
  99. VOID
  100. ServiceEntry(
  101. DWORD NumArgs,
  102. LPWSTR *ArgsArray,
  103. IN PTCPSVCS_GLOBAL_DATA pGlobalData
  104. );
  105. NTSTATUS
  106. BinlSetupPnpWait (
  107. VOID
  108. );
  109. // message.c
  110. DWORD
  111. ProcessMessage(
  112. LPBINL_REQUEST_CONTEXT RequestContext
  113. );
  114. DWORD
  115. ProcessBinlDiscover(
  116. LPBINL_REQUEST_CONTEXT RequestContext,
  117. LPDHCP_SERVER_OPTIONS dhcpOptions
  118. );
  119. DWORD
  120. ProcessBinlRequest(
  121. LPBINL_REQUEST_CONTEXT RequestContext,
  122. LPDHCP_SERVER_OPTIONS dhcpOptions
  123. );
  124. DWORD
  125. ProcessBinlInform(
  126. LPBINL_REQUEST_CONTEXT RequestContext,
  127. LPDHCP_SERVER_OPTIONS DhcpOptions
  128. );
  129. DWORD
  130. UpdateAccount(
  131. PCLIENT_STATE ClientState,
  132. PMACHINE_INFO pMachineInfo,
  133. BOOL fCreateAccount
  134. );
  135. DWORD
  136. GetBootParameters(
  137. PUCHAR pGuid,
  138. PMACHINE_INFO * pMachineInfo,
  139. DWORD dwRequestedInfo,
  140. USHORT SystemArchitecture,
  141. BOOL AllowOSChooser
  142. );
  143. DWORD
  144. VerifyExistingClient(
  145. PUCHAR Guid
  146. );
  147. DWORD
  148. InitializeConnection(
  149. BOOL Global,
  150. PLDAP * LdapHandle,
  151. PWCHAR ** Base);
  152. VOID
  153. FreeConnections(
  154. VOID
  155. );
  156. #ifdef REMOTE_BOOT
  157. DWORD
  158. SetCurrentClientCount( );
  159. #endif // REMOTE_BOOT
  160. DWORD
  161. BinlReportEventW(
  162. DWORD EventID,
  163. DWORD EventType,
  164. DWORD NumStrings,
  165. DWORD DataLength,
  166. LPWSTR *Strings,
  167. LPVOID Data
  168. );
  169. DWORD
  170. BinlReportEventA(
  171. DWORD EventID,
  172. DWORD EventType,
  173. DWORD NumStrings,
  174. DWORD DataLength,
  175. LPSTR *Strings,
  176. LPVOID Data
  177. );
  178. VOID
  179. BinlLogDuplicateDsRecords (
  180. LPGUID Guid,
  181. LDAP *LdapHandle,
  182. LDAPMessage *LdapMessage,
  183. LDAPMessage *CurrentEntry
  184. );
  185. //
  186. // osc.c
  187. //
  188. DWORD
  189. OscUpdatePassword(
  190. IN PCLIENT_STATE ClientState,
  191. IN PWCHAR SamAccountName,
  192. IN PWCHAR Password,
  193. IN LDAP * LdapHandle,
  194. IN PLDAPMessage LdapMessage
  195. );
  196. //
  197. // Routines for caching the DS responses and to ensure that we don't work on
  198. // a request that we're already working on.
  199. //
  200. DWORD
  201. BinlCreateOrFindCacheEntry (
  202. PCHAR Guid,
  203. BOOLEAN CreateIfNotExist,
  204. PMACHINE_INFO *CacheEntry
  205. );
  206. VOID
  207. BinlDoneWithCacheEntry (
  208. PMACHINE_INFO pMachineInfo,
  209. BOOLEAN FreeIt
  210. );
  211. VOID
  212. BinlCloseCache (
  213. VOID
  214. );
  215. void
  216. OscCreateLDAPSubError(
  217. PCLIENT_STATE clientState,
  218. DWORD Error );
  219. #ifndef DSCRACKNAMES_DNS
  220. DWORD
  221. BinlDNStoFQDN(
  222. PWCHAR pMachineName,
  223. PWCHAR * ppMachineDN );
  224. #endif
  225. DWORD
  226. GetOurServerInfo (
  227. VOID
  228. );
  229. //
  230. // rogue.c
  231. //
  232. NTSTATUS
  233. MaybeStartRogueThread (
  234. VOID
  235. );
  236. VOID
  237. StopRogueThread (
  238. VOID
  239. );
  240. VOID
  241. HandleRogueAuthorized (
  242. VOID
  243. );
  244. VOID
  245. HandleRogueUnauthorized (
  246. VOID
  247. );
  248. VOID
  249. LogCurrentRogueState (
  250. BOOL ResponseToMessage
  251. );
  252. VOID
  253. LogLdapError (
  254. ULONG LdapEvent,
  255. ULONG LdapError,
  256. PLDAP LdapHandle OPTIONAL
  257. );
  258. //
  259. // Create a copy of a string by allocating heap memory.
  260. //
  261. LPSTR
  262. BinlStrDupA( LPCSTR pStr );
  263. LPWSTR
  264. BinlStrDupW( LPCWSTR pStr );
  265. // We should always be UNICODE
  266. #define BinlStrDup BinlStrDupW
  267. #if DBG==1
  268. #define BinlAllocateMemory(x) DebugAlloc( __FILE__, __LINE__, "BINL", LMEM_FIXED | LMEM_ZEROINIT, x, #x)
  269. #define BinlFreeMemory(x) DebugFree(x)
  270. #else // DBG==0
  271. #define BinlAllocateMemory(x) LocalAlloc( LMEM_FIXED | LMEM_ZEROINIT, x)
  272. #define BinlFreeMemory(x) LocalFree(x)
  273. #endif // DBG==1