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.

844 lines
17 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. NdsProcs.h
  5. Abstract:
  6. This defines the necessary NDS data structures and
  7. symbolic constants.
  8. Author:
  9. Cory West [CoryWest] 23-Feb-1995
  10. Revision History:
  11. --*/
  12. #include "data.h"
  13. #include "nodetype.h"
  14. #include "struct.h"
  15. #include <stdarg.h>
  16. #include "crypto.h"
  17. //
  18. // Security information.
  19. //
  20. #define ENC_TYPE_RSA_PUBLIC 0x90001
  21. #define ENC_TYPE_RC2_CBC 0x60001
  22. #define RAND_KEY_DATA_LEN 28
  23. #define RAND_FL_DATA_LEN 1024
  24. #define RC2_KEY_LEN 8
  25. #define MAX_PUBLIC_KEY_LEN 1300
  26. #define MAX_BSAFE_PUBLIC_KEY_LEN 200 // Typically 179.
  27. #define MAX_BSAFE_PRIV_KEY_LEN 280 // Typically 273.
  28. #define MAX_PW_CHARS 16
  29. //
  30. // The max size for various NDS components.
  31. //
  32. #define MAX_RSA_BITS 512 // Really 420.
  33. #define NDS_TREE_NAME_LEN 32
  34. #define NDS_BINDERY_TREE_NAME 48
  35. #define MAX_CREDENTIAL_LEN ( sizeof( NDS_CREDENTIAL ) + MAX_NDS_NAME_SIZE )
  36. #define MAX_SIGNATURE_LEN ( sizeof( NDS_SIGNATURE ) + MAX_RSA_BYTES )
  37. #define MAX_ENC_PRIV_KEY_LEN ( MAX_BSAFE_PRIV_KEY_LEN + 64 )
  38. #define BSAFE_CHECKSUM_LEN 5
  39. #define DEFAULT_RESOLVE_FLAGS RSLV_DEREF_ALIASES | RSLV_WALK_TREE | RSLV_WRITABLE
  40. #include <packon.h>
  41. typedef struct {
  42. DWORD syntaxId; // OCTET STRING (9)
  43. struct {
  44. DWORD nameLength;
  45. WORD name[11]; // "Public Key"
  46. WORD filler;
  47. } attribName;
  48. DWORD entries; // = 1
  49. DWORD totalLength; // of attribute value OCTET STRING
  50. DWORD unknown1; // = 1
  51. DWORD unknown2; // = 4
  52. WORD _issuerDNLength;
  53. WORD totalDNLength;
  54. WORD length2;
  55. WORD length3;
  56. WORD issuerDNLength;
  57. WORD userDNLength;
  58. WORD bsafeSectionLength;
  59. DWORD length4;
  60. } PUBLIC_KEY_ATTRIB;
  61. #include <packoff.h>
  62. typedef struct {
  63. DWORD blockLength; // cipherLength + size of following hdr fields
  64. DWORD version; // = 1
  65. DWORD encType; // 0x060001 for RC2; 0x090001 and 0x0A0001 for RSA
  66. WORD cipherLength; // of ciphertext
  67. WORD dataLength; // of plaintext
  68. } ENC_BLOCK_HDR, *PENC_BLOCK_HDR;
  69. typedef struct {
  70. DWORD rand1;
  71. DWORD rand2Len;
  72. BYTE rand2[RAND_FL_DATA_LEN];
  73. } NDS_RAND_BYTE_BLOCK, *PNDS_RAND_BYTE_BLOCK;
  74. typedef struct {
  75. DWORD version;
  76. DWORD verb;
  77. DWORD svrRand;
  78. DWORD credentialLength;
  79. } NDS_AUTH_MSG, *PNDS_AUTH_MSG;
  80. //
  81. // VLM Uses the Tagged Data Store as a sort of registry on the fly.
  82. // We, of course, don't use it, but still need the headers.
  83. //
  84. // We need these to be packed.
  85. //
  86. #include <packon.h>
  87. typedef struct {
  88. DWORD version;
  89. WORD tag;
  90. } TAG_DATA_HEADER;
  91. #define TAG_PRIVATE_KEY 2
  92. #define TAG_PUBLIC_KEY 4
  93. #define TAG_CREDENTIAL 6
  94. #define TAG_SIGNATURE 7
  95. #define TAG_PROOF 8
  96. typedef struct {
  97. TAG_DATA_HEADER tdh;
  98. DWORD validityBegin;
  99. DWORD validityEnd;
  100. DWORD random;
  101. WORD optDataSize;
  102. WORD userNameLength;
  103. // BYTE optData[optDataSize];
  104. // BYTE userName[userNameLength];
  105. } NDS_CREDENTIAL, *PNDS_CREDENTIAL;
  106. typedef struct {
  107. TAG_DATA_HEADER tdh;
  108. WORD signDataLength;
  109. //BYTE signData[signLength];
  110. } NDS_SIGNATURE, *PNDS_SIGNATURE;
  111. typedef struct {
  112. TAG_DATA_HEADER tdh;
  113. WORD keyDataLength;
  114. //BYTE BsafeKeyData[keyDataLength];
  115. } NDS_PRIVATE_KEY, *PNDS_PRIVATE_KEY;
  116. typedef struct {
  117. DWORD dwMaxFragSize;
  118. DWORD dwRequestSize;
  119. DWORD dwFragmentFlags;
  120. DWORD dwNdsVerb;
  121. DWORD dwReplyBufferSize;
  122. } NDS_REQUEST_HEADER, *PNDS_REQUEST_HEADER;
  123. typedef struct {
  124. DWORD dwFragmentSize;
  125. DWORD dwFraggerHandle;
  126. } NDS_REPLY_HEADER, *PNDS_REPLY_HEADER;
  127. #include <packoff.h>
  128. typedef struct _NDS_CONTEXT_HEAD {
  129. //
  130. // Node id and list entries.
  131. //
  132. NODE_TYPE_CODE ntc;
  133. NODE_BYTE_SIZE nts;
  134. //
  135. // We can set this flag if we need to pause
  136. // all tree activity (like, for a logout).
  137. //
  138. BOOLEAN CredentialLocked;
  139. LIST_ENTRY Next;
  140. //
  141. // User's credentials.
  142. //
  143. PNDS_CREDENTIAL Credential;
  144. //
  145. // User's signature.
  146. //
  147. PNDS_SIGNATURE Signature;
  148. //
  149. // Password for this tree connection.
  150. //
  151. OEM_STRING Password;
  152. //
  153. // User's public key.
  154. //
  155. DWORD PublicKeyLen;
  156. BYTE *PublicNdsKey;
  157. //
  158. // If this is a supplemental credential, we track
  159. // the handle count and the last close time so that
  160. // we can delete the credential when the last
  161. // handle closes.
  162. //
  163. PLOGON pOwningLogon;
  164. ULONG SupplementalHandleCount;
  165. LARGE_INTEGER LastUsedTime;
  166. //
  167. // NDS tree name. Leave enough room for the munged credential name.
  168. //
  169. UNICODE_STRING NdsTreeName;
  170. WCHAR NdsTreeNameBuffer[NDS_TREE_NAME_LEN + MAX_NDS_NAME_CHARS + 2];
  171. //
  172. // The current context for this tree.
  173. //
  174. UNICODE_STRING CurrentContext;
  175. WCHAR CurrentContextString[MAX_NDS_NAME_CHARS];
  176. } NDS_SECURITY_CONTEXT, *PNDS_SECURITY_CONTEXT;
  177. typedef struct _NDS_CHPW_MSG {
  178. DWORD challenge;
  179. DWORD oldPwLength;
  180. BYTE oldPwHash[16];
  181. DWORD unknown;
  182. DWORD newPwLength;
  183. BYTE newPwHash[16];
  184. ENC_BLOCK_HDR encPrivKeyHdr;
  185. // BYTE encPrivKey[];
  186. } NDS_CHPW_MSG, *PNDS_CHPW_MSG;
  187. //
  188. // Credential list handling routines.
  189. //
  190. #define NwAcquireExclusiveCredList( pLogon, pIrpContext ) \
  191. ExAcquireResourceExclusiveLite( &((pLogon)->CredentialListResource), TRUE ); \
  192. SetFlag( (pIrpContext)->Flags, IRP_FLAG_HAS_CREDENTIAL_LOCK )
  193. #define NwReleaseCredList( pLogon, pIrpContext ) \
  194. ClearFlag( (pIrpContext)->Flags, IRP_FLAG_HAS_CREDENTIAL_LOCK ); \
  195. ExReleaseResourceLite( &((pLogon)->CredentialListResource) )
  196. #include <packon.h>
  197. typedef struct {
  198. DWORD verb;
  199. UINT count;
  200. char *bufEnd;
  201. PVOID nextItem;
  202. } NDS_TAG, *PNDS_TAG;
  203. #include <packoff.h>
  204. typedef struct _nds_list_response {
  205. DWORD ccode;
  206. DWORD iterationHandle;
  207. DWORD numEntries;
  208. //
  209. // Followed by an array of these.
  210. //
  211. // struct {
  212. // DWORD entryId;
  213. // DWORD flags;
  214. // DWORD subCount;
  215. // DWORD modTime;
  216. // NDS_STRING BaseClass;
  217. // NDS_STRING entryName;
  218. // } [];
  219. //
  220. } NDS_LIST_RESPONSE, *PNDS_LIST_RESPONSE;
  221. typedef struct _locked_buffer {
  222. //
  223. // Describes a writeable response buffer
  224. // that we have locked down for the transport.
  225. //
  226. PVOID pRecvBufferVa;
  227. DWORD dwRecvLen;
  228. PMDL pRecvMdl;
  229. DWORD dwBytesWritten;
  230. } LOCKED_BUFFER, *PLOCKED_BUFFER;
  231. //
  232. // Some of the response packet formats from ndsapi32.h
  233. //
  234. typedef struct {
  235. DWORD CompletionCode;
  236. DWORD RemoteEntry;
  237. DWORD EntryId;
  238. DWORD ServerAddresses;
  239. DWORD AddressType;
  240. DWORD AddressLength;
  241. //
  242. // The address is of length
  243. // AddressLength, of course.
  244. //
  245. BYTE Address[1];
  246. } NDS_WIRE_RESPONSE_RESOLVE_NAME, *PNDS_WIRE_RESPONSE_RESOLVE_NAME;
  247. typedef struct {
  248. DWORD CompletionCode;
  249. DWORD RemoteEntry;
  250. DWORD EntryId;
  251. DWORD Unknown;
  252. DWORD ServerAddresses;
  253. DWORD AddressType;
  254. DWORD AddressLength;
  255. //
  256. // The address is of length
  257. // AddressLength, of course.
  258. //
  259. BYTE Address[1];
  260. } NDS_WIRE_RESPONSE_RESOLVE_NAME_REFERRAL,
  261. *PNDS_WIRE_RESPONSE_RESOLVE_NAME_REFERRAL;
  262. //
  263. // Strings for searching ds attributes.
  264. //
  265. #define PUBLIC_KEY_ATTRIBUTE L"Public Key"
  266. #define VOLUME_ATTRIBUTE L"Volume"
  267. #define QUEUE_ATTRIBUTE L"Queue"
  268. #define DIR_MAP_ATTRIBUTE L"Directory Map"
  269. #define HOST_SERVER_ATTRIBUTE L"Host Server"
  270. #define HOST_VOLUME_ATTRIBUTE L"Host Resource Name"
  271. #define HOST_QUEUE_ATTRIBUTE L"CN"
  272. #define HOST_PATH_ATTRIBUTE L"Path"
  273. //
  274. // Prototypes from ndslogin.c
  275. //
  276. NTSTATUS
  277. NdsCanonUserName(
  278. IN PNDS_SECURITY_CONTEXT pNdsContext,
  279. IN PUNICODE_STRING puUserName,
  280. IN OUT PUNICODE_STRING puCanonUserName
  281. );
  282. NTSTATUS
  283. NdsCheckCredentials(
  284. IN PIRP_CONTEXT pIrpContext,
  285. IN PUNICODE_STRING puUserName,
  286. IN PUNICODE_STRING puPassword
  287. );
  288. NTSTATUS
  289. NdsCheckCredentialsEx(
  290. IN PIRP_CONTEXT pIrpContext,
  291. IN PLOGON pLogon,
  292. IN PNDS_SECURITY_CONTEXT pNdsContext,
  293. IN PUNICODE_STRING puUserName,
  294. IN PUNICODE_STRING puPassword
  295. );
  296. #define CREDENTIAL_READ 0
  297. #define CREDENTIAL_WRITE 1
  298. NTSTATUS
  299. NdsLookupCredentials(
  300. IN PIRP_CONTEXT pIrpContext,
  301. IN PUNICODE_STRING puTreeName,
  302. IN PLOGON pLogon,
  303. OUT PNDS_SECURITY_CONTEXT *ppCredentials,
  304. DWORD dwDesiredAccess,
  305. BOOLEAN fCreate
  306. );
  307. NTSTATUS
  308. NdsLookupCredentials2(
  309. IN PIRP_CONTEXT pIrpContext,
  310. IN PUNICODE_STRING puTreeName,
  311. IN PLOGON pLogon,
  312. OUT PNDS_SECURITY_CONTEXT *ppCredentials,
  313. BOOL LowerIrpHasLock
  314. );
  315. NTSTATUS
  316. NdsGetCredentials(
  317. IN PIRP_CONTEXT pIrpContext,
  318. IN PLOGON pLogon,
  319. IN PUNICODE_STRING puUserName,
  320. IN PUNICODE_STRING puPassword
  321. );
  322. NTSTATUS
  323. ChangeNdsPassword(
  324. PIRP_CONTEXT pIrpContext,
  325. DWORD dwUserOID,
  326. DWORD dwChallenge,
  327. PBYTE pbOldPwHash,
  328. PBYTE pbNewPwHash,
  329. PNDS_PRIVATE_KEY pUserPrivKey,
  330. PBYTE pServerPublicBsafeKey,
  331. UINT ServerPubKeyLen,
  332. USHORT NewPassLen
  333. );
  334. NTSTATUS
  335. DoNdsLogon(
  336. IN PIRP_CONTEXT pIrpContext,
  337. IN PUNICODE_STRING UserName,
  338. IN PUNICODE_STRING Password
  339. );
  340. NTSTATUS
  341. NdsTreeLogin(
  342. IN PIRP_CONTEXT pIrpContext,
  343. IN PUNICODE_STRING puUser,
  344. IN POEM_STRING pOemPassword,
  345. IN POEM_STRING pOemNewPassword,
  346. IN PLOGON pUserLogon
  347. );
  348. NTSTATUS
  349. BeginLogin(
  350. IN PIRP_CONTEXT pIrpContext,
  351. IN DWORD userId,
  352. OUT DWORD *loginId,
  353. OUT DWORD *challenge
  354. );
  355. NTSTATUS
  356. FinishLogin(
  357. IN PIRP_CONTEXT pIrpContext,
  358. IN DWORD dwUserOID,
  359. IN DWORD dwLoginFlags,
  360. IN BYTE pbEncryptedChallenge[16],
  361. IN BYTE *pbServerPublicBsafeKey,
  362. IN int cbServerPublicBsafeKeyLen,
  363. OUT BYTE *pbUserEncPrivateNdsKey,
  364. OUT int *pcbUserEncPrivateNdsKeyLen,
  365. OUT DWORD *pdwCredentialStartTime,
  366. OUT DWORD *pdwCredentialEndTime
  367. );
  368. NTSTATUS
  369. NdsServerAuthenticate(
  370. IN PIRP_CONTEXT pIrpContext,
  371. IN PNDS_SECURITY_CONTEXT pNdsContext
  372. );
  373. NTSTATUS BeginAuthenticate(
  374. IN PIRP_CONTEXT pIrpContext,
  375. IN DWORD dwUserId,
  376. OUT DWORD *pdwSvrRandom
  377. );
  378. NTSTATUS
  379. NdsLicenseConnection(
  380. PIRP_CONTEXT pIrpContext
  381. );
  382. NTSTATUS
  383. NdsUnlicenseConnection(
  384. PIRP_CONTEXT pIrpContext
  385. );
  386. NTSTATUS
  387. NdsLogoff(
  388. IN PIRP_CONTEXT pIrpContext
  389. );
  390. //
  391. // Prototypes from fragex.c
  392. //
  393. NTSTATUS
  394. FragExWithWait(
  395. IN PIRP_CONTEXT pIrpContext,
  396. IN DWORD NdsVerb,
  397. IN PLOCKED_BUFFER pReplyBuffer,
  398. IN BYTE *NdsRequestStr,
  399. ...
  400. );
  401. int
  402. _cdecl
  403. FormatBuf(
  404. char *buf,
  405. int bufLen,
  406. const char *format,
  407. va_list args
  408. );
  409. int
  410. _cdecl
  411. FormatBufS(
  412. char *buf,
  413. int bufLen,
  414. const char *format,
  415. ...
  416. );
  417. //
  418. // Prototypes from ndsfsctl.c
  419. //
  420. NTSTATUS
  421. NdsCreateTreeScb(
  422. IN PIRP_CONTEXT pIrpContext,
  423. IN OUT PSCB *ppScb,
  424. IN PUNICODE_STRING puTree,
  425. IN PUNICODE_STRING puUserName,
  426. IN PUNICODE_STRING puPassword,
  427. IN BOOLEAN DeferredLogon,
  428. IN BOOLEAN DeleteOnClose
  429. );
  430. NTSTATUS
  431. NdsLookupServerName(
  432. PSCB pTreeScb,
  433. PIRP_CONTEXT pIrpContext,
  434. IPXaddress *pDirServerAddress,
  435. POEM_STRING pOemServerServerName
  436. );
  437. NTSTATUS
  438. DispatchNds(
  439. IN ULONG IoctlCode,
  440. IN PIRP_CONTEXT IrpContext
  441. );
  442. NTSTATUS
  443. PrepareLockedBufferFromFsd(
  444. PIRP_CONTEXT pIrpContext,
  445. PLOCKED_BUFFER pLockedBuffer
  446. );
  447. NTSTATUS
  448. DoBrowseFsctl( PIRP_CONTEXT pIrpContext,
  449. ULONG IoctlCode,
  450. BOOL LockdownBuffer
  451. );
  452. NTSTATUS
  453. ConnectBinderyVolume(
  454. PIRP_CONTEXT pIrpContext,
  455. PUNICODE_STRING puServerName,
  456. PUNICODE_STRING puVolumeName
  457. );
  458. NTSTATUS
  459. HandleVolumeAttach(
  460. PIRP_CONTEXT pIrpContext,
  461. PUNICODE_STRING puServerName,
  462. PUNICODE_STRING puVolumeName
  463. );
  464. NTSTATUS
  465. NdsGetDsObjectFromPath(
  466. IN PIRP_CONTEXT pIrpContext,
  467. OUT PUNICODE_STRING puDsObject
  468. );
  469. #define NDS_OBJECTTYPE_VOLUME 1
  470. #define NDS_OBJECTTYPE_QUEUE 2
  471. #define NDS_OBJECTTYPE_DIRMAP 3
  472. NTSTATUS
  473. NdsVerifyObject(
  474. IN PIRP_CONTEXT pIrpContext,
  475. IN PUNICODE_STRING puVolumeObject,
  476. IN BOOLEAN fAllowServerJump,
  477. IN DWORD dwResolverFlags,
  478. OUT PDWORD pdwVolumeOid,
  479. OUT PDWORD pdwObjectType
  480. );
  481. NTSTATUS
  482. NdsMapObjectToServerShare(
  483. PIRP_CONTEXT pIrpContext,
  484. PSCB *ppScb,
  485. PUNICODE_STRING puServerSharePath,
  486. BOOLEAN CreateTreeConnection,
  487. PDWORD pdwObjectId
  488. );
  489. NTSTATUS
  490. NdsVerifyContext(
  491. PIRP_CONTEXT pIrpContext,
  492. PUNICODE_STRING puTree,
  493. PUNICODE_STRING puContext
  494. );
  495. NTSTATUS
  496. NdsRawFragex(
  497. PIRP_CONTEXT pIrpContext
  498. );
  499. NTSTATUS
  500. NdsChangePass(
  501. PIRP_CONTEXT pIrpContext
  502. );
  503. NTSTATUS
  504. NdsListTrees(
  505. PIRP_CONTEXT pIrpContext
  506. );
  507. //
  508. // Browsing prototypes from ndsread.c
  509. //
  510. NTSTATUS
  511. NdsGetServerBasicName(
  512. IN PUNICODE_STRING pServerX500Name,
  513. IN OUT PUNICODE_STRING pServerName
  514. );
  515. NTSTATUS
  516. NdsResolveName(
  517. IN PIRP_CONTEXT pIrpContext,
  518. IN PNWR_NDS_REQUEST_PACKET pNdsRequest,
  519. IN ULONG RequestLength,
  520. IN PLOCKED_BUFFER pLockedBuffer
  521. );
  522. NTSTATUS
  523. NdsGetObjectInfo(
  524. IN PIRP_CONTEXT pIrpContext,
  525. IN PNWR_NDS_REQUEST_PACKET pNdsRequest,
  526. IN PLOCKED_BUFFER pLockedBuffer
  527. );
  528. NTSTATUS
  529. NdsListSubordinates(
  530. IN PIRP_CONTEXT pIrpContext,
  531. IN PNWR_NDS_REQUEST_PACKET pNdsRequest,
  532. IN PLOCKED_BUFFER pLockedBuffer
  533. );
  534. NTSTATUS
  535. NdsReadAttributes(
  536. PIRP_CONTEXT pIrpContext,
  537. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  538. ULONG RequestLength,
  539. PLOCKED_BUFFER pLockedBuffer
  540. );
  541. NTSTATUS
  542. NdsReadAttributesKm(
  543. PIRP_CONTEXT pIrpContext,
  544. DWORD dwObjectId,
  545. PUNICODE_STRING puAttribute,
  546. PLOCKED_BUFFER pLockedBuffer
  547. );
  548. NTSTATUS
  549. NdsOpenStream(
  550. PIRP_CONTEXT pIrpContext,
  551. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  552. ULONG RequestLength
  553. );
  554. NTSTATUS
  555. NdsSetContext(
  556. PIRP_CONTEXT pIrpContext,
  557. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  558. ULONG RequestLength
  559. );
  560. NTSTATUS
  561. NdsGetContext(
  562. PIRP_CONTEXT pIrpContext,
  563. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  564. ULONG RequestLength
  565. );
  566. NTSTATUS
  567. NdsVerifyTreeHandle(
  568. PIRP_CONTEXT pIrpContext,
  569. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  570. ULONG RequestLength
  571. );
  572. NTSTATUS
  573. NdsGetPrintQueueInfo(
  574. PIRP_CONTEXT pIrpContext,
  575. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  576. ULONG RequestLength
  577. );
  578. NTSTATUS
  579. NdsGetVolumeInformation(
  580. PIRP_CONTEXT pIrpContext,
  581. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  582. ULONG RequestLength
  583. );
  584. //
  585. // Kernel mode browsing prototypes from ndsread.c
  586. //
  587. NTSTATUS
  588. NdsResolveNameKm (
  589. PIRP_CONTEXT pIrpContext,
  590. IN PUNICODE_STRING puObjectName,
  591. OUT DWORD *dwObjectId,
  592. BOOLEAN AllowDsJump,
  593. DWORD dwFlags
  594. );
  595. NTSTATUS
  596. NdsReadStringAttribute(
  597. PIRP_CONTEXT pIrpContext,
  598. IN DWORD dwObjectId,
  599. IN PUNICODE_STRING puAttributeName,
  600. OUT PUNICODE_STRING puAttributeVal
  601. );
  602. NTSTATUS
  603. NdsGetServerName(
  604. IN PIRP_CONTEXT pIrpContext,
  605. OUT PUNICODE_STRING pUnicodeString
  606. );
  607. NTSTATUS
  608. NdsGetUserName(
  609. IN PIRP_CONTEXT pIrpContext,
  610. IN DWORD dwUserOid,
  611. OUT PUNICODE_STRING puUserName
  612. );
  613. //
  614. // Other helper prototypes from ndsread.c
  615. //
  616. VOID
  617. FreeNdsContext(
  618. PNDS_SECURITY_CONTEXT pNdsContext
  619. );
  620. VOID
  621. NdsPing(
  622. IN PIRP_CONTEXT pIrpContext,
  623. IN PSCB pScb
  624. );
  625. NTSTATUS
  626. NdsSelectConnection(
  627. PIRP_CONTEXT pIrpContext,
  628. PUNICODE_STRING puTreeName,
  629. PUNICODE_STRING puUserName,
  630. PUNICODE_STRING puPassword,
  631. BOOL DeferredLogon,
  632. BOOL UseBinderyConnections,
  633. PNONPAGED_SCB *ppNpScb
  634. );
  635. NTSTATUS
  636. NdsCompletionCodetoNtStatus(
  637. IN PLOCKED_BUFFER pLockedBuffer
  638. );
  639. NTSTATUS
  640. NdsReadPublicKey(
  641. IN PIRP_CONTEXT pIrpContext,
  642. IN DWORD entryId,
  643. OUT BYTE *pPubKeyVal,
  644. IN DWORD *pPubKeyLen
  645. );
  646. int
  647. NdsGetBsafeKey(
  648. UCHAR *pPubKey,
  649. const int pubKeyLen,
  650. UCHAR **ppBsafeKey
  651. );
  652. NTSTATUS
  653. NdsAllocateLockedBuffer(
  654. PLOCKED_BUFFER NdsRequest,
  655. DWORD BufferSize
  656. );
  657. NTSTATUS
  658. NdsFreeLockedBuffer(
  659. PLOCKED_BUFFER NdsRequest
  660. );