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.

853 lines
16 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. #define NT_GATEWAY_GROUP L"NTGATEWAY"
  274. #define GROUPS_ATTRIBUTE L"Group Membership"
  275. //
  276. // Prototypes from ndslogin.c
  277. //
  278. NTSTATUS
  279. NdsCanonUserName(
  280. IN PNDS_SECURITY_CONTEXT pNdsContext,
  281. IN PUNICODE_STRING puUserName,
  282. IN OUT PUNICODE_STRING puCanonUserName
  283. );
  284. NTSTATUS
  285. NdsCheckCredentials(
  286. IN PIRP_CONTEXT pIrpContext,
  287. IN PUNICODE_STRING puUserName,
  288. IN PUNICODE_STRING puPassword
  289. );
  290. NTSTATUS
  291. NdsCheckCredentialsEx(
  292. IN PIRP_CONTEXT pIrpContext,
  293. IN PLOGON pLogon,
  294. IN PNDS_SECURITY_CONTEXT pNdsContext,
  295. IN PUNICODE_STRING puUserName,
  296. IN PUNICODE_STRING puPassword
  297. );
  298. #define CREDENTIAL_READ 0
  299. #define CREDENTIAL_WRITE 1
  300. NTSTATUS
  301. NdsLookupCredentials(
  302. IN PIRP_CONTEXT pIrpContext,
  303. IN PUNICODE_STRING puTreeName,
  304. IN PLOGON pLogon,
  305. OUT PNDS_SECURITY_CONTEXT *ppCredentials,
  306. DWORD dwDesiredAccess,
  307. BOOLEAN fCreate
  308. );
  309. NTSTATUS
  310. NdsLookupCredentials2(
  311. IN PIRP_CONTEXT pIrpContext,
  312. IN PUNICODE_STRING puTreeName,
  313. IN PLOGON pLogon,
  314. OUT PNDS_SECURITY_CONTEXT *ppCredentials,
  315. BOOL LowerIrpHasLock
  316. );
  317. NTSTATUS
  318. NdsGetCredentials(
  319. IN PIRP_CONTEXT pIrpContext,
  320. IN PLOGON pLogon,
  321. IN PUNICODE_STRING puUserName,
  322. IN PUNICODE_STRING puPassword
  323. );
  324. NTSTATUS
  325. ChangeNdsPassword(
  326. PIRP_CONTEXT pIrpContext,
  327. DWORD dwUserOID,
  328. DWORD dwChallenge,
  329. PBYTE pbOldPwHash,
  330. PBYTE pbNewPwHash,
  331. PNDS_PRIVATE_KEY pUserPrivKey,
  332. PBYTE pServerPublicBsafeKey,
  333. UINT ServerPubKeyLen,
  334. USHORT NewPassLen
  335. );
  336. NTSTATUS
  337. DoNdsLogon(
  338. IN PIRP_CONTEXT pIrpContext,
  339. IN PUNICODE_STRING UserName,
  340. IN PUNICODE_STRING Password
  341. );
  342. NTSTATUS
  343. NdsTreeLogin(
  344. IN PIRP_CONTEXT pIrpContext,
  345. IN PUNICODE_STRING puUser,
  346. IN POEM_STRING pOemPassword,
  347. IN POEM_STRING pOemNewPassword,
  348. IN PLOGON pUserLogon
  349. );
  350. NTSTATUS
  351. BeginLogin(
  352. IN PIRP_CONTEXT pIrpContext,
  353. IN DWORD userId,
  354. OUT DWORD *loginId,
  355. OUT DWORD *challenge
  356. );
  357. NTSTATUS
  358. FinishLogin(
  359. IN PIRP_CONTEXT pIrpContext,
  360. IN DWORD dwUserOID,
  361. IN DWORD dwLoginFlags,
  362. IN BYTE pbEncryptedChallenge[16],
  363. IN BYTE *pbServerPublicBsafeKey,
  364. IN int cbServerPublicBsafeKeyLen,
  365. OUT BYTE *pbUserEncPrivateNdsKey,
  366. OUT int *pcbUserEncPrivateNdsKeyLen,
  367. OUT DWORD *pdwCredentialStartTime,
  368. OUT DWORD *pdwCredentialEndTime
  369. );
  370. NTSTATUS
  371. NdsServerAuthenticate(
  372. IN PIRP_CONTEXT pIrpContext,
  373. IN PNDS_SECURITY_CONTEXT pNdsContext
  374. );
  375. NTSTATUS BeginAuthenticate(
  376. IN PIRP_CONTEXT pIrpContext,
  377. IN DWORD dwUserId,
  378. OUT DWORD *pdwSvrRandom
  379. );
  380. NTSTATUS
  381. NdsLicenseConnection(
  382. PIRP_CONTEXT pIrpContext
  383. );
  384. NTSTATUS
  385. NdsUnlicenseConnection(
  386. PIRP_CONTEXT pIrpContext
  387. );
  388. NTSTATUS
  389. NdsLogoff(
  390. IN PIRP_CONTEXT pIrpContext
  391. );
  392. //
  393. // Prototypes from fragex.c
  394. //
  395. NTSTATUS
  396. FragExWithWait(
  397. IN PIRP_CONTEXT pIrpContext,
  398. IN DWORD NdsVerb,
  399. IN PLOCKED_BUFFER pReplyBuffer,
  400. IN BYTE *NdsRequestStr,
  401. ...
  402. );
  403. int
  404. _cdecl
  405. FormatBuf(
  406. char *buf,
  407. int bufLen,
  408. const char *format,
  409. va_list args
  410. );
  411. int
  412. _cdecl
  413. FormatBufS(
  414. char *buf,
  415. int bufLen,
  416. const char *format,
  417. ...
  418. );
  419. //
  420. // Prototypes from ndsfsctl.c
  421. //
  422. NTSTATUS
  423. NdsCreateTreeScb(
  424. IN PIRP_CONTEXT pIrpContext,
  425. IN OUT PSCB *ppScb,
  426. IN PUNICODE_STRING puTree,
  427. IN PUNICODE_STRING puUserName,
  428. IN PUNICODE_STRING puPassword,
  429. IN BOOLEAN DeferredLogon,
  430. IN BOOLEAN DeleteOnClose
  431. );
  432. NTSTATUS
  433. NdsLookupServerName(
  434. PSCB pTreeScb,
  435. PIRP_CONTEXT pIrpContext,
  436. IPXaddress *pDirServerAddress,
  437. POEM_STRING pOemServerServerName
  438. );
  439. NTSTATUS
  440. DispatchNds(
  441. IN ULONG IoctlCode,
  442. IN PIRP_CONTEXT IrpContext
  443. );
  444. NTSTATUS
  445. PrepareLockedBufferFromFsd(
  446. PIRP_CONTEXT pIrpContext,
  447. PLOCKED_BUFFER pLockedBuffer
  448. );
  449. NTSTATUS
  450. DoBrowseFsctl( PIRP_CONTEXT pIrpContext,
  451. ULONG IoctlCode,
  452. BOOL LockdownBuffer
  453. );
  454. NTSTATUS
  455. ConnectBinderyVolume(
  456. PIRP_CONTEXT pIrpContext,
  457. PUNICODE_STRING puServerName,
  458. PUNICODE_STRING puVolumeName
  459. );
  460. NTSTATUS
  461. HandleVolumeAttach(
  462. PIRP_CONTEXT pIrpContext,
  463. PUNICODE_STRING puServerName,
  464. PUNICODE_STRING puVolumeName
  465. );
  466. NTSTATUS
  467. NdsGetDsObjectFromPath(
  468. IN PIRP_CONTEXT pIrpContext,
  469. OUT PUNICODE_STRING puDsObject
  470. );
  471. #define NDS_OBJECTTYPE_VOLUME 1
  472. #define NDS_OBJECTTYPE_QUEUE 2
  473. #define NDS_OBJECTTYPE_DIRMAP 3
  474. NTSTATUS
  475. NdsVerifyObject(
  476. IN PIRP_CONTEXT pIrpContext,
  477. IN PUNICODE_STRING puVolumeObject,
  478. IN BOOLEAN fAllowServerJump,
  479. IN DWORD dwResolverFlags,
  480. OUT PDWORD pdwVolumeOid,
  481. OUT PDWORD pdwObjectType
  482. );
  483. NTSTATUS
  484. NdsMapObjectToServerShare(
  485. PIRP_CONTEXT pIrpContext,
  486. PSCB *ppScb,
  487. PUNICODE_STRING puServerSharePath,
  488. BOOLEAN CreateTreeConnection,
  489. PDWORD pdwObjectId
  490. );
  491. NTSTATUS
  492. NdsVerifyContext(
  493. PIRP_CONTEXT pIrpContext,
  494. PUNICODE_STRING puTree,
  495. PUNICODE_STRING puContext
  496. );
  497. NTSTATUS
  498. NdsRawFragex(
  499. PIRP_CONTEXT pIrpContext
  500. );
  501. NTSTATUS
  502. NdsChangePass(
  503. PIRP_CONTEXT pIrpContext
  504. );
  505. NTSTATUS
  506. NdsListTrees(
  507. PIRP_CONTEXT pIrpContext
  508. );
  509. //
  510. // Browsing prototypes from ndsread.c
  511. //
  512. NTSTATUS
  513. NdsGetServerBasicName(
  514. IN PUNICODE_STRING pServerX500Name,
  515. IN OUT PUNICODE_STRING pServerName
  516. );
  517. NTSTATUS
  518. NdsCheckGroupMembership(
  519. PIRP_CONTEXT pIrpContext,
  520. DWORD dwUserOid,
  521. PUNICODE_STRING puGroupName
  522. );
  523. NTSTATUS
  524. NdsResolveName(
  525. IN PIRP_CONTEXT pIrpContext,
  526. IN PNWR_NDS_REQUEST_PACKET pNdsRequest,
  527. IN ULONG RequestLength,
  528. IN PLOCKED_BUFFER pLockedBuffer
  529. );
  530. NTSTATUS
  531. NdsGetObjectInfo(
  532. IN PIRP_CONTEXT pIrpContext,
  533. IN PNWR_NDS_REQUEST_PACKET pNdsRequest,
  534. IN PLOCKED_BUFFER pLockedBuffer
  535. );
  536. NTSTATUS
  537. NdsListSubordinates(
  538. IN PIRP_CONTEXT pIrpContext,
  539. IN PNWR_NDS_REQUEST_PACKET pNdsRequest,
  540. IN PLOCKED_BUFFER pLockedBuffer
  541. );
  542. NTSTATUS
  543. NdsReadAttributes(
  544. PIRP_CONTEXT pIrpContext,
  545. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  546. ULONG RequestLength,
  547. PLOCKED_BUFFER pLockedBuffer
  548. );
  549. NTSTATUS
  550. NdsReadAttributesKm(
  551. PIRP_CONTEXT pIrpContext,
  552. DWORD dwObjectId,
  553. PUNICODE_STRING puAttribute,
  554. PLOCKED_BUFFER pLockedBuffer
  555. );
  556. NTSTATUS
  557. NdsOpenStream(
  558. PIRP_CONTEXT pIrpContext,
  559. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  560. ULONG RequestLength
  561. );
  562. NTSTATUS
  563. NdsSetContext(
  564. PIRP_CONTEXT pIrpContext,
  565. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  566. ULONG RequestLength
  567. );
  568. NTSTATUS
  569. NdsGetContext(
  570. PIRP_CONTEXT pIrpContext,
  571. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  572. ULONG RequestLength
  573. );
  574. NTSTATUS
  575. NdsVerifyTreeHandle(
  576. PIRP_CONTEXT pIrpContext,
  577. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  578. ULONG RequestLength
  579. );
  580. NTSTATUS
  581. NdsGetPrintQueueInfo(
  582. PIRP_CONTEXT pIrpContext,
  583. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  584. ULONG RequestLength
  585. );
  586. NTSTATUS
  587. NdsGetVolumeInformation(
  588. PIRP_CONTEXT pIrpContext,
  589. PNWR_NDS_REQUEST_PACKET pNdsRequest,
  590. ULONG RequestLength
  591. );
  592. //
  593. // Kernel mode browsing prototypes from ndsread.c
  594. //
  595. NTSTATUS
  596. NdsResolveNameKm (
  597. PIRP_CONTEXT pIrpContext,
  598. IN PUNICODE_STRING puObjectName,
  599. OUT DWORD *dwObjectId,
  600. BOOLEAN AllowDsJump,
  601. DWORD dwFlags
  602. );
  603. NTSTATUS
  604. NdsReadStringAttribute(
  605. PIRP_CONTEXT pIrpContext,
  606. IN DWORD dwObjectId,
  607. IN PUNICODE_STRING puAttributeName,
  608. OUT PUNICODE_STRING puAttributeVal
  609. );
  610. NTSTATUS
  611. NdsGetServerName(
  612. IN PIRP_CONTEXT pIrpContext,
  613. OUT PUNICODE_STRING pUnicodeString
  614. );
  615. NTSTATUS
  616. NdsGetUserName(
  617. IN PIRP_CONTEXT pIrpContext,
  618. IN DWORD dwUserOid,
  619. OUT PUNICODE_STRING puUserName
  620. );
  621. //
  622. // Other helper prototypes from ndsread.c
  623. //
  624. VOID
  625. FreeNdsContext(
  626. PNDS_SECURITY_CONTEXT pNdsContext
  627. );
  628. VOID
  629. NdsPing(
  630. IN PIRP_CONTEXT pIrpContext,
  631. IN PSCB pScb
  632. );
  633. NTSTATUS
  634. NdsSelectConnection(
  635. PIRP_CONTEXT pIrpContext,
  636. PUNICODE_STRING puTreeName,
  637. PUNICODE_STRING puUserName,
  638. PUNICODE_STRING puPassword,
  639. BOOL DeferredLogon,
  640. BOOL UseBinderyConnections,
  641. PNONPAGED_SCB *ppNpScb
  642. );
  643. NTSTATUS
  644. NdsCompletionCodetoNtStatus(
  645. IN PLOCKED_BUFFER pLockedBuffer
  646. );
  647. NTSTATUS
  648. NdsReadPublicKey(
  649. IN PIRP_CONTEXT pIrpContext,
  650. IN DWORD entryId,
  651. OUT BYTE *pPubKeyVal,
  652. IN DWORD *pPubKeyLen
  653. );
  654. int
  655. NdsGetBsafeKey(
  656. UCHAR *pPubKey,
  657. const int pubKeyLen,
  658. UCHAR **ppBsafeKey
  659. );
  660. NTSTATUS
  661. NdsAllocateLockedBuffer(
  662. PLOCKED_BUFFER NdsRequest,
  663. DWORD BufferSize
  664. );
  665. NTSTATUS
  666. NdsFreeLockedBuffer(
  667. PLOCKED_BUFFER NdsRequest
  668. );