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.

1651 lines
36 KiB

  1. /*++
  2. Copyright (c) 1995-1997 Microsoft Corporation
  3. Module Name:
  4. clusrtl.h
  5. Abstract:
  6. Header file for definitions and structures for the NT Cluster
  7. Run Time Library
  8. Author:
  9. John Vert (jvert) 30-Nov-1995
  10. Revision History:
  11. --*/
  12. #ifndef _CLUSRTL_INCLUDED_
  13. #define _CLUSRTL_INCLUDED_
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. //
  18. // Service Message IDs
  19. //
  20. #include "clusvmsg.h"
  21. #include "resapi.h"
  22. #include <aclapi.h>
  23. //
  24. // Routine Description:
  25. //
  26. // Initializes the cluster run time library.
  27. //
  28. // Arguments:
  29. //
  30. // RunningAsService - TRUE if the process is running as an NT service.
  31. // FALSE if running as a console app.
  32. //
  33. // Return Value:
  34. //
  35. // ERROR_SUCCESS if the function succeeds.
  36. // A Win32 error code otherwise.
  37. //
  38. DWORD
  39. ClRtlInitialize(
  40. IN BOOLEAN RunningAsService
  41. );
  42. //
  43. // Routine Description:
  44. //
  45. // Cleans up the cluster run time library.
  46. //
  47. // Arguments:
  48. //
  49. // RunningAsService - TRUE if the process is running as an NT service.
  50. // FALSE if running as a console app.
  51. //
  52. // Return Value:
  53. //
  54. // None.
  55. //
  56. VOID
  57. ClRtlCleanup(
  58. VOID
  59. );
  60. //////////////////////////////////////////////////////////////////////////
  61. //
  62. // Event logging interfaces
  63. //
  64. //
  65. // There are three currently defined logging levels:
  66. // LOG_CRITICAL - fatal error, chaos and destruction will ensue
  67. // LOG_UNUSUAL - unexpected event, but will be handled
  68. // LOG_NOISE - normal occurence
  69. //
  70. //////////////////////////////////////////////////////////////////////////
  71. #define LOG_CRITICAL 1
  72. #define LOG_UNUSUAL 2
  73. #define LOG_NOISE 3
  74. //
  75. // A few interfaces for reporting of errors.
  76. //
  77. VOID
  78. ClRtlLogInit(
  79. VOID
  80. );
  81. VOID
  82. ClusterLogFatalError(
  83. IN ULONG LogModule,
  84. IN ULONG Line,
  85. IN LPSTR File,
  86. IN ULONG ErrCode
  87. );
  88. VOID
  89. ClusterLogNonFatalError(
  90. IN ULONG LogModule,
  91. IN ULONG Line,
  92. IN LPSTR File,
  93. IN ULONG ErrCode
  94. );
  95. VOID
  96. ClusterLogAssertionFailure(
  97. IN ULONG LogModule,
  98. IN ULONG Line,
  99. IN LPSTR File,
  100. IN LPSTR Expression
  101. );
  102. VOID
  103. ClusterLogEvent0(
  104. IN DWORD LogLevel,
  105. IN DWORD LogModule,
  106. IN LPSTR FileName,
  107. IN DWORD LineNumber,
  108. IN DWORD MessageId,
  109. IN DWORD dwByteCount,
  110. IN PVOID lpBytes
  111. );
  112. VOID
  113. ClusterLogEvent1(
  114. IN DWORD LogLevel,
  115. IN DWORD LogModule,
  116. IN LPSTR FileName,
  117. IN DWORD LineNumber,
  118. IN DWORD MessageId,
  119. IN DWORD dwByteCount,
  120. IN PVOID lpBytes,
  121. IN LPCWSTR Arg1
  122. );
  123. VOID
  124. ClusterLogEvent2(
  125. IN DWORD LogLevel,
  126. IN DWORD LogModule,
  127. IN LPSTR FileName,
  128. IN DWORD LineNumber,
  129. IN DWORD MessageId,
  130. IN DWORD dwByteCount,
  131. IN PVOID lpBytes,
  132. IN LPCWSTR Arg1,
  133. IN LPCWSTR Arg2
  134. );
  135. VOID
  136. ClusterLogEvent3(
  137. IN DWORD LogLevel,
  138. IN DWORD LogModule,
  139. IN LPSTR FileName,
  140. IN DWORD LineNumber,
  141. IN DWORD MessageId,
  142. IN DWORD dwByteCount,
  143. IN PVOID lpBytes,
  144. IN LPCWSTR Arg1,
  145. IN LPCWSTR Arg2,
  146. IN LPCWSTR Arg3
  147. );
  148. //
  149. // Routine Description:
  150. //
  151. // Prints a message to the debug terminal if running as a service
  152. // or the console window if running as a console app.
  153. //
  154. // Arguments:
  155. //
  156. // FormatString - Message string.
  157. //
  158. // Any FormatMessage-compatible arguments to be inserted in the
  159. // ErrorMessage before it is logged.
  160. //
  161. // Return Value:
  162. //
  163. // None.
  164. //
  165. VOID
  166. ClRtlDbgPrint(
  167. PCHAR FormatString,
  168. ...
  169. );
  170. //
  171. // Same as ClRtlDbgPrint, only uses a message ID instead of a string.
  172. //
  173. VOID
  174. ClRtlMsgPrint(
  175. IN DWORD MessageId,
  176. ...
  177. );
  178. //
  179. // Same as ClRtlDbgPrint, only logs to a file instead of screen.
  180. //
  181. VOID
  182. ClRtlLogPrint(
  183. PCHAR FormatString,
  184. ...
  185. );
  186. //
  187. // Macros/prototypes for unexpected error handling.
  188. //
  189. #define ARGUMENT_PRESENT( ArgumentPointer ) (\
  190. (CHAR *)(ArgumentPointer) != (CHAR *)(NULL) )
  191. #define CL_UNEXPECTED_ERROR(_errcode_) \
  192. ClusterLogFatalError(LOG_CURRENT_MODULE, \
  193. __LINE__, \
  194. __FILE__, \
  195. (_errcode_))
  196. WINBASEAPI
  197. BOOL
  198. APIENTRY
  199. IsDebuggerPresent(
  200. VOID
  201. );
  202. #define CL_ASSERT( exp ) \
  203. if (!(exp)) { \
  204. ClusterLogAssertionFailure(LOG_CURRENT_MODULE, \
  205. __LINE__, \
  206. __FILE__, \
  207. #exp); \
  208. }
  209. #define CL_LOGFAILURE( _errcode_ ) \
  210. ClusterLogNonFatalError(LOG_CURRENT_MODULE, \
  211. __LINE__, \
  212. __FILE__, \
  213. (_errcode_))
  214. // Use the following to put cluster specific errors in the event log
  215. #define CL_LOGCLUSERROR( _errcode_ ) \
  216. ClusterLogEvent0(LOG_CRITICAL, \
  217. LOG_CURRENT_MODULE, \
  218. __FILE__, \
  219. __LINE__, \
  220. (_errcode_), \
  221. 0, \
  222. NULL)
  223. #define CL_LOGCLUSWARNING( _errcode_ ) \
  224. ClusterLogEvent0(LOG_UNUSUAL, \
  225. LOG_CURRENT_MODULE, \
  226. __FILE__, \
  227. __LINE__, \
  228. (_errcode_), \
  229. 0, \
  230. NULL)
  231. #define CL_LOGCLUSWARNING1(_msgid_,_arg1_) \
  232. ClusterLogEvent1(LOG_UNUSUAL, \
  233. LOG_CURRENT_MODULE, \
  234. __FILE__, \
  235. __LINE__, \
  236. (_msgid_), \
  237. 0, \
  238. NULL, \
  239. (_arg1_))
  240. #define CL_LOGCLUSERROR1(_msgid_,_arg1_) \
  241. ClusterLogEvent1(LOG_CRITICAL, \
  242. LOG_CURRENT_MODULE, \
  243. __FILE__, \
  244. __LINE__, \
  245. (_msgid_), \
  246. 0, \
  247. NULL, \
  248. (_arg1_))
  249. //////////////////////////////////////////////////////////////////////////
  250. //
  251. // Doubly-linked list manipulation routines. Implemented as macros
  252. // but logically these are procedures. Stolen from ntrtl.h
  253. //
  254. //////////////////////////////////////////////////////////////////////////
  255. //
  256. // VOID
  257. // InitializeListHead(
  258. // PLIST_ENTRY ListHead
  259. // );
  260. //
  261. #define InitializeListHead(ListHead) (\
  262. (ListHead)->Flink = (ListHead)->Blink = (ListHead))
  263. //
  264. // BOOLEAN
  265. // IsListEmpty(
  266. // PLIST_ENTRY ListHead
  267. // );
  268. //
  269. #define IsListEmpty(ListHead) \
  270. ((ListHead)->Flink == (ListHead))
  271. //
  272. // PLIST_ENTRY
  273. // RemoveHeadList(
  274. // PLIST_ENTRY ListHead
  275. // );
  276. //
  277. #define RemoveHeadList(ListHead) \
  278. (ListHead)->Flink;\
  279. {RemoveEntryList((ListHead)->Flink)}
  280. //
  281. // PLIST_ENTRY
  282. // RemoveTailList(
  283. // PLIST_ENTRY ListHead
  284. // );
  285. //
  286. #define RemoveTailList(ListHead) \
  287. (ListHead)->Blink;\
  288. {RemoveEntryList((ListHead)->Blink)}
  289. //
  290. // VOID
  291. // RemoveEntryList(
  292. // PLIST_ENTRY Entry
  293. // );
  294. //
  295. #define RemoveEntryList(Entry) {\
  296. PLIST_ENTRY _EX_Blink;\
  297. PLIST_ENTRY _EX_Flink;\
  298. _EX_Flink = (Entry)->Flink;\
  299. _EX_Blink = (Entry)->Blink;\
  300. _EX_Blink->Flink = _EX_Flink;\
  301. _EX_Flink->Blink = _EX_Blink;\
  302. }
  303. //
  304. // VOID
  305. // InsertTailList(
  306. // PLIST_ENTRY ListHead,
  307. // PLIST_ENTRY Entry
  308. // );
  309. //
  310. #define InsertTailList(ListHead,Entry) {\
  311. PLIST_ENTRY _EX_Blink;\
  312. PLIST_ENTRY _EX_ListHead;\
  313. _EX_ListHead = (ListHead);\
  314. _EX_Blink = _EX_ListHead->Blink;\
  315. (Entry)->Flink = _EX_ListHead;\
  316. (Entry)->Blink = _EX_Blink;\
  317. _EX_Blink->Flink = (Entry);\
  318. _EX_ListHead->Blink = (Entry);\
  319. }
  320. //
  321. // VOID
  322. // InsertHeadList(
  323. // PLIST_ENTRY ListHead,
  324. // PLIST_ENTRY Entry
  325. // );
  326. //
  327. #define InsertHeadList(ListHead,Entry) {\
  328. PLIST_ENTRY _EX_Flink;\
  329. PLIST_ENTRY _EX_ListHead;\
  330. _EX_ListHead = (ListHead);\
  331. _EX_Flink = _EX_ListHead->Flink;\
  332. (Entry)->Flink = _EX_Flink;\
  333. (Entry)->Blink = _EX_ListHead;\
  334. _EX_Flink->Blink = (Entry);\
  335. _EX_ListHead->Flink = (Entry);\
  336. }
  337. //
  338. // Singly-linked list manipulation routines. Implemented as macros
  339. // but logically these are procedures. Stolen from ntrtl.h
  340. //
  341. //
  342. //
  343. // PSINGLE_LIST_ENTRY
  344. // PopEntryList(
  345. // PSINGLE_LIST_ENTRY ListHead
  346. // );
  347. //
  348. #define PopEntryList(ListHead) \
  349. (ListHead)->Next;\
  350. {\
  351. PSINGLE_LIST_ENTRY FirstEntry;\
  352. FirstEntry = (ListHead)->Next;\
  353. if (FirstEntry != NULL) { \
  354. (ListHead)->Next = FirstEntry->Next;\
  355. } \
  356. }
  357. //
  358. // VOID
  359. // PushEntryList(
  360. // PSINGLE_LIST_ENTRY ListHead,
  361. // PSINGLE_LIST_ENTRY Entry
  362. // );
  363. //
  364. #define PushEntryList(ListHead,Entry) \
  365. (Entry)->Next = (ListHead)->Next; \
  366. (ListHead)->Next = (Entry)
  367. //////////////////////////////////////////////////////////////////////////
  368. //
  369. // General-purpose queue package.
  370. //
  371. //////////////////////////////////////////////////////////////////////////
  372. typedef struct _CL_QUEUE {
  373. LIST_ENTRY ListHead;
  374. CRITICAL_SECTION Lock;
  375. HANDLE Event;
  376. DWORD Count;
  377. HANDLE Abort;
  378. } CL_QUEUE, *PCL_QUEUE;
  379. DWORD
  380. ClRtlInitializeQueue(
  381. IN PCL_QUEUE Queue
  382. );
  383. VOID
  384. ClRtlDeleteQueue(
  385. IN PCL_QUEUE Queue
  386. );
  387. PLIST_ENTRY
  388. ClRtlRemoveHeadQueue(
  389. IN PCL_QUEUE Queue
  390. );
  391. PLIST_ENTRY
  392. ClRtlRemoveHeadQueueTimeout(
  393. IN PCL_QUEUE Queue,
  394. IN DWORD dwMilliseconds
  395. );
  396. VOID
  397. ClRtlInsertTailQueue(
  398. IN PCL_QUEUE Queue,
  399. IN PLIST_ENTRY Item
  400. );
  401. VOID
  402. ClRtlRundownQueue(
  403. IN PCL_QUEUE Queue,
  404. OUT PLIST_ENTRY ListHead
  405. );
  406. //////////////////////////////////////////////////////////////////////////
  407. //
  408. // General-purpose buffer pool package.
  409. //
  410. //////////////////////////////////////////////////////////////////////////
  411. //
  412. // Buffer pool definition.
  413. //
  414. typedef struct _CLRTL_BUFFER_POOL *PCLRTL_BUFFER_POOL;
  415. //
  416. // Maximum number of buffers that can be allocated from a pool.
  417. //
  418. #define CLRTL_MAX_POOL_BUFFERS 0xFFFFFFFE
  419. //
  420. // Routines for utilizing buffer pools.
  421. //
  422. typedef
  423. DWORD
  424. (*CLRTL_BUFFER_CONSTRUCTOR)(
  425. PVOID Buffer
  426. );
  427. /*++
  428. Routine Description:
  429. Called to initialize a buffer which has been newly allocated
  430. from system memory.
  431. Arguments:
  432. Buffer - A pointer to the buffer to initialize.
  433. Return Value:
  434. ERROR_SUCCESS if the initialization succeeded.
  435. A Win32 error code if the initialization failed.
  436. --*/
  437. typedef
  438. VOID
  439. (*CLRTL_BUFFER_DESTRUCTOR)(
  440. PVOID Buffer
  441. );
  442. /*++
  443. Routine Description:
  444. Called to cleanup a buffer which is about to be returned to
  445. system memory.
  446. Arguments:
  447. Buffer - A pointer to the buffer to cleanup.
  448. Return Value:
  449. None.
  450. --*/
  451. PCLRTL_BUFFER_POOL
  452. ClRtlCreateBufferPool(
  453. IN DWORD BufferSize,
  454. IN DWORD MaximumCached,
  455. IN DWORD MaximumAllocated,
  456. IN CLRTL_BUFFER_CONSTRUCTOR Constructor, OPTIONAL
  457. IN CLRTL_BUFFER_DESTRUCTOR Destructor OPTIONAL
  458. );
  459. /*++
  460. Routine Description:
  461. Creates a pool from which fixed-size buffers may be allocated.
  462. Arguments:
  463. BufferSize - Size of the buffers managed by the pool.
  464. MaximumCached - The maximum number of buffers to cache in the pool.
  465. Must be less than or equal to MaximumAllocated.
  466. MaximumAllocated - The maximum number of buffers to allocate from
  467. system memory. Must be less than or equal to
  468. CLRTL_MAX_POOL_BUFFERS.
  469. Constructor - An optional routine to be called when a new buffer
  470. is allocated from system memory. May be NULL
  471. Destructor - An optional routine to be called when a buffer
  472. is returned to system memory. May be NULL.
  473. Return Value:
  474. A pointer to the created buffer pool or NULL on error.
  475. Extended error information is available from GetLastError().
  476. --*/
  477. VOID
  478. ClRtlDestroyBufferPool(
  479. IN PCLRTL_BUFFER_POOL Pool
  480. );
  481. /*++
  482. Routine Description:
  483. Destroys a previously created buffer pool.
  484. Arguments:
  485. Pool - A pointer to the pool to destroy.
  486. Return Value:
  487. None.
  488. Notes:
  489. The pool will not actually be destroyed until all outstanding
  490. buffers have been returned. Each outstanding buffer is effectively
  491. a reference on the pool.
  492. --*/
  493. PVOID
  494. ClRtlAllocateBuffer(
  495. IN PCLRTL_BUFFER_POOL Pool
  496. );
  497. /*++
  498. Routine Description:
  499. Allocates a buffer from a previously created buffer pool.
  500. Arguments:
  501. Pool - A pointer to the pool from which to allocate the buffer.
  502. Return Value:
  503. A pointer to the allocated buffer if the routine was successfull.
  504. NULL if the routine failed. Extended error information is available
  505. by calling GetLastError().
  506. --*/
  507. VOID
  508. ClRtlFreeBuffer(
  509. PVOID Buffer
  510. );
  511. /*++
  512. Routine Description:
  513. Frees a buffer back to its owning pool.
  514. Arguments:
  515. Buffer - The buffer to free.
  516. Return Value:
  517. None.
  518. --*/
  519. //////////////////////////////////////////////////////////////////////////
  520. //
  521. // General-purpose worker thread queue package.
  522. //
  523. //////////////////////////////////////////////////////////////////////////
  524. typedef struct _CLRTL_WORK_ITEM *PCLRTL_WORK_ITEM;
  525. typedef
  526. VOID
  527. (*PCLRTL_WORK_ROUTINE)(
  528. IN PCLRTL_WORK_ITEM WorkItem,
  529. IN DWORD Status,
  530. IN DWORD BytesTransferred,
  531. IN DWORD IoContext
  532. );
  533. /*++
  534. Routine Description:
  535. Called to process an item posted to a work queue.
  536. Arguments:
  537. WorkItem - The work item to process.
  538. Status - If the work item represents a completed I/O operation,
  539. this parameter contains the completion status of the
  540. operation.
  541. BytesTransferred - If the work item represents a completed I/O operation,
  542. this parameter contains the number of bytes tranferred
  543. during the operation. For other work items, the
  544. semantics of this parameter are defined by the caller
  545. of ClRtlPostItemWorkQueue.
  546. IoContext - If the work item represents a completed I/O operation,
  547. this parameter contains the context value associated
  548. with the handle on which the I/O was submitted. For
  549. other work items, the semantics of this parameter are
  550. defined by the caller of ClRtlPostItemWorkQueue.
  551. Return Value:
  552. None.
  553. --*/
  554. //
  555. // Work Item Structure.
  556. //
  557. typedef struct _CLRTL_WORK_ITEM {
  558. OVERLAPPED Overlapped;
  559. PCLRTL_WORK_ROUTINE WorkRoutine;
  560. PVOID Context;
  561. } CLRTL_WORK_ITEM;
  562. //
  563. // Work queue definition.
  564. //
  565. typedef struct _CLRTL_WORK_QUEUE *PCLRTL_WORK_QUEUE;
  566. //
  567. // Routines For Utilizing Work Queues
  568. //
  569. #define ClRtlInitializeWorkItem(Item, Routine, Ctx) \
  570. ZeroMemory(&((Item)->Overlapped), sizeof(OVERLAPPED)); \
  571. (Item)->WorkRoutine = (Routine); \
  572. (Item)->Context = (Ctx);
  573. PCLRTL_WORK_QUEUE
  574. ClRtlCreateWorkQueue(
  575. IN DWORD MaximumThreads,
  576. IN int ThreadPriority
  577. );
  578. /*++
  579. Routine Description:
  580. Creates a work queue and a dynamic pool of threads to service it.
  581. Arguments:
  582. MaximumThreads - The maximum number of threads to create to service
  583. the queue.
  584. ThreadPriority - The priority level at which the queue worker threads
  585. should run.
  586. Return Value:
  587. A pointer to the created queue if the routine is successful.
  588. NULL if the routine fails. Call GetLastError for extended
  589. error information.
  590. --*/
  591. VOID
  592. ClRtlDestroyWorkQueue(
  593. IN PCLRTL_WORK_QUEUE WorkQueue
  594. );
  595. /*++
  596. Routine Description:
  597. Destroys a work queue and its thread pool.
  598. Arguments:
  599. WorkQueue - The queue to destroy.
  600. Return Value:
  601. None.
  602. Notes:
  603. The following rules must be observed in order to safely destroy a
  604. work queue:
  605. 1) No new work items may be posted to the queue once all previously
  606. posted items have been processed by this routine.
  607. 2) WorkRoutines must be able to process items until this
  608. call returns. After the call returns, no more items will
  609. be delivered from the specified queue.
  610. One workable cleanup procedure is as follows: First, direct the
  611. WorkRoutines to silently discard completed items. Next, eliminate
  612. all sources of new work. Finally, destroy the work queue. Note that
  613. when in discard mode, the WorkRoutines may not access any structures
  614. which will be destroyed by eliminating the sources of new work.
  615. --*/
  616. DWORD
  617. ClRtlPostItemWorkQueue(
  618. IN PCLRTL_WORK_QUEUE WorkQueue,
  619. IN PCLRTL_WORK_ITEM WorkItem,
  620. IN DWORD BytesTransferred, OPTIONAL
  621. IN DWORD IoContext OPTIONAL
  622. );
  623. /*++
  624. Routine Description:
  625. Posts a specified work item to a specified work queue.
  626. Arguments:
  627. WorkQueue - A pointer to the work queue to which to post the item.
  628. WorkItem - A pointer to the item to post.
  629. BytesTransferred - If the work item represents a completed I/O operation,
  630. this parameter contains the number of bytes
  631. transferred during the operation. For other work items,
  632. the semantics of this parameter may be defined by
  633. the caller.
  634. IoContext - If the work item represents a completed I/O operation,
  635. this parameter contains the context value associated
  636. with the handle on which the operation was submitted.
  637. Of other work items, the semantics of this parameter
  638. may be defined by the caller.
  639. Return Value:
  640. ERROR_SUCCESS if the item was posted successfully.
  641. A Win32 error code if the post operation fails.
  642. --*/
  643. DWORD
  644. ClRtlAssociateIoHandleWorkQueue(
  645. IN PCLRTL_WORK_QUEUE WorkQueue,
  646. IN HANDLE IoHandle,
  647. IN DWORD IoContext
  648. );
  649. /*++
  650. Routine Description:
  651. Associates a specified I/O handle, opened for overlapped I/O
  652. completion, with a work queue. All pending I/O operations on
  653. the specified handle will be posted to the work queue when
  654. completed. An initialized CLRTL_WORK_ITEM must be used to supply
  655. the OVERLAPPED structure whenever an I/O operation is submitted on
  656. the specified handle.
  657. Arguments:
  658. WorkQueue - The work queue with which to associate the I/O handle.
  659. IoHandle - The I/O handle to associate.
  660. IoContext - A context value to associate with the specified handle.
  661. This value will be supplied as a parameter to the
  662. WorkRoutine which processes completions for this
  663. handle.
  664. Return Value:
  665. ERROR_SUCCESS if the association completes successfully.
  666. A Win32 error code if the association fails.
  667. --*/
  668. //////////////////////////////////////////////////////////////////////////
  669. //
  670. // Utilities for accessing the NT system registry.
  671. //
  672. //////////////////////////////////////////////////////////////////////////
  673. DWORD
  674. ClRtlRegQueryDword(
  675. IN HKEY hKey,
  676. IN LPWSTR lpValueName,
  677. OUT LPDWORD lpValue,
  678. IN LPDWORD lpDefaultValue OPTIONAL
  679. );
  680. DWORD
  681. ClRtlRegQueryString(
  682. IN HKEY Key,
  683. IN LPWSTR ValueName,
  684. IN DWORD ValueType,
  685. IN LPWSTR *StringBuffer,
  686. IN OUT LPDWORD StringBufferSize,
  687. OUT LPDWORD StringSize
  688. );
  689. //////////////////////////////////////////////////////////////////////////
  690. //
  691. // Routines for groveling and managing network configuration.
  692. // Currently, these are specific to TCP/IP.
  693. //
  694. //////////////////////////////////////////////////////////////////////////
  695. //
  696. // Transport interface information structure
  697. //
  698. // The "Ignore" field is intitialized to FALSE. If it is set to
  699. // TRUE by an application, the enum search functions will ignore
  700. // the entry.
  701. //
  702. typedef struct _CLRTL_NET_INTERFACE_INFO {
  703. struct _CLRTL_NET_INTERFACE_INFO * Next;
  704. ULONG Context;
  705. ULONG Flags;
  706. ULONG InterfaceAddress;
  707. LPWSTR InterfaceAddressString;
  708. ULONG NetworkAddress;
  709. LPWSTR NetworkAddressString;
  710. ULONG NetworkMask;
  711. LPWSTR NetworkMaskString;
  712. BOOLEAN Ignore;
  713. } CLRTL_NET_INTERFACE_INFO, *PCLRTL_NET_INTERFACE_INFO;
  714. #define CLRTL_NET_INTERFACE_PRIMARY 0x00000001
  715. #define CLRTL_NET_INTERFACE_DYNAMIC 0x00000002
  716. //
  717. // Adapter information structure
  718. //
  719. // The "Ignore" field is intitialized to FALSE. If it is set to
  720. // TRUE by an application, the enum search functions will ignore
  721. // the entry.
  722. //
  723. typedef struct _CLRTL_NET_ADAPTER_INFO {
  724. struct _CLRTL_NET_ADAPTER_INFO * Next;
  725. LPWSTR Name;
  726. ULONG Index;
  727. ULONG Flags;
  728. ULONG InterfaceCount;
  729. PCLRTL_NET_INTERFACE_INFO InterfaceList;
  730. BOOLEAN Ignore;
  731. } CLRTL_NET_ADAPTER_INFO, *PCLRTL_NET_ADAPTER_INFO;
  732. #define CLRTL_NET_ADAPTER_HIDDEN 0x00000001
  733. typedef struct {
  734. ULONG AdapterCount;
  735. PCLRTL_NET_ADAPTER_INFO AdapterList;
  736. } CLRTL_NET_ADAPTER_ENUM, *PCLRTL_NET_ADAPTER_ENUM;
  737. PCLRTL_NET_ADAPTER_ENUM
  738. ClRtlEnumNetAdapters(
  739. VOID
  740. );
  741. VOID
  742. ClRtlFreeNetAdapterEnum(
  743. IN PCLRTL_NET_ADAPTER_ENUM AdapterEnum
  744. );
  745. PCLRTL_NET_ADAPTER_INFO
  746. ClRtlFindNetAdapterByName(
  747. PCLRTL_NET_ADAPTER_ENUM AdapterEnum,
  748. LPWSTR AdapterName
  749. );
  750. PCLRTL_NET_INTERFACE_INFO
  751. ClRtlFindNetInterfaceByNetworkAddress(
  752. IN PCLRTL_NET_ADAPTER_INFO AdapterInfo,
  753. IN LPWSTR NetworkAddress
  754. );
  755. PCLRTL_NET_ADAPTER_INFO
  756. ClRtlFindNetAdapterByNetworkAddress(
  757. IN PCLRTL_NET_ADAPTER_ENUM AdapterEnum,
  758. IN LPWSTR NetworkAddress,
  759. OUT PCLRTL_NET_INTERFACE_INFO * InterfaceInfo
  760. );
  761. PCLRTL_NET_INTERFACE_INFO
  762. ClRtlGetPrimaryNetInterface(
  763. IN PCLRTL_NET_ADAPTER_INFO AdapterInfo
  764. );
  765. VOID
  766. ClRtlQueryTcpipInformation(
  767. OUT LPDWORD MaxAddressStringLength,
  768. OUT LPDWORD MaxEndpointStringLength
  769. );
  770. DWORD
  771. ClRtlTcpipAddressToString(
  772. ULONG AddressValue,
  773. LPWSTR * AddressString
  774. );
  775. DWORD
  776. ClRtlTcpipStringToAddress(
  777. LPWSTR AddressString,
  778. PULONG AddressValue
  779. );
  780. DWORD
  781. ClRtlTcpipEndpointToString(
  782. USHORT EndpointValue,
  783. LPWSTR * EndpointString
  784. );
  785. DWORD
  786. ClRtlTcpipStringToEndpoint(
  787. LPWSTR EndpointString,
  788. PUSHORT EndpointValue
  789. );
  790. BOOL
  791. ClRtlIsValidTcpipAddress(
  792. IN ULONG Address
  793. );
  794. BOOL
  795. ClRtlIsValidTcpipSubnetMask(
  796. IN ULONG SubnetMask
  797. );
  798. //
  799. // BOOL
  800. // ClRtlAreTcpipAddressesOnSameSubnet(
  801. // ULONG Address1,
  802. // ULONG Address2,
  803. // ULONG SubnetMask
  804. // );
  805. //
  806. #define ClRtlAreTcpipAddressesOnSameSubnet(_Addr1, _Addr2, _Mask) \
  807. ( ((_Addr1 & _Mask) == (_Addr2 & _Mask)) ? TRUE : FALSE )
  808. DWORD
  809. ClRtlBuildTcpipTdiAddress(
  810. IN LPWSTR NetworkAddress,
  811. IN LPWSTR TransportEndpoint,
  812. OUT LPVOID * TdiAddress,
  813. OUT LPDWORD TdiAddressLength
  814. );
  815. DWORD
  816. ClRtlBuildLocalTcpipTdiAddress(
  817. IN LPWSTR NetworkAddress,
  818. OUT LPVOID TdiAddress,
  819. OUT LPDWORD TdiAddressLength
  820. );
  821. DWORD
  822. ClRtlParseTcpipTdiAddress(
  823. IN LPVOID TdiAddress,
  824. OUT LPWSTR * NetworkAddress,
  825. OUT LPWSTR * TransportEndpoint
  826. );
  827. //
  828. // Routines for manipulating IP Addresses
  829. //
  830. BOOLEAN
  831. UnicodeInetAddr(
  832. PWCHAR AddressString,
  833. PULONG Address
  834. );
  835. //
  836. // IP_ADDRESS - access an IP address as a single DWORD or 4 BYTEs
  837. //
  838. typedef union {
  839. DWORD d;
  840. BYTE b[4];
  841. } IP_ADDRESS, *PIP_ADDRESS, IP_MASK, *PIP_MASK;
  842. //
  843. // IP_ADDRESS_STRING - store an IP address as a dotted decimal string
  844. //
  845. typedef struct {
  846. char String[4 * 4];
  847. } IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
  848. //
  849. // IP_ADDR_STRING - store an IP address with its corresponding subnet mask,
  850. // both as dotted decimal strings
  851. //
  852. typedef struct _IP_ADDR_STRING {
  853. struct _IP_ADDR_STRING* Next;
  854. IP_ADDRESS_STRING IpAddress;
  855. IP_MASK_STRING IpMask;
  856. DWORD Context;
  857. } IP_ADDR_STRING, *PIP_ADDR_STRING;
  858. //
  859. // ADAPTER_INFO - per-adapter information. All IP addresses are stored as
  860. // strings
  861. //
  862. #define MAX_ADAPTER_DESCRIPTION_LENGTH 128 // arb.
  863. #define MAX_ADAPTER_NAME_LENGTH 32 // arb.
  864. #define MAX_ALLOWED_ADAPTER_NAME_LENGTH (MAX_ADAPTER_NAME_LENGTH + 256)
  865. #define MAX_ADAPTER_ADDRESS_LENGTH 8 // arb.
  866. #define DEFAULT_MINIMUM_ENTITIES MAX_TDI_ENTITIES // arb.
  867. #define MAX_HOSTNAME_LEN 64 // arb.
  868. #define MAX_DOMAIN_NAME_LEN 64 // arb.
  869. #define MAX_SCOPE_ID_LEN 64 // arb.
  870. typedef struct _ADAPTER_INFO {
  871. struct _ADAPTER_INFO* Next;
  872. char AdapterName[MAX_ADAPTER_NAME_LENGTH + 1];
  873. char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 1];
  874. UINT AddressLength;
  875. BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
  876. UINT Index;
  877. UINT Type;
  878. UINT DhcpEnabled;
  879. UINT NodeType;
  880. IP_ADDR_STRING IpAddressList;
  881. IP_ADDR_STRING GatewayList;
  882. IP_ADDR_STRING DhcpServer;
  883. BOOL HaveWins;
  884. IP_ADDR_STRING PrimaryWinsServer;
  885. IP_ADDR_STRING SecondaryWinsServer;
  886. // time_t LeaseObtained;
  887. // time_t LeaseExpires;
  888. } ADAPTER_INFO, *PADAPTER_INFO;
  889. //
  890. // FIXED_INFO - the set of IP-related information which does not depend on DHCP
  891. //
  892. typedef struct {
  893. char HostName[MAX_HOSTNAME_LEN + 1];
  894. char DomainName[MAX_DOMAIN_NAME_LEN + 1];
  895. IP_ADDR_STRING DnsServerList;
  896. UINT NodeType;
  897. char ScopeId[MAX_SCOPE_ID_LEN + 1];
  898. UINT EnableRouting;
  899. UINT EnableProxy;
  900. UINT EnableDns;
  901. } FIXED_INFO, *PFIXED_INFO;
  902. //
  903. // DHCP_ADAPTER_INFO - the information returned from DHCP VxD per adapter
  904. //
  905. typedef struct {
  906. DWORD LeaseObtained;
  907. DWORD LeaseExpires;
  908. DWORD DhcpServerIpAddress;
  909. UINT NumberOfDnsServers;
  910. LPDWORD DnsServerIpAddressList;
  911. } DHCP_ADAPTER_INFO, *PDHCP_ADAPTER_INFO;
  912. //
  913. // PHYSICAL_ADAPTER_ADDRESS - structure describing physical adapter
  914. //
  915. typedef struct {
  916. UINT AddressLength;
  917. BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
  918. } PHYSICAL_ADAPTER_ADDRESS, *PPHYSICAL_ADAPTER_ADDRESS;
  919. //
  920. // DHCP_ADAPTER_LIST - list of physical adapters known to DHCP, and therefore
  921. // DHCP-enabled
  922. //
  923. typedef struct {
  924. UINT NumberOfAdapters;
  925. PHYSICAL_ADAPTER_ADDRESS * AdapterList;
  926. } DHCP_ADAPTER_LIST, *PDHCP_ADAPTER_LIST;
  927. PADAPTER_INFO
  928. GetAdapterInfo(
  929. VOID
  930. );
  931. VOID
  932. DeleteAdapterInfo(
  933. IN PADAPTER_INFO AdapterInfo
  934. );
  935. DWORD
  936. BuildIpTdiAddress(
  937. IN LPWSTR Address,
  938. IN LPWSTR Endpoint,
  939. OUT PVOID * TdiAddress,
  940. OUT PULONG TdiAddressLength
  941. );
  942. #define DeleteIpTdiAddress(_addr) LocalFree(_addr)
  943. //
  944. // Validate network name
  945. //
  946. typedef enum _CLRTL_NAME_STATUS {
  947. NetNameOk,
  948. NetNameEmpty,
  949. NetNameTooLong,
  950. NetNameInvalidChars,
  951. NetNameInUse
  952. } CLRTL_NAME_STATUS;
  953. BOOL
  954. ClRtlIsNetNameValid(
  955. IN LPCWSTR NetName,
  956. OUT OPTIONAL CLRTL_NAME_STATUS *Result,
  957. IN BOOL CheckIfExists
  958. );
  959. //
  960. // Security related routines
  961. //
  962. LONG
  963. MapSAToRpcSA(
  964. IN LPSECURITY_ATTRIBUTES lpSA,
  965. IN OUT struct _RPC_SECURITY_ATTRIBUTES *pRpcSA
  966. );
  967. LONG
  968. MapSDToRpcSD(
  969. IN PSECURITY_DESCRIPTOR lpSD,
  970. IN OUT struct _RPC_SECURITY_DESCRIPTOR *pRpcSD
  971. );
  972. DWORD
  973. ClRtlSetObjSecurityInfo(
  974. IN HANDLE hObject,
  975. IN SE_OBJECT_TYPE SeObjType,
  976. IN DWORD dwAdminMask,
  977. IN DWORD dwOwnerMask,
  978. IN DWORD dwEveryOneMask
  979. );
  980. //
  981. // OS checker
  982. //
  983. DWORD
  984. GetServicePack(
  985. VOID
  986. );
  987. BOOL
  988. ClRtlIsOSValid(
  989. VOID
  990. );
  991. BOOL
  992. ClRtlIsOSTypeValid(
  993. VOID
  994. );
  995. //
  996. // A few MULTI_SZ string manipulation routines
  997. //
  998. DWORD
  999. ClRtlMultiSzAppend(
  1000. IN OUT LPWSTR *MultiSz,
  1001. IN OUT LPDWORD StringLength,
  1002. IN LPCWSTR lpString
  1003. );
  1004. DWORD
  1005. ClRtlMultiSzRemove(
  1006. IN LPWSTR lpszMultiSz,
  1007. IN OUT LPDWORD StringLength,
  1008. IN LPCWSTR lpString
  1009. );
  1010. LPCWSTR
  1011. ClRtlMultiSzEnum(
  1012. IN LPCWSTR MszString,
  1013. IN DWORD MszStringLength,
  1014. IN DWORD StringIndex
  1015. );
  1016. DWORD
  1017. ClRtlMultiSzLength(
  1018. IN LPCWSTR lpszMultiSz
  1019. );
  1020. LPCWSTR
  1021. ClRtlMultiSzScan(
  1022. IN LPCWSTR lpszMultiSz,
  1023. IN LPCWSTR lpszString
  1024. );
  1025. DWORD
  1026. ClRtlCreateDirectory(
  1027. IN LPCWSTR lpszPath
  1028. );
  1029. typedef LONG (*PFNCLRTLCREATEKEY)(
  1030. IN PVOID RegistryKey,
  1031. IN LPCWSTR lpszSubKey,
  1032. IN DWORD dwOptions,
  1033. IN REGSAM samDesired,
  1034. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  1035. OUT PVOID * phkResult,
  1036. OUT OPTIONAL LPDWORD lpdwDisposition
  1037. );
  1038. typedef LONG (*PFNCLRTLOPENKEY)(
  1039. IN PVOID RegistryKey,
  1040. IN LPCWSTR lpszSubKey,
  1041. IN REGSAM samDesired,
  1042. OUT PVOID * phkResult
  1043. );
  1044. typedef LONG (*PFNCLRTLCLOSEKEY)(
  1045. IN PVOID RegistryKey
  1046. );
  1047. typedef LONG (*PFNCLRTLENUMVALUE)(
  1048. IN PVOID RegistryKey,
  1049. IN DWORD dwIndex,
  1050. OUT LPWSTR lpszValueName,
  1051. IN OUT LPDWORD lpcbValueName,
  1052. OUT LPDWORD lpType,
  1053. OUT LPBYTE lpData,
  1054. IN OUT LPDWORD lpcbData
  1055. );
  1056. typedef LONG (*PFNCLRTLSETVALUE)(
  1057. IN PVOID RegistryKey,
  1058. IN LPCWSTR lpszValueName,
  1059. IN DWORD dwType,
  1060. IN CONST BYTE* lpData,
  1061. IN DWORD cbData
  1062. );
  1063. typedef LONG (*PFNCLRTLQUERYVALUE)(
  1064. IN PVOID RegistryKey,
  1065. IN LPCWSTR lpszValueName,
  1066. OUT LPDWORD lpValueType,
  1067. OUT LPBYTE lpData,
  1068. IN OUT LPDWORD lpcbData
  1069. );
  1070. typedef struct _CLUSTER_REG_APIS {
  1071. PFNCLRTLCREATEKEY pfnCreateKey;
  1072. PFNCLRTLOPENKEY pfnOpenKey;
  1073. PFNCLRTLCLOSEKEY pfnCloseKey;
  1074. PFNCLRTLSETVALUE pfnSetValue;
  1075. PFNCLRTLQUERYVALUE pfnQueryValue;
  1076. PFNCLRTLENUMVALUE pfnEnumValue;
  1077. } CLUSTER_REG_APIS, *PCLUSTER_REG_APIS;
  1078. DWORD
  1079. WINAPI
  1080. ClRtlEnumProperties(
  1081. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  1082. OUT PVOID OutBuffer,
  1083. IN DWORD OutBufferSize,
  1084. OUT LPDWORD BytesReturned,
  1085. OUT LPDWORD Required
  1086. );
  1087. DWORD
  1088. WINAPI
  1089. ClRtlGetProperties(
  1090. IN PVOID RegistryKey,
  1091. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1092. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  1093. OUT PVOID OutBuffer,
  1094. IN DWORD OutBufferSize,
  1095. OUT LPDWORD BytesReturned,
  1096. OUT LPDWORD Required
  1097. );
  1098. DWORD
  1099. WINAPI
  1100. ClRtlGetPrivateProperties(
  1101. IN PVOID RegistryKey,
  1102. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1103. OUT PVOID OutBuffer,
  1104. IN DWORD OutBufferSize,
  1105. OUT LPDWORD BytesReturned,
  1106. OUT LPDWORD Required
  1107. );
  1108. DWORD
  1109. WINAPI
  1110. ClRtlGetPropertySize(
  1111. IN PVOID RegistryKey,
  1112. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1113. IN const PRESUTIL_PROPERTY_ITEM Property,
  1114. IN OUT LPDWORD BufferSize,
  1115. IN OUT LPDWORD ItemCount
  1116. );
  1117. DWORD
  1118. WINAPI
  1119. ClRtlGetProperty(
  1120. IN PVOID RegistryKey,
  1121. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1122. IN const PRESUTIL_PROPERTY_ITEM Property,
  1123. OUT PVOID * OutBuffer,
  1124. IN OUT LPDWORD OutBufferSize
  1125. );
  1126. DWORD
  1127. WINAPI
  1128. ClRtlpSetPropertyTable(
  1129. IN PVOID RegistryKey,
  1130. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1131. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  1132. IN PVOID Reserved,
  1133. IN BOOL AllowUnknownProperties,
  1134. IN const PVOID InBuffer,
  1135. IN DWORD InBufferSize,
  1136. OUT OPTIONAL LPBYTE OutParams
  1137. );
  1138. DWORD
  1139. WINAPI
  1140. ClRtlSetPropertyParameterBlock(
  1141. IN PVOID RegistryKey,
  1142. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1143. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  1144. IN PVOID Reserved,
  1145. IN const LPBYTE InParams,
  1146. IN const PVOID InBuffer,
  1147. IN DWORD InBufferSize,
  1148. OUT OPTIONAL LPBYTE OutParams
  1149. );
  1150. DWORD
  1151. WINAPI
  1152. ClRtlGetAllProperties(
  1153. IN PVOID RegistryKey,
  1154. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1155. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  1156. OUT PVOID OutBuffer,
  1157. IN DWORD OutBufferSize,
  1158. OUT LPDWORD BytesReturned,
  1159. OUT LPDWORD Required
  1160. );
  1161. DWORD
  1162. WINAPI
  1163. ClRtlGetPropertiesToParameterBlock(
  1164. IN HKEY RegistryKey,
  1165. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1166. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  1167. IN OUT LPBYTE OutParams,
  1168. IN BOOL CheckForRequiredProperties,
  1169. OUT OPTIONAL LPWSTR * NameOfPropInError
  1170. );
  1171. DWORD
  1172. WINAPI
  1173. ClRtlPropertyListFromParameterBlock(
  1174. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  1175. OUT PVOID * OutBuffer,
  1176. IN OUT LPDWORD OutBufferSize,
  1177. IN const LPBYTE InParams,
  1178. OUT LPDWORD BytesReturned,
  1179. OUT LPDWORD Required
  1180. );
  1181. DWORD
  1182. WINAPI
  1183. ClRtlGetUnknownProperties(
  1184. IN PVOID RegistryKey,
  1185. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1186. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  1187. OUT PVOID OutBuffer,
  1188. IN DWORD OutBufferSize,
  1189. OUT LPDWORD BytesReturned,
  1190. OUT LPDWORD Required
  1191. );
  1192. DWORD
  1193. WINAPI
  1194. ClRtlAddUnknownProperties(
  1195. IN PVOID RegistryKey,
  1196. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1197. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  1198. IN OUT PVOID OutBuffer,
  1199. IN DWORD OutBufferSize,
  1200. IN OUT LPDWORD BytesReturned,
  1201. IN OUT LPDWORD Required
  1202. );
  1203. DWORD
  1204. WINAPI
  1205. ClRtlFindProperty(
  1206. IN const PVOID Buffer,
  1207. IN DWORD BufferSize,
  1208. IN LPCWSTR PropName,
  1209. OUT LPDWORD Type
  1210. );
  1211. DWORD
  1212. WINAPI
  1213. ClRtlFindSzProperty(
  1214. IN const PVOID Buffer,
  1215. IN DWORD BufferSize,
  1216. IN LPCWSTR PropName,
  1217. OUT LPWSTR *FoundString
  1218. );
  1219. DWORD
  1220. WINAPI
  1221. ClRtlFindDwordProperty(
  1222. IN const PVOID Buffer,
  1223. IN DWORD BufferSize,
  1224. IN LPCWSTR PropName,
  1225. OUT LPDWORD FoundDword
  1226. );
  1227. __inline
  1228. DWORD
  1229. WINAPI
  1230. ClRtlVerifyPropertyTable(
  1231. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  1232. IN PVOID Reserved,
  1233. IN BOOL AllowUnknownProperties,
  1234. IN const PVOID InBuffer,
  1235. IN DWORD InBufferSize,
  1236. OUT OPTIONAL LPBYTE OutParams
  1237. )
  1238. {
  1239. return ClRtlpSetPropertyTable(NULL, NULL, PropertyTable, Reserved, AllowUnknownProperties, InBuffer, InBufferSize, OutParams);
  1240. }
  1241. __inline
  1242. DWORD
  1243. WINAPI
  1244. ClRtlSetPropertyTable(
  1245. IN PVOID RegistryKey,
  1246. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1247. IN const PRESUTIL_PROPERTY_ITEM PropertyTable,
  1248. IN PVOID Reserved,
  1249. IN BOOL AllowUnknownProperties,
  1250. IN const PVOID InBuffer,
  1251. IN DWORD InBufferSize,
  1252. OUT OPTIONAL LPBYTE OutParams
  1253. )
  1254. {
  1255. if ( (RegistryKey == NULL) ||
  1256. (pClusterRegApis == NULL) ){
  1257. return(ERROR_BAD_ARGUMENTS);
  1258. }
  1259. return ClRtlpSetPropertyTable(RegistryKey, pClusterRegApis, PropertyTable, Reserved, AllowUnknownProperties, InBuffer, InBufferSize, OutParams);
  1260. }
  1261. DWORD
  1262. WINAPI
  1263. ClRtlpSetPrivatePropertyList(
  1264. IN PVOID RegistryKey,
  1265. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1266. IN const PVOID InBuffer,
  1267. IN DWORD InBufferSize
  1268. );
  1269. __inline
  1270. DWORD
  1271. WINAPI
  1272. ClRtlVerifyPrivatePropertyList(
  1273. IN const PVOID InBuffer,
  1274. IN DWORD InBufferSize
  1275. )
  1276. {
  1277. return ClRtlpSetPrivatePropertyList(NULL, NULL, InBuffer, InBufferSize);
  1278. }
  1279. __inline
  1280. DWORD
  1281. WINAPI
  1282. ClRtlSetPrivatePropertyList(
  1283. IN PVOID RegistryKey,
  1284. IN const PCLUSTER_REG_APIS pClusterRegApis,
  1285. IN const PVOID InBuffer,
  1286. IN DWORD InBufferSize
  1287. )
  1288. {
  1289. if ( (RegistryKey == NULL) ||
  1290. (pClusterRegApis == NULL) ){
  1291. return(ERROR_BAD_ARGUMENTS);
  1292. }
  1293. return ClRtlpSetPrivatePropertyList(RegistryKey, pClusterRegApis, InBuffer, InBufferSize);
  1294. }
  1295. DWORD
  1296. WINAPI
  1297. ClRtlGetBinaryValue(
  1298. IN HKEY ClusterKey,
  1299. IN LPCWSTR ValueName,
  1300. OUT LPBYTE * OutValue,
  1301. OUT LPDWORD OutValueSize,
  1302. IN PFNCLRTLQUERYVALUE pfnQueryValue
  1303. );
  1304. LPWSTR
  1305. WINAPI
  1306. ClRtlGetSzValue(
  1307. IN HKEY ClusterKey,
  1308. IN LPCWSTR ValueName,
  1309. IN PFNCLRTLQUERYVALUE pfnQueryValue
  1310. );
  1311. DWORD
  1312. WINAPI
  1313. ClRtlDupParameterBlock(
  1314. OUT LPBYTE OutParams,
  1315. IN const LPBYTE InParams,
  1316. IN const PRESUTIL_PROPERTY_ITEM PropertyTable
  1317. );
  1318. void
  1319. WINAPI
  1320. ClRtlFreeParameterBlock(
  1321. OUT LPBYTE OutParams,
  1322. IN const LPBYTE InParams,
  1323. IN const PRESUTIL_PROPERTY_ITEM PropertyTable
  1324. );
  1325. //
  1326. // Miscellaneous Routines
  1327. //
  1328. LPWSTR
  1329. ClRtlMakeGuid(
  1330. VOID
  1331. );
  1332. #ifdef __cplusplus
  1333. }
  1334. #endif
  1335. #endif // ifndef _CLUSRTL_INCLUDED_
  1336.