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.

1044 lines
24 KiB

  1. #include "precomp.h"
  2. #pragma hdrstop
  3. #include <isnspx.h>
  4. VOID
  5. DumpSpxDevice
  6. (
  7. ULONG DeviceToDump,
  8. VERBOSITY Verbosity
  9. );
  10. VOID
  11. DumpSpxAddress
  12. (
  13. ULONG _objAddr,
  14. VERBOSITY Verbosity
  15. );
  16. VOID
  17. DumpSpxAddressFile
  18. (
  19. ULONG _objAddr,
  20. VERBOSITY Verbosity
  21. );
  22. VOID
  23. DumpSpxConnFile
  24. (
  25. ULONG _objAddr,
  26. VERBOSITY Verbosity
  27. );
  28. PSPX_ADDR
  29. NextSpxAddr
  30. (
  31. PSPX_ADDR pAddr
  32. );
  33. ENUM_INFO EnumConnFileMain[] =
  34. {
  35. { SPX_CONNFILE_ACTIVE, "Active" },
  36. { SPX_CONNFILE_CONNECTING, "Connecting" },
  37. { SPX_CONNFILE_LISTENING, "Listening" },
  38. { SPX_CONNFILE_DISCONN, "Disconn" },
  39. { 0, NULL }
  40. };
  41. ENUM_INFO EnumConnFileConnecting[] =
  42. {
  43. { SPX_CONNECT_SENTREQ, "SentReq" },
  44. { SPX_CONNECT_NEG, "Neg" },
  45. { SPX_CONNECT_W_SETUP, "W_Setup" },
  46. { 0, NULL }
  47. };
  48. ENUM_INFO EnumConnFileListening[] =
  49. {
  50. { SPX_LISTEN_RECDREQ, "RecdReq" },
  51. { SPX_LISTEN_SENTACK, "SentAck" },
  52. { SPX_LISTEN_NEGACK, "NegAck" },
  53. { SPX_LISTEN_SETUP, "Setup" },
  54. { 0, NULL }
  55. };
  56. ENUM_INFO EnumConnFileSend[] =
  57. {
  58. { SPX_SEND_IDLE, "Idle" },
  59. { SPX_SEND_PACKETIZE, "Packetize" },
  60. { SPX_SEND_RETRY, "Retry" },
  61. { SPX_SEND_RETRYWD, "RetryWd" },
  62. { SPX_SEND_RENEG, "Reneg" },
  63. { SPX_SEND_RETRY2, "Retry2" },
  64. { SPX_SEND_RETRY3, "Retry3" },
  65. { SPX_SEND_WD, "Wd" },
  66. { SPX_SEND_NAK_RECD, "Nak_Recd" },
  67. { 0, NULL }
  68. };
  69. ENUM_INFO EnumConnFileReceive[] =
  70. {
  71. { SPX_RECV_IDLE, "Idle" },
  72. { SPX_RECV_POSTED, "Posted" },
  73. { SPX_RECV_PROCESS_PKTS, "Process_Pkts" },
  74. { 0, NULL }
  75. };
  76. ENUM_INFO EnumConnFileDisconnect[] =
  77. {
  78. { SPX_DISC_IDLE, "Idle" },
  79. { SPX_DISC_ABORT, "Abort" },
  80. { SPX_DISC_SENT_IDISC, "Sent_IDisc" },
  81. { SPX_DISC_POST_ORDREL, "Post_OrdRel" },
  82. { SPX_DISC_SENT_ORDREL, "Sent_OrdRel" },
  83. { SPX_DISC_ORDREL_ACKED, "OrdRel_Acked" },
  84. { SPX_DISC_POST_IDISC, "Post_IDisc" },
  85. { SPX_DISC_INACTIVATED, "Inactivated" },
  86. { 0, NULL }
  87. };
  88. FLAG_INFO FlagsConnFile[] =
  89. {
  90. { SPX_CONNFILE_RECVQ, "RecvQ" },
  91. { SPX_CONNFILE_RENEG_SIZE, "Reneg_Size" },
  92. { SPX_CONNFILE_ACKQ, "AckQ" },
  93. { SPX_CONNFILE_PKTQ, "PktQ" },
  94. { SPX_CONNFILE_ASSOC, "Assoc" },
  95. { SPX_CONNFILE_NEG, "Neg" },
  96. { SPX_CONNFILE_SPX2, "SPX2" },
  97. { SPX_CONNFILE_STREAM, "Stream" },
  98. { SPX_CONNFILE_R_TIMER, "R_Timer" },
  99. { SPX_CONNFILE_C_TIMER, "C_Timer" },
  100. { SPX_CONNFILE_W_TIMER, "W_Timer" },
  101. { SPX_CONNFILE_T_TIMER, "T_Timer" },
  102. { SPX_CONNFILE_RENEG_PKT, "Reneg_Pkt" },
  103. { SPX_CONNFILE_IND_IDISC, "Ind_IDisc" },
  104. { SPX_CONNFILE_IND_ODISC, "Ind_ODisc" },
  105. { SPX_CONNFILE_STOPPING, "Stopping" },
  106. { SPX_CONNFILE_CLOSING, "Closing" },
  107. { 0, NULL }
  108. };
  109. FLAG_INFO Flags2ConnFile[] =
  110. {
  111. { SPX_CONNFILE2_PKT_NOIND, "Pkt_Noind" },
  112. { SPX_CONNFILE2_RENEGRECD, "RenegRecd" },
  113. { SPX_CONNFILE2_PKT, "Pkt" },
  114. { SPX_CONNFILE2_FINDROUTE, "FindRoute" },
  115. { SPX_CONNFILE2_NOACKWAIT, "NoAckWait" },
  116. { SPX_CONNFILE2_IMMED_ACK, "Immed_Ack" },
  117. { SPX_CONNFILE2_IPXHDR, "IpxHdr" },
  118. { 0, NULL }
  119. };
  120. MEMBER_TABLE SpxConnFileMembers[] =
  121. {
  122. /*
  123. { "scf_DiscLinkage",
  124. FIELD_OFFSET( SPX_CONN_FILE, scf_DiscLinkage ),
  125. xxxxxxx,
  126. FIELD_OFFSET( NDIS_PACKET, ProtocolReserved ) + FIELD_OFFSET( IPX_SEND_RESERVED, GlobalLinkage )
  127. },
  128. */
  129. { NULL }
  130. };
  131. ENUM_INFO EnumSpxSendReqType[] =
  132. {
  133. EnumString( SPX_REQ_DATA ),
  134. EnumString( SPX_REQ_ORDREL ),
  135. EnumString( SPX_REQ_DISC ),
  136. { 0, NULL }
  137. };
  138. VOID dprint_addr_list( ULONG FirstAddress, ULONG OffsetToNextPtr )
  139. {
  140. ULONG Address;
  141. ULONG result;
  142. int index;
  143. Address = FirstAddress;
  144. if ( Address == (ULONG)NULL )
  145. {
  146. dprintf( "%08X (Empty)\n", Address );
  147. return;
  148. }
  149. dprintf( "{ " );
  150. for ( index = 0; Address != (ULONG)NULL; index ++ )
  151. {
  152. if ( index != 0 )
  153. {
  154. dprintf( ", ");
  155. }
  156. dprintf( "%08X", Address );
  157. if ( !ReadMemory( Address + OffsetToNextPtr,
  158. &Address,
  159. sizeof( Address ),
  160. &result ))
  161. {
  162. dprintf( "ReadMemory() failed." );
  163. Address = (ULONG)NULL;
  164. }
  165. }
  166. dprintf( " }\n" );
  167. }
  168. DECLARE_API( spxdev )
  169. /*++
  170. Routine Description:
  171. Dumps the most important fields of the specified DEVICE_CONTEXT object
  172. Arguments:
  173. args - Address
  174. Return Value:
  175. None
  176. --*/
  177. {
  178. ULONG deviceToDump = 0;
  179. ULONG pDevice = 0;
  180. ULONG result;
  181. char VarName[ MAX_LIST_VARIABLE_NAME_LENGTH + 1 ];
  182. MEMBER_VARIABLE_INFO MemberInfo;
  183. BOOL bFocusOnMemberVariable = FALSE;
  184. if ( *args )
  185. {
  186. bFocusOnMemberVariable = ReadArgsForTraverse( args, VarName );
  187. }
  188. if ( *args && *args!='-' )
  189. {
  190. if (!sscanf(args, "%lx", &deviceToDump))
  191. {
  192. return;
  193. }
  194. }
  195. if ( deviceToDump == 0 ) {
  196. pDevice = GetExpression( "nwlnkspx!SpxDevice" );
  197. if ( !pDevice ) {
  198. dprintf("Could not get nwlnkspx!SpxDevice, Try !reload\n");
  199. return;
  200. } else {
  201. if ( !ReadMemory( pDevice,
  202. &deviceToDump,
  203. sizeof(deviceToDump),
  204. &result ))
  205. {
  206. dprintf("%08lx: Could not read device address\n", pDevice);
  207. return;
  208. }
  209. }
  210. }
  211. if ( bFocusOnMemberVariable )
  212. {
  213. // if ( !LocateMemberVariable( "IpxDevice", VarName, ( PVOID )deviceToDump, &MemberInfo ))
  214. {
  215. return;
  216. }
  217. WriteMemberInfo( &MemberInfo );
  218. next( hCurrentProcess, hCurrentThread, dwCurrentPc, dwProcessor, "" );
  219. return;
  220. }
  221. DumpSpxDevice( deviceToDump, VERBOSITY_NORMAL );
  222. return;
  223. }
  224. #ifdef _obj
  225. # undef _obj
  226. # undef _objAddr
  227. # undef _objType
  228. # undef _objTypeName
  229. #endif
  230. #define _obj Device
  231. #define _objAddr DeviceToDump
  232. #define _objType DEVICE
  233. #define _objTypeName "DEVICE"
  234. VOID
  235. DumpSpxDevice
  236. (
  237. ULONG DeviceToDump,
  238. VERBOSITY Verbosity
  239. )
  240. /*++
  241. Routine Description:
  242. Dumps the fields of the specified DEVICE_CONTEXT structure
  243. Arguments:
  244. DeviceToDump - The device context object to display
  245. Full - Display a partial listing if 0, full listing otherwise.
  246. Return Value:
  247. None
  248. --*/
  249. {
  250. _objType _obj;
  251. ULONG result;
  252. unsigned int index;
  253. WCHAR Buffer[ 1000 ];
  254. PWCHAR pDeviceName = NULL;
  255. PSPX_ADDR pAddr;
  256. if ( !ReadMemory( _objAddr,
  257. &_obj,
  258. sizeof( _obj ),
  259. &result ))
  260. {
  261. dprintf("%08lx: Could not read %s structure.\n", _objAddr, _objTypeName );
  262. return;
  263. }
  264. if (Device.dev_Type != SPX_DEVICE_SIGNATURE)
  265. {
  266. dprintf( "Signature does not match, probably not a device object %lx\n", DeviceToDump);
  267. dprintf( "Device.Type == %04X, and I think it should be %04X\n", Device.dev_Type, SPX_DEVICE_SIGNATURE );
  268. dprintf( "DeviceToDump = %08X\n", DeviceToDump );
  269. dprintf( "Offset to Device.Type = %d\n", FIELD_OFFSET( DEVICE, dev_Type ) );
  270. return;
  271. }
  272. if ( !ReadMemory( ( ULONG )_obj.dev_DeviceName,
  273. Buffer,
  274. sizeof( WCHAR ) * _obj.dev_DeviceNameLen,
  275. &result ))
  276. {
  277. dprintf("%08lx: Could not read device name buffer\n", _obj.dev_DeviceName );
  278. }
  279. else
  280. {
  281. pDeviceName = Buffer;
  282. }
  283. if ( Verbosity == VERBOSITY_ONE_LINER )
  284. {
  285. dprintf( "\"%S\"", pDeviceName );
  286. return;
  287. }
  288. PrintStartStruct();
  289. PrintPtr( dev_DevObj );
  290. #if DBG
  291. # if DREF_TOTAL != 5
  292. # error DREF_TOTAL is assumed to equal 5
  293. # endif
  294. PrintULong( dev_RefTypes[ DREF_CREATE ] );
  295. PrintULong( dev_RefTypes[ DREF_LOADED ] );
  296. PrintULong( dev_RefTypes[ DREF_ADAPTER ] );
  297. PrintULong( dev_RefTypes[ DREF_ADDRESS ] );
  298. PrintULong( dev_RefTypes[ DREF_ORPHAN ] );
  299. #endif
  300. PrintUShort( dev_Type );
  301. PrintUShort( dev_Size );
  302. #if DBG
  303. PrintNChar( dev_Signature1, sizeof( _obj.dev_Signature1 ));
  304. #endif
  305. PrintULong( dev_RefCount );
  306. PrintUChar( dev_State );
  307. PrintUShort( dev_Adapters );
  308. PrintLock( dev_Interlock );
  309. PrintLock( dev_Lock );
  310. for ( index = 0; index < NUM_SPXADDR_HASH_BUCKETS; index ++ )
  311. {
  312. PrintIndent();
  313. dprintf( "dev_AddrHashTable[ %d ] = ", index );
  314. dprint_addr_list( ( ULONG )_obj.dev_AddrHashTable[ index ],
  315. FIELD_OFFSET( SPX_ADDR, sa_Next ));
  316. }
  317. for ( index = 0; index < NUM_SPXCONN_HASH_BUCKETS; index ++ )
  318. {
  319. PrintIndent();
  320. dprintf( "dev_GlobalActiveConnList[ %d ] = ", index );
  321. dprint_addr_list( ( ULONG )_obj.dev_GlobalActiveConnList[ index ],
  322. FIELD_OFFSET( SPX_CONN_FILE, scf_Next ));
  323. }
  324. PrintUShort( dev_NextConnId );
  325. PrintUShort( dev_CurrentSocket );
  326. PrintFieldName( "dev_Network" );
  327. dprintf("0x%-8hx%s", *(( ULONG *)_obj.dev_Network ), EOL);
  328. PrintFieldName( "dev_Node" );
  329. dprint_hardware_address( _obj.dev_Node );
  330. dprintf( "%s", EOL );
  331. PrintPtr( dev_ConfigInfo );
  332. PrintULong( dev_CcId );
  333. PrintJoin();
  334. PrintPtr( dev_DeviceName );
  335. dprintf( "\"%S\"\n", pDeviceName );
  336. PrintULong( dev_DeviceNameLen );
  337. #if DBG
  338. PrintNChar( dev_Signature2, sizeof( _obj.dev_Signature2 ));
  339. #endif
  340. PrintAddr( dev_NdisBufferPoolHandle );
  341. PrintAddr( dev_StatInterlock );
  342. PrintAddr( dev_StatSpinLock );
  343. PrintAddr( dev_Stat );
  344. PrintAddr( dev_AddrResource );
  345. PrintAddr( dev_ProviderInfo );
  346. PrintEndStruct();
  347. }
  348. DECLARE_API( spxaddr )
  349. /*++
  350. Routine Description:
  351. Dumps the most important fields of the specified DEVICE_CONTEXT object
  352. Arguments:
  353. args - Address
  354. Return Value:
  355. None
  356. --*/
  357. {
  358. ULONG addressToDump = 0;
  359. ULONG result;
  360. char VarName[ MAX_LIST_VARIABLE_NAME_LENGTH + 1 ];
  361. MEMBER_VARIABLE_INFO MemberInfo;
  362. BOOL bFocusOnMemberVariable = FALSE;
  363. if ( *args )
  364. {
  365. bFocusOnMemberVariable = ReadArgsForTraverse( args, VarName );
  366. }
  367. if ( *args && *args!='-' )
  368. {
  369. sscanf(args, "%lx", &addressToDump);
  370. }
  371. if ( bFocusOnMemberVariable )
  372. {
  373. // if ( !LocateMemberVariable( "IpxDevice", VarName, ( PVOID )deviceToDump, &MemberInfo ))
  374. {
  375. return;
  376. }
  377. WriteMemberInfo( &MemberInfo );
  378. next( hCurrentProcess, hCurrentThread, dwCurrentPc, dwProcessor, "" );
  379. return;
  380. }
  381. DumpSpxAddress( addressToDump, VERBOSITY_NORMAL );
  382. return;
  383. }
  384. #ifdef _obj
  385. # undef _obj
  386. # undef _objAddr
  387. # undef _objType
  388. # undef _objTypeName
  389. #endif
  390. #define _obj Address
  391. #define _objAddr AddressToDump
  392. #define _objType SPX_ADDR
  393. #define _objTypeName "SPX_ADDR"
  394. VOID
  395. DumpSpxAddress
  396. (
  397. ULONG _objAddr,
  398. VERBOSITY Verbosity
  399. )
  400. /*++
  401. Routine Description:
  402. Dumps the fields of the specified DEVICE_CONTEXT structure
  403. Arguments:
  404. DeviceToDump - The device context object to display
  405. Full - Display a partial listing if 0, full listing otherwise.
  406. Return Value:
  407. None
  408. --*/
  409. {
  410. _objType _obj;
  411. ULONG result;
  412. unsigned int index;
  413. if ( !ReadMemory( _objAddr,
  414. &_obj,
  415. sizeof( _obj ),
  416. &result ))
  417. {
  418. dprintf("%08lx: Could not read %s structure.\n", _objAddr, _objTypeName );
  419. return;
  420. }
  421. CHECK_SIGNATURE( sa_Type, SPX_ADDRESS_SIGNATURE );
  422. if ( Verbosity == VERBOSITY_ONE_LINER )
  423. {
  424. dprintf( "Socket = %d", _obj.sa_Socket );
  425. if ( _obj.sa_Flags & SPX_ADDR_CLOSING )
  426. {
  427. dprintf(" (CLOSING)");
  428. }
  429. return;
  430. }
  431. PrintStartStruct();
  432. #if DBG
  433. # if AREF_TOTAL !=4
  434. # error AREF_TOTAL is assumed to equal 4
  435. # endif
  436. PrintULong( sa_RefTypes[ AREF_ADDR_FILE ] );
  437. PrintULong( sa_RefTypes[ AREF_LOOKUP ] );
  438. PrintULong( sa_RefTypes[ AREF_RECEIVE ] );
  439. PrintULong( sa_RefTypes[ 3 ] );
  440. #endif
  441. PrintUShort( sa_Size );
  442. PrintXEnum( sa_Type, EnumStructureType );
  443. PrintULong( sa_RefCount );
  444. PrintPtr( sa_Next );
  445. PrintXULong( sa_Flags );
  446. PrintFieldName( "sa_AddrFileList" );
  447. dprint_addr_list( ( ULONG )_obj.sa_AddrFileList,
  448. FIELD_OFFSET( SPX_ADDR_FILE, saf_Next ));
  449. PrintFieldName( "sa_InactiveConnList" );
  450. dprint_addr_list( ( ULONG )_obj.sa_InactiveConnList,
  451. FIELD_OFFSET( SPX_CONN_FILE, scf_Next ));
  452. PrintFieldName( "sa_ActiveConnList" );
  453. dprint_addr_list( ( ULONG )_obj.sa_ActiveConnList,
  454. FIELD_OFFSET( SPX_CONN_FILE, scf_Next ));
  455. PrintFieldName( "sa_ListenConnList" );
  456. dprint_addr_list( ( ULONG )_obj.sa_ListenConnList,
  457. FIELD_OFFSET( SPX_CONN_FILE, scf_Next ));
  458. PrintLock( sa_Lock );
  459. PrintUShort( sa_Socket );
  460. PrintPtr( sa_Device );
  461. PrintPtr( sa_DeviceLock );
  462. PrintStartNamedStruct( "union" );
  463. PrintAddr( u.sa_ShareAccess );
  464. PrintAddr( u.sa_DestroyAddrQueueItem );
  465. PrintEndStruct();
  466. PrintPtr( sa_SecurityDescriptor );
  467. PrintEndStruct();
  468. }
  469. DECLARE_API( spxaddrfile )
  470. {
  471. ULONG addressToDump = 0;
  472. ULONG result;
  473. char VarName[ MAX_LIST_VARIABLE_NAME_LENGTH + 1 ];
  474. MEMBER_VARIABLE_INFO MemberInfo;
  475. BOOL bFocusOnMemberVariable = FALSE;
  476. if ( *args )
  477. {
  478. bFocusOnMemberVariable = ReadArgsForTraverse( args, VarName );
  479. }
  480. if ( *args && *args!='-' )
  481. {
  482. if (!sscanf(args, "%lx", &addressToDump))
  483. {
  484. return;
  485. }
  486. }
  487. if ( bFocusOnMemberVariable )
  488. {
  489. // if ( !LocateMemberVariable( "IpxDevice", VarName, ( PVOID )deviceToDump, &MemberInfo ))
  490. {
  491. return;
  492. }
  493. WriteMemberInfo( &MemberInfo );
  494. next( hCurrentProcess, hCurrentThread, dwCurrentPc, dwProcessor, "" );
  495. return;
  496. }
  497. DumpSpxAddressFile( addressToDump, VERBOSITY_NORMAL );
  498. return;
  499. }
  500. #ifdef _obj
  501. # undef _obj
  502. # undef _objAddr
  503. # undef _objType
  504. # undef _objTypeName
  505. #endif
  506. #define _obj AddressFile
  507. #define _objAddr AddressFileToDump
  508. #define _objType SPX_ADDR_FILE
  509. #define _objTypeName "SPX_ADDR_FILE"
  510. VOID
  511. DumpSpxAddressFile
  512. (
  513. ULONG _objAddr,
  514. VERBOSITY Verbosity
  515. )
  516. /*++
  517. Routine Description:
  518. Dumps the fields of the specified DEVICE_CONTEXT structure
  519. Arguments:
  520. DeviceToDump - The device context object to display
  521. Full - Display a partial listing if 0, full listing otherwise.
  522. Return Value:
  523. None
  524. --*/
  525. {
  526. _objType _obj;
  527. ULONG result;
  528. unsigned int index;
  529. if ( !ReadMemory( _objAddr,
  530. &_obj,
  531. sizeof( _obj ),
  532. &result ))
  533. {
  534. dprintf("%08lx: Could not read %s structure.\n", _objAddr, _objTypeName );
  535. return;
  536. }
  537. CHECK_SIGNATURE( saf_Type, SPX_ADDRESSFILE_SIGNATURE );
  538. if ( Verbosity == VERBOSITY_ONE_LINER )
  539. {
  540. switch ( _obj.saf_Flags & 0x03 )
  541. {
  542. case SPX_ADDRFILE_OPENING:
  543. dprintf( "OPENING " );
  544. break;
  545. case SPX_ADDRFILE_OPEN:
  546. dprintf( "OPEN " );
  547. break;
  548. case SPX_ADDRFILE_CLOSING:
  549. dprintf( "CLOSING " );
  550. break;
  551. }
  552. DumpSpxAddress( ( ULONG )_obj.saf_Addr, VERBOSITY_ONE_LINER );
  553. return;
  554. }
  555. PrintStartStruct();
  556. #if DBG
  557. # if AFREF_TOTAL !=4
  558. # error AFREF_TOTAL is assumed equal to 4.
  559. # endif
  560. PrintULong( saf_RefTypes[ AFREF_CREATE ] );
  561. PrintULong( saf_RefTypes[ AFREF_VERIFY ] );
  562. PrintULong( saf_RefTypes[ AFREF_INDICATION ] );
  563. PrintULong( saf_RefTypes[ AFREF_CONN_ASSOC ] );
  564. #endif
  565. PrintXEnum( saf_Type, EnumStructureType );
  566. PrintUShort( saf_Size );
  567. PrintULong( saf_RefCount );
  568. PrintFieldName( "saf_Next" );
  569. dprint_addr_list( ( ULONG )_obj.saf_Next,
  570. FIELD_OFFSET( SPX_ADDR_FILE, saf_Next ));
  571. PrintFieldName( "saf_GlobalNext" );
  572. dprint_addr_list( ( ULONG )_obj.saf_GlobalNext,
  573. FIELD_OFFSET( SPX_ADDR_FILE, saf_GlobalNext));
  574. PrintFieldName( "saf_AssocConnList" );
  575. dprint_addr_list( ( ULONG )_obj.saf_AssocConnList,
  576. FIELD_OFFSET( SPX_CONN_FILE, scf_AssocNext ));
  577. PrintXUShort( saf_Flags );
  578. PrintPtr( saf_Addr );
  579. PrintPtr( saf_AddrLock );
  580. PrintPtr( saf_FileObject );
  581. PrintPtr( saf_Device );
  582. PrintPtr( saf_CloseReq );
  583. PrintSymbolPtr( saf_ConnHandler );
  584. PrintXULong( saf_ConnHandlerCtx );
  585. PrintSymbolPtr( saf_DiscHandler );
  586. PrintXULong( saf_DiscHandlerCtx );
  587. PrintSymbolPtr( saf_RecvHandler );
  588. PrintXULong( saf_RecvHandlerCtx );
  589. PrintSymbolPtr( saf_SendPossibleHandler );
  590. PrintXULong( saf_SendPossibleHandlerCtx );
  591. PrintSymbolPtr( saf_ErrHandler );
  592. PrintXULong( saf_ErrHandlerCtx );
  593. PrintPtr( saf_ErrHandlerOwner );
  594. PrintEndStruct();
  595. }
  596. DECLARE_API( spxconnfile )
  597. {
  598. ULONG addressToDump = 0;
  599. ULONG result;
  600. char VarName[ MAX_LIST_VARIABLE_NAME_LENGTH + 1 ];
  601. MEMBER_VARIABLE_INFO MemberInfo;
  602. BOOL bFocusOnMemberVariable = FALSE;
  603. if ( *args )
  604. {
  605. bFocusOnMemberVariable = ReadArgsForTraverse( args, VarName );
  606. }
  607. if ( *args && *args!='-' )
  608. {
  609. if (!sscanf(args, "%lx", &addressToDump))
  610. {
  611. return;
  612. }
  613. }
  614. if ( bFocusOnMemberVariable )
  615. {
  616. if ( !LocateMemberVariable( "SpxConnFile", VarName, ( PVOID )addressToDump, &MemberInfo ))
  617. {
  618. return;
  619. }
  620. WriteMemberInfo( &MemberInfo );
  621. next( hCurrentProcess, hCurrentThread, dwCurrentPc, dwProcessor, "" );
  622. return;
  623. }
  624. DumpSpxConnFile( addressToDump, VERBOSITY_NORMAL );
  625. return;
  626. }
  627. #ifdef _obj
  628. # undef _obj
  629. # undef _objAddr
  630. # undef _objType
  631. # undef _objTypeName
  632. #endif
  633. #define _obj ConnFile
  634. #define _objAddr ConnFileToDump
  635. #define _objType SPX_CONN_FILE
  636. #define _objTypeName "SPX_CONN_FILE"
  637. VOID
  638. DumpSpxConnFile
  639. (
  640. ULONG _objAddr,
  641. VERBOSITY Verbosity
  642. )
  643. /*++
  644. Routine Description:
  645. Dumps the fields of the specified DEVICE_CONTEXT structure
  646. Arguments:
  647. DeviceToDump - The device context object to display
  648. Full - Display a partial listing if 0, full listing otherwise.
  649. Return Value:
  650. None
  651. --*/
  652. {
  653. _objType _obj;
  654. ULONG result;
  655. unsigned int index;
  656. BOOL bActive;
  657. if ( !ReadMemory( _objAddr,
  658. &_obj,
  659. sizeof( _obj ),
  660. &result ))
  661. {
  662. dprintf("%08lx: Could not read %s structure.\n", _objAddr, _objTypeName );
  663. return;
  664. }
  665. CHECK_SIGNATURE( scf_Type, SPX_CONNFILE_SIGNATURE );
  666. if ( Verbosity = VERBOSITY_ONE_LINER )
  667. {
  668. dprintf( "NOT IMPLEMENTED" );
  669. return;
  670. }
  671. PrintStartStruct();
  672. #if DBG
  673. # if CFREF_TOTAL != 14
  674. # error CFREF_TOTAL is assumed equal to 13.
  675. # endif
  676. PrintULong( scf_RefTypes[ CFREF_CREATE ] );
  677. PrintULong( scf_RefTypes[ CFREF_VERIFY ] );
  678. PrintULong( scf_RefTypes[ CFREF_INDICATION ] );
  679. PrintULong( scf_RefTypes[ CFREF_BYCTX ] );
  680. PrintULong( scf_RefTypes[ CFREF_BYID ] );
  681. PrintULong( scf_RefTypes[ CFREF_ADDR ] );
  682. PrintULong( scf_RefTypes[ CFREF_REQ ] );
  683. PrintULong( scf_RefTypes[ CFREF_TIMER ] );
  684. PrintULong( scf_RefTypes[ CFREF_PKTIZE ] );
  685. PrintULong( scf_RefTypes[ CFREF_RECV ] );
  686. PrintULong( scf_RefTypes[ CFREF_ABORTPKT ] );
  687. PrintULong( scf_RefTypes[ CFREF_ERRORSTATE ] );
  688. PrintULong( scf_RefTypes[ CFREF_FINDROUTE ] );
  689. PrintULong( scf_RefTypes[ CFREF_DISCWAITSPX ] );
  690. #endif
  691. PrintXEnum( scf_Type, EnumStructureType );
  692. PrintUShort( scf_Size );
  693. PrintULong( scf_RefCount );
  694. PrintFieldName( "scf_Next" );
  695. dprint_addr_list( ( ULONG )_obj.scf_Next,
  696. FIELD_OFFSET( SPX_CONN_FILE, scf_Next ));
  697. PrintFieldName( "scf_AssocNext" );
  698. dprint_addr_list( ( ULONG )_obj.scf_AssocNext,
  699. FIELD_OFFSET( SPX_CONN_FILE, scf_AssocNext ));
  700. PrintFieldName( "scf_GlobalActiveNext" );
  701. dprint_addr_list( ( ULONG )_obj.scf_GlobalActiveNext,
  702. FIELD_OFFSET( SPX_CONN_FILE, scf_GlobalActiveNext ));
  703. PrintFieldName( "scf_GlobalNext" );
  704. dprint_addr_list( ( ULONG )_obj.scf_GlobalNext,
  705. FIELD_OFFSET( SPX_CONN_FILE, scf_GlobalNext ));
  706. PrintFieldName( "scf_PktNext" );
  707. dprint_addr_list( ( ULONG )_obj.scf_PktNext,
  708. FIELD_OFFSET( SPX_CONN_FILE, scf_PktNext ));
  709. PrintFieldName( "scf_ProcessRcvNext" );
  710. dprint_addr_list( ( ULONG )_obj.scf_ProcessRecvNext,
  711. FIELD_OFFSET( SPX_CONN_FILE, scf_ProcessRecvNext ));
  712. bActive = ( _obj.scf_Flags & SPX_CONNFILE_MAINMASK ) == SPX_CONNFILE_ACTIVE;
  713. PrintXULong( scf_Flags );
  714. PrintXEnumMask( scf_Flags, EnumConnFileMain, SPX_CONNFILE_MAINMASK );
  715. if (( _obj.scf_Flags & SPX_CONNFILE_MAINMASK ) == SPX_CONNFILE_LISTENING )
  716. {
  717. PrintXEnumMask( scf_Flags, EnumConnFileListening, SPX_LISTEN_MASK );
  718. }
  719. if (( _obj.scf_Flags & SPX_CONNFILE_MAINMASK ) == SPX_CONNFILE_CONNECTING )
  720. {
  721. PrintXEnumMask( scf_Flags, EnumConnFileConnecting, SPX_CONNECT_MASK );
  722. }
  723. if ( bActive )
  724. {
  725. PrintXEnumMask( scf_Flags, EnumConnFileSend, SPX_SEND_MASK );
  726. PrintXEnumMask( scf_Flags, EnumConnFileReceive, SPX_RECV_MASK );
  727. }
  728. if ( (( _obj.scf_Flags & SPX_CONNFILE_MAINMASK ) == SPX_CONNFILE_LISTENING ) ||
  729. bActive )
  730. {
  731. PrintXEnumMask( scf_Flags, EnumConnFileDisconnect, SPX_DISC_MASK );
  732. }
  733. PrintFlagsMask( scf_Flags, FlagsConnFile, 0xFFFF0000 );
  734. PrintFlags( scf_Flags2, Flags2ConnFile );
  735. #if DBG
  736. PrintXULong( scf_GhostFlags );
  737. PrintXULong( scf_GhostFlags2 );
  738. PrintULong( scf_GhostRefCount );
  739. PrintPtr( scf_GhostDiscReq );
  740. #endif
  741. if ( bActive )
  742. {
  743. PrintULong( scf_WRetryCount );
  744. }
  745. else
  746. {
  747. PrintULong( scf_CRetryCount );
  748. }
  749. PrintULong( scf_RRetryCount );
  750. PrintXUShort( scf_RRetrySeqNum );
  751. if ( bActive )
  752. {
  753. PrintULong( scf_RTimerId );
  754. }
  755. else
  756. {
  757. PrintULong( scf_CTimerId );
  758. }
  759. PrintULong( scf_WTimerId );
  760. PrintULong( scf_TTimerId );
  761. PrintULong( scf_ATimerId );
  762. PrintULong( scf_BaseT1 );
  763. PrintULong( scf_AveT1 );
  764. PrintULong( scf_DevT1 );
  765. PrintUShort( scf_LocalConnId );
  766. PrintUShort( scf_SendSeqNum );
  767. PrintUShort( scf_SentAllocNum );
  768. PrintUShort( scf_RecvSeqNum );
  769. PrintUShort( scf_RecdAckNum );
  770. PrintUShort( scf_RecdAllocNum );
  771. PrintUShort( scf_RetrySeqNum );
  772. PrintUShort( scf_RenegAckAckNum );
  773. PrintNChar( scf_RemAddr, sizeof( _obj.scf_RemAddr ));
  774. PrintNChar( scf_RemAckAddr, sizeof( _obj.scf_RemAckAddr ));
  775. PrintUShort( scf_RemConnId );
  776. PrintUShort( scf_RenegMaxPktSize );
  777. PrintIpxLocalTarget( scf_AckLocalTarget );
  778. PrintUShort( scf_MaxPktSize );
  779. PrintUChar( scf_DataType );
  780. PrintIpxLocalTarget( scf_LocalTarget );
  781. PrintLock( scf_Lock );
  782. PrintJoin();
  783. PrintPtr( scf_AddrFile );
  784. dprintf( "(" );
  785. DumpSpxAddressFile( ( ULONG )_obj.scf_AddrFile, VERBOSITY_ONE_LINER );
  786. dprintf( ")\n" );
  787. PrintPtr( scf_ConnCtx );
  788. PrintPtr( scf_FileObject );
  789. PrintLL( scf_DiscLinkage );
  790. PrintLL( scf_ReqLinkage );
  791. PrintLL( scf_ReqDoneLinkage );
  792. PrintLL( scf_RecvDoneLinkage );
  793. PrintLL( scf_RecvLinkage );
  794. PrintPtr( scf_CurRecvReq );
  795. PrintULong( scf_CurRecvOffset );
  796. PrintULong( scf_CurRecvSize );
  797. PrintPtr( scf_ReqPkt );
  798. PrintULong( scf_ReqPktOffset );
  799. PrintULong( scf_ReqPktSize );
  800. PrintULong( scf_ReqPktFlags );
  801. PrintEnum( scf_ReqPktType, EnumSpxSendReqType );
  802. PrintPtr( scf_SendSeqListHead );
  803. PrintPtr( scf_SendSeqListTail );
  804. PrintPtr( scf_SendListHead );
  805. PrintPtr( scf_SendListTail );
  806. PrintPtr( scf_RecvListHead );
  807. PrintPtr( scf_RecvListTail );
  808. PrintPtr( scf_ConnectReq );
  809. PrintPtr( scf_CleanupReq );
  810. PrintPtr( scf_CloseReq );
  811. #if DBG
  812. PrintUShort( scf_PktSeqNum );
  813. PrintXULong( scf_PktFlags );
  814. PrintXULong( scf_PktFlags2 );
  815. PrintULong( scf_IndBytes );
  816. PrintULong( scf_IndLine );
  817. #endif
  818. #if DBG_WDW_CLOSE
  819. PrintULong( scf_WdwCloseAve );
  820. PrintAddr( scf_WdwCloseTime );
  821. #endif
  822. PrintPtr( scf_Device );
  823. PrintEndStruct();
  824. }