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.

2093 lines
49 KiB

  1. /*++
  2. Module Name:
  3. winidbg.cxx
  4. Abstract:
  5. Author:
  6. Jeff Roberts (jroberts) 13-May-1996
  7. Revision History:
  8. 13-May-1996 jroberts
  9. Created this module.
  10. Mazhar Mohammed (mazharm) 3-20-97 - changed it all for async RPC,
  11. added some cool stuff
  12. single dll for ntsd and kd
  13. Feroze Daud ( ferozed ) 1/21/98 - changed for Wininet.
  14. --*/
  15. #include <stddef.h>
  16. #include <limits.h>
  17. #include <nt.h>
  18. #include <ntrtl.h>
  19. #include <nturtl.h>
  20. #include <stdio.h>
  21. #include <string.h>
  22. #include <memory.h>
  23. #include <malloc.h>
  24. #include <stdlib.h>
  25. #include <windows.h>
  26. #include <stddef.h>
  27. #include "wdbgexts.h"
  28. #define private public
  29. #define protected public
  30. //#include <wininetp.h>
  31. #include <wininetp.h>
  32. #include "local.hxx"
  33. WINDBG_EXTENSION_APIS ExtensionApis;
  34. HANDLE ProcessHandle = 0;
  35. BOOL fKD = 0;
  36. #define ALLOC_SIZE 500
  37. #define MAX_ARGS 4
  38. // #include "rpcexts.hxx"
  39. //
  40. // stuff not common to kernel-mode and user-mode DLLs
  41. //
  42. void do_fsm (
  43. DWORD fsm );
  44. #if INET_DEBUG
  45. LPSTR
  46. MapType(
  47. FSM_TYPE m_Type
  48. );
  49. #endif // INET_DEBUG
  50. LPSTR
  51. MapState(
  52. DWORD m_Type
  53. );
  54. #define CASE_OF(x) case x : return #x; break;
  55. // VOID do_trans( DWORD dwAddr );
  56. DECLARE_API( fsm );
  57. DECLARE_API( ho );
  58. DECLARE_API( iho );
  59. DECLARE_API( icho );
  60. DECLARE_API( hrho );
  61. DECLARE_API( lste );
  62. DECLARE_API( serialist );
  63. DECLARE_API(badproxylste);
  64. void do_BAD_PROXY_LIST_ENTRY( DWORD addr );
  65. DECLARE_API(badproxylst);
  66. void do_BAD_PROXY_LIST( DWORD addr );
  67. DECLARE_API(proxybyplste);
  68. void do_PROXY_BYPASS_LIST_ENTRY( DWORD addr );
  69. DECLARE_API(proxybyplst);
  70. void do_PROXY_BYPASS_LIST( DWORD addr );
  71. DECLARE_API(proxysrvlste);
  72. void do_PROXY_SERVER_LIST_ENTRY( DWORD addr );
  73. DECLARE_API(proxysrvlst);
  74. void do_PROXY_SERVER_LIST( DWORD addr );
  75. DECLARE_API(ICSecureSocket);
  76. void do_ICSecureSocket( DWORD addr );
  77. #define OFFSET( x, y ) \
  78. ((DWORD)addr + offsetof(x, y))
  79. // define our own operators new and delete, so that we do not have to include the crt
  80. void * _CRTAPI1
  81. ::operator new(unsigned int dwBytes)
  82. {
  83. void *p;
  84. p = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwBytes);
  85. return (p);
  86. }
  87. void _CRTAPI1
  88. ::operator delete (void *p)
  89. {
  90. HeapFree(GetProcessHeap(), 0, p);
  91. }
  92. BOOL
  93. GetData(IN DWORD dwAddress, IN LPVOID ptr, IN ULONG size, IN PCSTR type )
  94. {
  95. BOOL b;
  96. ULONG BytesRead;
  97. ULONG count;
  98. if (fKD == 0)
  99. {
  100. return ReadProcessMemory(ProcessHandle, (LPVOID) dwAddress, ptr, size, 0);
  101. }
  102. while( size > 0 )
  103. {
  104. count = MIN( size, 3000 );
  105. b = d_ReadMemory((ULONG) dwAddress, ptr, count, &BytesRead );
  106. if (!b || BytesRead != count )
  107. {
  108. if (NULL == type)
  109. {
  110. type = "unspecified" ;
  111. }
  112. return FALSE;
  113. }
  114. dwAddress += count;
  115. size -= count;
  116. ptr = (LPVOID)((ULONG)ptr + count);
  117. }
  118. return TRUE;
  119. }
  120. #define MAX_MESSAGE_BLOCK_SIZE 1024
  121. #define BLOCK_SIZE 16
  122. /*
  123. RPC_CHAR *
  124. ReadProcessRpcChar(
  125. unsigned short * Address
  126. )
  127. {
  128. DWORD dwAddr = (DWORD) Address;
  129. char block[BLOCK_SIZE];
  130. RPC_CHAR *RpcBlock = (RPC_CHAR *)&block;
  131. char *string_block = new char[MAX_MESSAGE_BLOCK_SIZE];
  132. RPC_CHAR *RpcString = (RPC_CHAR *)string_block;
  133. int length = 0;
  134. int i = 0;
  135. BOOL b;
  136. BOOL end = FALSE;
  137. if (dwAddr == NULL) {
  138. return (L'\0');
  139. }
  140. for (length = 0; length < MAX_MESSAGE_BLOCK_SIZE/2; ) {
  141. b = GetData( dwAddr, &block, BLOCK_SIZE, NULL);
  142. if (b == FALSE) {
  143. d_printf("couldn't read address %x\n", dwAddr);
  144. return (L'\0');
  145. }
  146. for (i = 0; i < BLOCK_SIZE/2; i++) {
  147. if (RpcBlock[i] == L'\0') {
  148. end = TRUE;
  149. }
  150. RpcString[length] = RpcBlock[i];
  151. length++;
  152. }
  153. if (end == TRUE) {
  154. break;
  155. }
  156. dwAddr += BLOCK_SIZE;
  157. }
  158. return (RpcString);
  159. }
  160. */
  161. long
  162. myatol(char *string)
  163. {
  164. int i = 0;
  165. BOOL minus = FALSE;
  166. long number = 0;
  167. long tmpnumber = 0 ;
  168. long chknum;
  169. if (string[0] == '-') {
  170. minus = TRUE;
  171. i++;
  172. }
  173. else
  174. if (string[0] == '+') {
  175. i++;
  176. }
  177. for (; string[i] != '\0'; i++) {
  178. if ((string[i] >= '0')&&(string[i] <= '9')) {
  179. tmpnumber = string[i] - '0';
  180. if (number != 0) {
  181. chknum = LONG_MAX/number;
  182. }
  183. if (chknum > 11) {
  184. number = number*10 + tmpnumber;
  185. }
  186. }
  187. else
  188. return 0;
  189. }
  190. if (minus == TRUE) {
  191. number = 0 - number;
  192. }
  193. return number;
  194. }
  195. PCHAR
  196. MapSymbol(DWORD dwAddr)
  197. {
  198. static CHAR Name[256];
  199. DWORD Displacement;
  200. d_GetSymbol((LPVOID)dwAddr, (UCHAR *)Name, &Displacement);
  201. strcat(Name, "+");
  202. #if 0
  203. // nuked due to build break
  204. PCHAR p = strchr(Name, '\0');
  205. _ltoa(Displacement, p, 16);
  206. #endif
  207. return(Name);
  208. }
  209. // checks the if the uuid is null, prints the uuid
  210. /*
  211. void
  212. PrintUuid(UUID *Uuid)
  213. {
  214. unsigned long PAPI * Vector;
  215. Vector = (unsigned long PAPI *) Uuid;
  216. if ( (Vector[0] == 0)
  217. && (Vector[1] == 0)
  218. && (Vector[2] == 0)
  219. && (Vector[3] == 0))
  220. {
  221. d_printf("(Null Uuid)");
  222. }
  223. else
  224. {
  225. d_printf("%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
  226. Uuid->Data1, Uuid->Data2, Uuid->Data3, Uuid->Data4[0], Uuid->Data4[1],
  227. Uuid->Data4[2], Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],
  228. Uuid->Data4[6], Uuid->Data4[7] );
  229. }
  230. return;
  231. }
  232. */
  233. /*
  234. DWORD OSF_CCONNECTION_SIZE = sizeof(OSF_CCONNECTION);
  235. DWORD OSF_SCONNECTION_SIZE = sizeof(OSF_SCONNECTION);
  236. DWORD OSF_ADDRESS_SIZE = sizeof(OSF_ADDRESS);
  237. DWORD DG_ADDRESS_SIZE = sizeof(DG_ADDRESS);
  238. */
  239. VOID
  240. do_sizes(
  241. )
  242. {
  243. d_printf("BUGBUG .... Add stuff here \n");
  244. // d_printf("sizeof(ASSOCIATION_HANDLE) - 0x%x\n", sizeof(ASSOCIATION_HANDLE));
  245. }
  246. DECLARE_API( sizes )
  247. {
  248. INIT_DPRINTF();
  249. do_sizes();
  250. }
  251. char *
  252. GetError (DWORD dwError)
  253. {
  254. DWORD dwFlag = FORMAT_MESSAGE_FROM_SYSTEM;
  255. static CHAR szErrorMessage[1024];
  256. static HANDLE hSource = NULL;
  257. if ((dwError >= 2100) && (dwError < 6000))
  258. {
  259. if (hSource == NULL)
  260. {
  261. hSource = LoadLibrary("netmsg.dll");
  262. }
  263. if (hSource == NULL)
  264. {
  265. sprintf (szErrorMessage,
  266. "Unable to load netmsg.dll. Error %d occured.\n",
  267. dwError);
  268. return(szErrorMessage);
  269. }
  270. dwFlag = FORMAT_MESSAGE_FROM_HMODULE;
  271. }
  272. if (!FormatMessage (dwFlag,
  273. hSource,
  274. dwError,
  275. 0,
  276. szErrorMessage,
  277. 1024,
  278. NULL))
  279. {
  280. sprintf (szErrorMessage,
  281. "An unknown error occured: 0x%x \n",
  282. dwError);
  283. }
  284. return(szErrorMessage);
  285. }
  286. VOID
  287. do_error (
  288. DWORD dwAddr
  289. )
  290. {
  291. d_printf("0x%x: %s\n", dwAddr, GetError(dwAddr));
  292. }
  293. DECLARE_API( help )
  294. {
  295. INIT_DPRINTF();
  296. if (lpArgumentString[0] == '\0') {
  297. d_printf("\n"
  298. "wininext help:\n\n"
  299. "\n"
  300. "!obj <address> - Dumps an RPC object \n"
  301. "\n"
  302. "!sizes - Prints sizes of the data structures\n"
  303. "!error - Translates and error value into the error message\n"
  304. "!symbol (<address>|<symbol name>) - Returns symbol name/address\n"
  305. "!fsm <address> - Dumps the CFsm object\n"
  306. "!ho <address> - Dumps the HANDLE_OBJECT object\n"
  307. "!iho <address> - Dumps the INTERNET_HANDLE_OBJECT object\n"
  308. "!icho <address> - Dumps the INTERNET_CONNECT_HANDLE_OBJECT object\n"
  309. "!hrho <address> - Dumps the /////////////////////////////////////////////////
  310. //
  311. // HEADER_STRING structure
  312. //
  313. /////////////////////////////////////////////////
  314. DECLARE_API( HEADER_STRING )
  315. {
  316. DWORD dwAddr;
  317. INIT_DPRINTF();
  318. dwAddr = d_GetExpression(lpArgumentString);
  319. if ( !dwAddr )
  320. {
  321. return;
  322. }
  323. do_HEADER_STRING(dwAddr);
  324. }
  325. VOID
  326. do_HEADER_STRING(
  327. DWORD addr
  328. )
  329. {
  330. BOOL b;
  331. char block[ sizeof( HEADER_STRING ) ];
  332. HEADER_STRING * obj = (HEADER_STRING *) &block;
  333. b = GetData(
  334. addr,
  335. block,
  336. sizeof( HEADER_STRING ),
  337. NULL);
  338. if ( !b ) {
  339. d_printf("couldn't read HEADER_STRING at 0x%x; sorry.\n", addr);
  340. return;
  341. }
  342. d_printf("HEADER_STRING @ 0x%x \n\n", addr);
  343. //DWORD m_Hash
  344. d_printf("\tDWORD m_Hash %d\n", obj -> m_Hash);
  345. //LPSTR value
  346. d_printf("\tLPSTR value %s\n", obj -> value);
  347. d_printf("\n");
  348. } // HEADER_STRING
  349. /////////////////////////////////////////////////
  350. //
  351. // HTTP_HEADERS structure
  352. //
  353. /////////////////////////////////////////////////
  354. DECLARE_API( HTTP_HEADERS )
  355. {
  356. DWORD dwAddr;
  357. INIT_DPRINTF();
  358. dwAddr = d_GetExpression(lpArgumentString);
  359. if ( !dwAddr )
  360. {
  361. return;
  362. }
  363. do_HTTP_HEADERS(dwAddr);
  364. }
  365. VOID
  366. do_HTTP_HEADERS(
  367. DWORD addr
  368. )
  369. {
  370. BOOL b;
  371. char block[ sizeof( HTTP_HEADERS ) ];
  372. HTTP_HEADERS * obj = (HTTP_HEADERS *) &block;
  373. b = GetData(
  374. addr,
  375. block,
  376. sizeof( HTTP_HEADERS ),
  377. NULL);
  378. if ( !b ) {
  379. d_printf("couldn't read HTTP_HEADERS at 0x%x; sorry.\n", addr);
  380. return;
  381. }
  382. d_printf("HTTP_HEADERS @ 0x%x \n\n", addr);
  383. #ifndef STRESS_BUG_DEBUG
  384. #endif
  385. #if INET_DEBUG
  386. //DWORD _Signature
  387. d_printf("\tDWORD _Signature %d\n", obj -> _Signature);
  388. #endif
  389. //HEADER_STRING * _lpHeaders
  390. d_printf("\tHEADER_STRING * _lpHeaders 0x%x\n", obj -> _lpHeaders);
  391. //DWORD _TotalSlots
  392. d_printf("\tDWORD _TotalSlots %d\n", obj -> _TotalSlots);
  393. //DWORD _NextOpenSlot
  394. d_printf("\tDWORD _NextOpenSlot %d\n", obj -> _NextOpenSlot);
  395. //DWORD _FreeSlots
  396. d_printf("\tDWORD _FreeSlots %d\n", obj -> _FreeSlots);
  397. //DWORD _HeadersLength
  398. d_printf("\tDWORD _HeadersLength %d\n", obj -> _HeadersLength);
  399. //BOOL _IsRequestHeaders
  400. d_printf("\tBOOL _IsRequestHeaders %d\n", obj -> _IsRequestHeaders);
  401. //LPSTR _lpszVerb
  402. d_printf("\tLPSTR _lpszVerb %s\n", obj -> _lpszVerb);
  403. //DWORD _dwVerbLength
  404. d_printf("\tDWORD _dwVerbLength %d\n", obj -> _dwVerbLength);
  405. //LPSTR _lpszObjectName
  406. d_printf("\tLPSTR _lpszObjectName %s\n", obj -> _lpszObjectName);
  407. //DWORD _dwObjectNameLength
  408. d_printf("\tDWORD _dwObjectNameLength %d\n", obj -> _dwObjectNameLength);
  409. //LPSTR _lpszVersion
  410. d_printf("\tLPSTR _lpszVersion %s\n", obj -> _lpszVersion);
  411. //DWORD _dwVersionLength
  412. d_printf("\tDWORD _dwVersionLength %d\n", obj -> _dwVersionLength);
  413. //DWORD _RequestVersionMajor
  414. d_printf("\tDWORD _RequestVersionMajor %d\n", obj -> _RequestVersionMajor);
  415. //DWORD _RequestVersionMinor
  416. d_printf("\tDWORD _RequestVersionMinor %d\n", obj -> _RequestVersionMinor);
  417. //DWORD _Error
  418. d_printf("\tDWORD _Error %d\n", obj -> _Error);
  419. #ifdef STRESS_BUG_DEBUG
  420. //DWORD _dwCritCount
  421. d_printf("\tDWORD _dwCritCount %d\n", obj -> _dwCritCount);
  422. #endif
  423. #ifdef STRESS_BUG_DEBUG
  424. #endif
  425. #if INET_DEBUG
  426. #endif
  427. #if INET_DEBUG
  428. #endif
  429. #ifdef STRESS_BUG_DEBUG
  430. #endif
  431. #ifdef STRESS_BUG_DEBUG
  432. #endif
  433. #ifdef COMPRESSED_HEADERS
  434. #endif //COMPRESSED_HEADERS
  435. d_printf("\n");
  436. } // HTTP_HEADERS
  437. /////////////////////////////////////////////////
  438. //
  439. // HTTP_REQUEST_HANDLE_OBJECT structure
  440. //
  441. /////////////////////////////////////////////////
  442. DECLARE_API( HTTP_REQUEST_HANDLE_OBJECT )
  443. {
  444. DWORD dwAddr;
  445. INIT_DPRINTF();
  446. dwAddr = d_GetExpression(lpArgumentString);
  447. if ( !dwAddr )
  448. {
  449. return;
  450. }
  451. do_HTTP_REQUEST_HANDLE_OBJECT(dwAddr);
  452. }
  453. VOID
  454. do_HTTP_REQUEST_HANDLE_OBJECT(
  455. DWORD addr
  456. )
  457. {
  458. BOOL b;
  459. char block[ sizeof( HTTP_REQUEST_HANDLE_OBJECT ) ];
  460. HTTP_REQUEST_HANDLE_OBJECT * obj = (HTTP_REQUEST_HANDLE_OBJECT *) &block;
  461. b = GetData(
  462. addr,
  463. block,
  464. sizeof( HTTP_REQUEST_HANDLE_OBJECT ),
  465. NULL);
  466. if ( !b ) {
  467. d_printf("couldn't read HTTP_REQUEST_HANDLE_OBJECT at 0x%x; sorry.\n", addr);
  468. return;
  469. }
  470. d_printf("HTTP_REQUEST_HANDLE_OBJECT @ 0x%x \n\n", addr);
  471. //LIST_ENTRY m_PipelineList
  472. d_printf("\tLIST_ENTRY (*) m_PipelineList 0x%x\n", OFFSET( HTTP_REQUEST_HANDLE_OBJECT, m_PipelineList) );
  473. //LONG m_lPriority
  474. d_printf("\tLONG m_lPriority %d\n", obj -> m_lPriority);
  475. //ICSocket * _Socket
  476. d_printf("\tICSocket * _Socket 0x%x\n", obj -> _Socket);
  477. //BOOL _bKeepAliveConnection
  478. d_printf("\tBOOL _bKeepAliveConnection %d\n", obj -> _bKeepAliveConnection);
  479. //BOOL _bNoLongerKeepAlive
  480. d_printf("\tBOOL _bNoLongerKeepAlive %d\n", obj -> _bNoLongerKeepAlive);
  481. //LPVOID _QueryBuffer
  482. d_printf("\tLPVOID _QueryBuffer 0X%X\n", obj -> _QueryBuffer);
  483. //DWORD _QueryBufferLength
  484. d_printf("\tDWORD _QueryBufferLength %d\n", obj -> _QueryBufferLength);
  485. //DWORD _QueryOffset
  486. d_printf("\tDWORD _QueryOffset %d\n", obj -> _QueryOffset);
  487. //DWORD _QueryBytesAvailable
  488. d_printf("\tDWORD _QueryBytesAvailable %d\n", obj -> _QueryBytesAvailable);
  489. //DWORD _OpenFlags
  490. d_printf("\tDWORD _OpenFlags %d\n", obj -> _OpenFlags);
  491. //HTTPREQ_STATE _State
  492. d_printf("\tHTTPREQ_STATE _State %d\n", obj -> _State);
  493. //HTTP_HEADERS _RequestHeaders
  494. d_printf("\tHTTP_HEADERS _RequestHeaders 0X%X\n", obj -> _RequestHeaders);
  495. //HTTP_METHOD_TYPE _RequestMethod
  496. d_printf("\tHTTP_METHOD_TYPE _RequestMethod %d\n", obj -> _RequestMethod);
  497. //DWORD _dwOptionalSaved
  498. d_printf("\tDWORD _dwOptionalSaved %d\n", obj -> _dwOptionalSaved);
  499. //LPVOID _lpOptionalSaved
  500. d_printf("\tLPVOID _lpOptionalSaved 0X%X\n", obj -> _lpOptionalSaved);
  501. //BOOL _fOptionalSaved
  502. d_printf("\tBOOL _fOptionalSaved %d\n", obj -> _fOptionalSaved);
  503. //DWORD _iSlotContentLength
  504. d_printf("\tDWORD _iSlotContentLength %d\n", obj -> _iSlotContentLength);
  505. //DWORD _iSlotContentRange
  506. d_printf("\tDWORD _iSlotContentRange %d\n", obj -> _iSlotContentRange);
  507. //DWORD _StatusCode
  508. d_printf("\tDWORD _StatusCode %d\n", obj -> _StatusCode);
  509. //LPBYTE _ResponseBuffer
  510. d_printf("\tLPBYTE _ResponseBuffer 0X%X\n", obj -> _ResponseBuffer);
  511. //DWORD _ResponseBufferLength
  512. d_printf("\tDWORD _ResponseBufferLength %d\n", obj -> _ResponseBufferLength);
  513. //DWORD _BytesReceived
  514. d_printf("\tDWORD _BytesReceived %d\n", obj -> _BytesReceived);
  515. //DWORD _ResponseScanned
  516. d_printf("\tDWORD _ResponseScanned %d\n", obj -> _ResponseScanned);
  517. //DWORD _ResponseBufferDataReadyToRead
  518. d_printf("\tDWORD _ResponseBufferDataReadyToRead %d\n", obj -> _ResponseBufferDataReadyToRead);
  519. //DWORD _DataOffset
  520. d_printf("\tDWORD _DataOffset %d\n", obj -> _DataOffset);
  521. //DWORD _BytesRemaining
  522. d_printf("\tDWORD _BytesRemaining %d\n", obj -> _BytesRemaining);
  523. //DWORD _ContentLength
  524. d_printf("\tDWORD _ContentLength %d\n", obj -> _ContentLength);
  525. //DWORD _BytesInSocket
  526. d_printf("\tDWORD _BytesInSocket %d\n", obj -> _BytesInSocket);
  527. //FILETIME _ftLastModified
  528. d_printf("\tFILETIME _ftLastModified %d\n", obj -> _ftLastModified);
  529. //FILETIME _ftExpires
  530. d_printf("\tFILETIME _ftExpires %d\n", obj -> _ftExpires);
  531. //FILETIME _ftPostCheck
  532. d_printf("\tFILETIME _ftPostCheck %d\n", obj -> _ftPostCheck);
  533. //CHUNK_TRANSFER _ctChunkInfo
  534. d_printf("\tCHUNK_TRANSFER (*) _ctChunkInfo 0x%x\n", OFFSET( HTTP_REQUEST_HANDLE_OBJECT, _ctChunkInfo) );
  535. //BOOL _fTalkingToSecureServerViaProxy
  536. d_printf("\tBOOL _fTalkingToSecureServerViaProxy %d\n", obj -> _fTalkingToSecureServerViaProxy);
  537. //BOOL _fRequestUsingProxy
  538. d_printf("\tBOOL _fRequestUsingProxy %d\n", obj -> _fRequestUsingProxy);
  539. //BOOL _bWantKeepAlive
  540. d_printf("\tBOOL _bWantKeepAlive %d\n", obj -> _bWantKeepAlive);
  541. //BOOL _bRefresh
  542. d_printf("\tBOOL _bRefresh %d\n", obj -> _bRefresh);
  543. //HEADER_STRING _RefreshHeader
  544. d_printf("\tHEADER_STRING (*) _RefreshHeader 0x%x\n", OFFSET( HTTP_REQUEST_HANDLE_OBJECT, _RefreshHeader) );
  545. //DWORD _dwQuerySetCookieHeader
  546. d_printf("\tDWORD _dwQuerySetCookieHeader %d\n", obj -> _dwQuerySetCookieHeader);
  547. d_printf("\n");
  548. } // HTTP_REQUEST_HANDLE_OBJECT
  549. #ifndef unix
  550. #endif /* unix */
  551. HANDLE_OBJECT object\n"
  552. "!tinf <address> - Dumps the INTERNET_THREAD_INFO structure\n"
  553. "!lste <address> - Dumps the LIST_ENTRY structure\n"
  554. "!serialist <address> - Dumps the SERIALIZED_LIST structure\n"
  555. "!proxyinfo <address> - Dumps the PROXY_INFO structure\n"
  556. "!proxysrvlst <address> - Dumps the PROXY_INFO structure\n"
  557. "!proxysrvlste <address> - Dumps the PROXY_INFO_LIST structure\n"
  558. "!proxybyplst <address> - Dumps the PROXY_BYPASS_LIST structure\n"
  559. "!proxybyplste <address> - Dumps the PROXY_BYPASS_LIST_ENTRY structure\n"
  560. );
  561. }
  562. }
  563. void do_symbol(DWORD dwAddr)
  564. {
  565. CHAR Symbol[64];
  566. DWORD Displacement;
  567. d_GetSymbol((LPVOID)dwAddr,(unsigned char *)Symbol,&Displacement);
  568. d_printf("%lx %s+%lx\n", dwAddr, Symbol, Displacement);
  569. }
  570. DECLARE_API( symbol )
  571. {
  572. DWORD dwAddr;
  573. INIT_DPRINTF();
  574. dwAddr = d_GetExpression(lpArgumentString);
  575. if ( !dwAddr )
  576. {
  577. return;
  578. }
  579. do_symbol(dwAddr);
  580. }
  581. USHORT SavedMajorVersion;
  582. USHORT SavedMinorVersion;
  583. BOOL ChkTarget; // is debuggee a CHK build?
  584. #define VER_PRODUCTBUILD 10
  585. EXT_API_VERSION ApiVersion = { 3, 5, EXT_API_VERSION_NUMBER, 0 };
  586. VOID
  587. WinDbgExtensionDllInit(
  588. PWINDBG_EXTENSION_APIS lpExtensionApis,
  589. USHORT MajorVersion,
  590. USHORT MinorVersion
  591. )
  592. {
  593. fKD = 1;
  594. ExtensionApis = *lpExtensionApis ;
  595. SavedMajorVersion = MajorVersion;
  596. SavedMinorVersion = MinorVersion;
  597. ChkTarget = SavedMajorVersion == 0x0c ? TRUE : FALSE;
  598. }
  599. DECLARE_API( version )
  600. {
  601. #if DBG
  602. PCSTR kind = "Checked";
  603. #else
  604. PCSTR kind = "Free";
  605. #endif
  606. d_printf(
  607. "%s RPC Extension dll for Build %d debugging %s kernel for Build %d\n",
  608. kind,
  609. VER_PRODUCTBUILD,
  610. SavedMajorVersion == 0x0c ? "Checked" : "Free",
  611. SavedMinorVersion
  612. );
  613. }
  614. VOID
  615. CheckVersion(
  616. VOID
  617. )
  618. {
  619. }
  620. LPEXT_API_VERSION
  621. ExtensionApiVersion(
  622. VOID
  623. )
  624. {
  625. return &ApiVersion;
  626. }
  627. ///////////////////////////////////
  628. //
  629. // Dump the FSM class structure
  630. //
  631. ///////////////////////////////////
  632. DECLARE_API( fsm )
  633. {
  634. DWORD dwAddr;
  635. INIT_DPRINTF();
  636. dwAddr = d_GetExpression(lpArgumentString);
  637. if ( !dwAddr )
  638. {
  639. return;
  640. }
  641. do_fsm(dwAddr);
  642. }
  643. VOID
  644. do_fsm(
  645. DWORD addr
  646. )
  647. {
  648. BOOL b;
  649. char block[ sizeof( CFsm ) ];
  650. CFsm * fsm = (CFsm *) &block;
  651. b = GetData(
  652. addr,
  653. block,
  654. sizeof( CFsm ),
  655. NULL);
  656. if ( !b ) {
  657. d_printf("couldn't read CFsm at 0x%x; sorry.\n", addr);
  658. return;
  659. }
  660. d_printf("\nCFsm at 0x%x \n", addr);
  661. // CFsm * m_Link;
  662. d_printf("\tCFsm * m_Link = 0x%x\n", fsm -> m_Link );
  663. // DWORD m_dwError;
  664. d_printf("\tDWORD m_dwError = %d\n", fsm -> m_dwError );
  665. // LPINTERNET_THREAD_INFO m_lpThreadInfo;
  666. d_printf("\tm_lpThreadInfo = 0x%x\n", fsm -> m_lpThreadInfo );
  667. // DWORD m_dwContext;
  668. d_printf("\tDWORD_PTR m_dwContext = %d\n", fsm -> m_dwContext );
  669. // HINTERNET m_hObject;
  670. d_printf("\tHINTERNET m_hObject = 0x%x\n", fsm -> m_hObject );
  671. //INTERNET_HANDLE_OBJECT * m_hObjectMapped;
  672. d_printf("\tINTERNET_HANDLE_OBJECT * m_hObjectMapped = 0x%x\n", fsm -> m_hObjectMapped );
  673. //DWORD m_dwMappedErrorCode;
  674. d_printf("\tDWORD m_dwMappedErrorCode = %d\n", fsm -> m_dwMappedErrorCode );
  675. //FSM_STATE m_State;
  676. d_printf("\tFSM_STATE m_State = %d ( %s )\n", fsm -> m_State , MapState( fsm -> m_NextState));
  677. //FSM_STATE m_NextState;
  678. d_printf("\tFSM_STATE m_NextState = %d ( %s ) \n", fsm -> m_NextState , MapState( fsm -> m_NextState));
  679. //FSM_STATE m_FunctionState;
  680. d_printf("\tFSM_STATE m_FunctionState = %d ( %s ) \n", fsm -> m_FunctionState , MapState( fsm -> m_FunctionState ));
  681. #if INET_DEBUG
  682. //FSM_TYPE m_Type;
  683. d_printf("\tFSM_TYPE m_Type = %d(%s)\n", fsm -> m_Type, MapType( fsm -> m_Type ));
  684. #endif
  685. /*
  686. DWORD (*m_lpfnHandler)(CFsm *);
  687. d_printf("\tCFsm * m_Link = 0x%x\n", fsm -> m_Link );
  688. LPVOID m_lpvContext;
  689. d_printf("\tCFsm * m_Link = 0x%x\n", fsm -> m_Link );
  690. FSM_HINT m_Hint;
  691. d_printf("\tCFsm * m_Link = 0x%x\n", fsm -> m_Link );
  692. */
  693. //SOCKET m_Socket;
  694. d_printf("\tSOCKET m_Socket = 0x%x\n", fsm -> m_Socket );
  695. FSM_ACTION m_Action;
  696. d_printf("\tCFsm * m_Link = 0x%x\n", fsm -> m_Link );
  697. /*
  698. DWORD m_dwBlockId;
  699. d_printf("\tCFsm * m_Link = 0x%x\n", fsm -> m_Link );
  700. DWORD m_dwTimeout;
  701. d_printf("\tCFsm * m_Link = 0x%x\n", fsm -> m_Link );
  702. DWORD m_dwTimer;
  703. d_printf("\tCFsm * m_Link = 0x%x\n", fsm -> m_Link );
  704. BOOL m_bTimerStarted;
  705. d_printf("\tCFsm * m_Link = 0x%x\n", fsm -> m_Link );
  706. */
  707. //BOOL m_bIsApi;
  708. d_printf("\tBOOL m_bIsApi = %d\n", fsm -> m_bIsApi );
  709. //API_TYPE m_ApiType;
  710. d_printf("\tAPI_TYPE m_ApiType = %d\n", fsm -> m_ApiType );
  711. //DWORD m_dwApiData;
  712. d_printf("\tDWORD m_dwApiData = %d\n", fsm -> m_dwApiData );
  713. d_printf("\n");
  714. /*
  715. union {
  716. BOOL Bool;
  717. HINTERNET Handle;
  718. } m_ApiResult;
  719. */
  720. }
  721. ///////////////////////////////////
  722. //
  723. // Dump the HANDLE_OBJECT class structure
  724. //
  725. ///////////////////////////////////
  726. VOID
  727. do_handle_object(
  728. DWORD addr
  729. )
  730. {
  731. BOOL b;
  732. char block[ sizeof( HANDLE_OBJECT ) ];
  733. HANDLE_OBJECT * fsm = (HANDLE_OBJECT *) &block;
  734. b = GetData(
  735. addr,
  736. block,
  737. sizeof( HANDLE_OBJECT ),
  738. NULL);
  739. if ( !b ) {
  740. d_printf("couldn't read HANDLE_OBJECT at 0x%x; sorry.\n", addr);
  741. return;
  742. }
  743. d_printf("HANDLE_OBJECT @ 0x%x \n", addr);
  744. //LIST_ENTRY _List;
  745. //d_printf("\tLIST_ENTRY _List\n");
  746. d_printf("\tLIST_ENTRY (*) _List = 0x%x \n", ((DWORD) addr + offsetof(HANDLE_OBJECT,_List)) );
  747. /*
  748. d_printf("\t\tLIST_ENTY * Flink = 0x%x\n", (fsm -> _List).Flink);
  749. d_printf("\t\tLIST_ENTY * Blink = 0x%x\n", (fsm -> _List).Blink);
  750. */
  751. //SERIALIZED_LIST _Children;
  752. d_printf("\tSERIALIZED_LIST (*) _Children = 0x%x \n", ((DWORD) addr + offsetof(HANDLE_OBJECT,_Children)) );
  753. //LIST_ENTRY _Siblings;
  754. d_printf("\tLIST_ENTRY (*) _Siblings = 0x%x \n", ((DWORD) addr + offsetof(HANDLE_OBJECT,_Siblings)) );
  755. //HANDLE_OBJECT* _Parent;
  756. d_printf("\tHANDLE_OBJECT * _Parent = 0x%x \n", fsm -> _Parent);
  757. //BOOL _DeleteWithChild;
  758. d_printf("\tBOOL _DeleteWithChild = %d \n", fsm -> _DeleteWithChild);
  759. //HINTERNET _Handle;
  760. d_printf("\tHINTERNET _Handle = 0x%x \n", fsm -> _Handle);
  761. //HINTERNET_HANDLE_TYPE _ObjectType;
  762. d_printf("\tHINTERNET_HANDLE_TYPE _ObjectType = %d \n", fsm -> _ObjectType);
  763. //LONG _ReferenceCount;
  764. d_printf("\tLONG _ReferenceCount = %ld \n", fsm -> _ReferenceCount);
  765. //BOOL _Invalid;
  766. d_printf("\tBOOL _Invalid = %d \n", fsm -> _Invalid);
  767. //DWORD _Error;
  768. d_printf("\tDWORD _Error = %d \n", fsm -> _Error);
  769. //DWORD _Signature;
  770. d_printf("\tDWORD _Signature = 0x%x \n", fsm -> _Signature);
  771. //DWORD _Context;
  772. d_printf("\tDWORD _Context = %d \n", fsm -> _Context);
  773. //DWORD _Status;
  774. d_printf("\tDWORD _Status = %d \n", fsm -> _Status);
  775. d_printf("\n");
  776. }
  777. DECLARE_API( ho )
  778. {
  779. DWORD dwAddr;
  780. INIT_DPRINTF();
  781. dwAddr = d_GetExpression(lpArgumentString);
  782. if ( !dwAddr )
  783. {
  784. return;
  785. }
  786. do_handle_object(dwAddr);
  787. }
  788. ///////////////////////////////////
  789. //
  790. // Dump the Thread Info structure
  791. //
  792. ///////////////////////////////////
  793. VOID
  794. do_thread_info(
  795. DWORD addr
  796. )
  797. {
  798. BOOL b;
  799. char block[ sizeof( INTERNET_THREAD_INFO ) ];
  800. LPINTERNET_THREAD_INFO fsm = (LPINTERNET_THREAD_INFO) &block;
  801. b = GetData(
  802. addr,
  803. block,
  804. sizeof( INTERNET_THREAD_INFO ),
  805. NULL);
  806. if ( !b ) {
  807. d_printf("couldn't read INTERNET_THREAD_INFO at 0x%x; sorry.\n", addr);
  808. return;
  809. }
  810. d_printf("INTERNET_THREAD_INFO @ 0x%x \n", addr );
  811. //LIST_ENTRY List;
  812. d_printf("\tLIST_ENTRY List = 0x%x \n", fsm -> List);
  813. // DWORD ThreadId;
  814. d_printf("\tDWORD ThreadId = %d \n", fsm -> ThreadId);
  815. //DWORD ErrorNumber;
  816. d_printf("\tDWORD ErrorNumber = %d \n", fsm -> ErrorNumber);
  817. //DWORD Context;
  818. d_printf("\tDWORD Context = %d \n", fsm -> Context);
  819. //HINTERNET hObject;
  820. d_printf("\tHINTERNET hObject = 0x%x \n", fsm -> hObject);
  821. //HINTERNET hObjectMapped;
  822. d_printf("\tHINTERNET hObjectMapped = 0x%x \n", fsm -> hObjectMapped);
  823. //BOOL IsAsyncWorkerThread;
  824. d_printf("\tBOOL IsAsyncWorkerThread = %d \n", fsm -> IsAsyncWorkerThread);
  825. //BOOL InCallback;
  826. d_printf("\tBOOL InCallback = %d \n", fsm -> InCallback);
  827. //BOOL IsAutoProxyProxyThread;
  828. d_printf("\tBOOL IsAutoProxyProxyThread = %d \n", fsm -> IsAutoProxyProxyThread);
  829. //DWORD NestedRequests;
  830. d_printf("\tDWORD NestedRequests = %d \n", fsm -> NestedRequests);
  831. //DWORD dwMappedErrorCode;
  832. d_printf("\tDWORD dwMappedErrorCode = %d \n", fsm -> dwMappedErrorCode);
  833. //CFsm * Fsm;
  834. d_printf("\tCFsm * Fsm = 0x%x \n", fsm -> Fsm);
  835. d_printf("\n");
  836. }
  837. DECLARE_API( tinf )
  838. {
  839. DWORD dwAddr;
  840. INIT_DPRINTF();
  841. dwAddr = d_GetExpression(lpArgumentString);
  842. if ( !dwAddr )
  843. {
  844. return;
  845. }
  846. do_thread_info(dwAddr);
  847. }
  848. ///////////////////////////////////
  849. //
  850. // Dump the INTERNET_HANDLE_OBJECT class structure
  851. //
  852. ///////////////////////////////////
  853. VOID
  854. do_internet_handle_object(
  855. DWORD addr
  856. )
  857. {
  858. BOOL b;
  859. char block[ sizeof( INTERNET_HANDLE_OBJECT ) ];
  860. INTERNET_HANDLE_OBJECT * obj = (INTERNET_HANDLE_OBJECT *) &block;
  861. b = GetData(
  862. addr,
  863. block,
  864. sizeof( INTERNET_HANDLE_OBJECT ),
  865. NULL);
  866. if ( !b ) {
  867. d_printf("couldn't read INTERNET_HANDLE_OBJECT at 0x%x; sorry.\n", addr);
  868. return;
  869. }
  870. //do_internet_handle_object( addr );
  871. d_printf("INTERNET_HANDLE_OBJECT @ 0x%x \n\n", addr);
  872. //HINTERNET _INetHandle
  873. d_printf("\tHINTERNET _INetHandle = 0x%x\n", obj -> _INetHandle);
  874. //BOOL _IsCopy
  875. d_printf("\tBOOL _IsCopy = %d\n", obj -> _IsCopy);
  876. //ICSTRING _UserAgent
  877. d_printf("\tICSTRING _UserAgent = 0x%x\n", obj -> _UserAgent);
  878. //PROXY_INFO * _ProxyInfo
  879. d_printf("\tPROXY_INFO * _ProxyInfo = 0x%x\n", obj -> _ProxyInfo);
  880. //RESOURCE_LOCK _ProxyInfoResourceLock
  881. d_printf("\tRESOURCE_LOCK (*) _ProxyInfoResourceLock = 0x%x\n", &(obj -> _ProxyInfoResourceLock));
  882. //DWORD _dwInternetOpenFlags
  883. d_printf("\tDWORD _dwInternetOpenFlags = %d\n", obj -> _dwInternetOpenFlags);
  884. //BOOL _WinsockLoaded
  885. d_printf("\tBOOL _WinsockLoaded = %d\n", obj -> _WinsockLoaded);
  886. //ICSocket * _pICSocket
  887. d_printf("\tICSocket * _pICSocket = 0x%x\n", obj -> _pICSocket);
  888. //DWORD _ConnectTimeout
  889. d_printf("\tDWORD _ConnectTimeout = %d\n", obj -> _ConnectTimeout);
  890. //DWORD _ConnectRetries
  891. d_printf("\tDWORD _ConnectRetries = %d\n", obj -> _ConnectRetries);
  892. //DWORD _SendTimeout
  893. d_printf("\tDWORD _SendTimeout = %d\n", obj -> _SendTimeout);
  894. //DWORD _DataSendTimeout
  895. d_printf("\tDWORD _DataSendTimeout = %d\n", obj -> _DataSendTimeout);
  896. //DWORD _ReceiveTimeout
  897. d_printf("\tDWORD _ReceiveTimeout = %d\n", obj -> _ReceiveTimeout);
  898. //DWORD _DataReceiveTimeout
  899. d_printf("\tDWORD _DataReceiveTimeout = %d\n", obj -> _DataReceiveTimeout);
  900. //DWORD _SocketSendBufferLength
  901. d_printf("\tDWORD _SocketSendBufferLength = %d\n", obj -> _SocketSendBufferLength);
  902. //DWORD _SocketReceiveBufferLength
  903. d_printf("\tDWORD _SocketReceiveBufferLength = %d\n", obj -> _SocketReceiveBufferLength);
  904. //BOOL _Async
  905. d_printf("\tBOOL _Async = %d\n", obj -> _Async);
  906. //DWORD _DataAvailable
  907. d_printf("\tDWORD _DataAvailable = %d\n", obj -> _DataAvailable);
  908. //BOOL _EndOfFile
  909. d_printf("\tBOOL _EndOfFile = %d\n", obj -> _EndOfFile);
  910. d_printf("\n");
  911. }
  912. DECLARE_API( iho )
  913. {
  914. DWORD dwAddr;
  915. INIT_DPRINTF();
  916. dwAddr = d_GetExpression(lpArgumentString);
  917. if ( !dwAddr )
  918. {
  919. return;
  920. }
  921. do_internet_handle_object(dwAddr);
  922. }
  923. /////////////////////////////////////////////////
  924. //
  925. // INTERNET_CONNECT_HANDLE_OBJECT structure
  926. //
  927. /////////////////////////////////////////////////
  928. DECLARE_API( INTERNET_CONNECT_HANDLE_OBJECT )
  929. {
  930. DWORD dwAddr;
  931. INIT_DPRINTF();
  932. dwAddr = d_GetExpression(lpArgumentString);
  933. if ( !dwAddr )
  934. {
  935. return;
  936. }
  937. do_INTERNET_CONNECT_HANDLE_OBJECT(dwAddr);
  938. }
  939. VOID
  940. do_INTERNET_CONNECT_HANDLE_OBJECT(
  941. DWORD addr
  942. )
  943. {
  944. BOOL b;
  945. char block[ sizeof( INTERNET_CONNECT_HANDLE_OBJECT ) ];
  946. INTERNET_CONNECT_HANDLE_OBJECT * obj = (INTERNET_CONNECT_HANDLE_OBJECT *) &block;
  947. b = GetData(
  948. addr,
  949. block,
  950. sizeof( INTERNET_CONNECT_HANDLE_OBJECT ),
  951. NULL);
  952. if ( !b ) {
  953. d_printf("couldn't read INTERNET_CONNECT_HANDLE_OBJECT at 0x%x; sorry.\n", addr);
  954. return;
  955. }
  956. d_printf("INTERNET_CONNECT_HANDLE_OBJECT @ 0x%x \n\n", addr);
  957. //HINTERNET _InternetConnectHandle
  958. d_printf("\tHINTERNET _InternetConnectHandle 0X%X\n", obj -> _InternetConnectHandle);
  959. //BOOL _IsCopy
  960. d_printf("\tBOOL _IsCopy %d\n", obj -> _IsCopy);
  961. //DWORD _ServiceType
  962. d_printf("\tDWORD _ServiceType %d\n", obj -> _ServiceType);
  963. //HINTERNET_HANDLE_TYPE _HandleType
  964. d_printf("\tHINTERNET_HANDLE_TYPE _HandleType %d\n", obj -> _HandleType);
  965. //BOOL _Flags
  966. d_printf("\tBOOL _Flags %d\n", obj -> _Flags);
  967. //BOOL _InUse
  968. d_printf("\tBOOL _InUse %d\n", obj -> _InUse);
  969. //BOOL _fDeleteDataFile
  970. d_printf("\tBOOL _fDeleteDataFile %d\n", obj -> _fDeleteDataFile);
  971. //LPSTR _CacheCWD
  972. d_printf("\tLPSTR _CacheCWD %s\n", obj -> _CacheCWD);
  973. //LPSTR _CacheUrlName
  974. d_printf("\tLPSTR _CacheUrlName %s\n", obj -> _CacheUrlName);
  975. //XSTRING _xsPrimaryCacheKey
  976. d_printf("\tXSTRING (*) _xsPrimaryCacheKey 0x%x\n", OFFSET( INTERNET_CONNECT_HANDLE_OBJECT, _xsPrimaryCacheKey) );
  977. //XSTRING _xsSecondaryCacheKey
  978. d_printf("\tXSTRING (*) _xsSecondaryCacheKey 0x%x\n", OFFSET( INTERNET_CONNECT_HANDLE_OBJECT, _xsSecondaryCacheKey) );
  979. //LPSTR _CacheFileName
  980. d_printf("\tLPSTR _CacheFileName %s\n", obj -> _CacheFileName);
  981. //DWORD _CacheHeaderLength
  982. d_printf("\tDWORD _CacheHeaderLength %d\n", obj -> _CacheHeaderLength);
  983. //BOOL _CacheReadInProgress
  984. d_printf("\tBOOL _CacheReadInProgress %d\n", obj -> _CacheReadInProgress);
  985. //BOOL _CacheWriteInProgress
  986. d_printf("\tBOOL _CacheWriteInProgress %d\n", obj -> _CacheWriteInProgress);
  987. //DWORD _RealCacheFileSize
  988. d_printf("\tDWORD _RealCacheFileSize %d\n", obj -> _RealCacheFileSize);
  989. //DWORD _VirtualCacheFileSize
  990. d_printf("\tDWORD _VirtualCacheFileSize %d\n", obj -> _VirtualCacheFileSize);
  991. #ifdef LAZY_WRITE
  992. //LPBYTE _CacheScratchBuf
  993. d_printf("\tLPBYTE _CacheScratchBuf 0X%X\n", obj -> _CacheScratchBuf);
  994. //DWORD _CacheScratchBufLen
  995. d_printf("\tDWORD _CacheScratchBufLen %d\n", obj -> _CacheScratchBufLen);
  996. //DWORD _CacheScratchUsedLen
  997. d_printf("\tDWORD _CacheScratchUsedLen %d\n", obj -> _CacheScratchUsedLen);
  998. #endif
  999. //DWORD _dwCacheFlags
  1000. d_printf("\tDWORD _dwCacheFlags %d\n", obj -> _dwCacheFlags);
  1001. //DWORD _dwStreamRefCount
  1002. d_printf("\tDWORD _dwStreamRefCount %d\n", obj -> _dwStreamRefCount);
  1003. //DWORD _dwCurrentStreamPosition
  1004. d_printf("\tDWORD _dwCurrentStreamPosition %d\n", obj -> _dwCurrentStreamPosition);
  1005. //BOOL _fFromCache
  1006. d_printf("\tBOOL _fFromCache %d\n", obj -> _fFromCache);
  1007. //BOOL _fCacheWriteDisabled
  1008. d_printf("\tBOOL _fCacheWriteDisabled %d\n", obj -> _fCacheWriteDisabled);
  1009. //BOOL _fIsHtmlFind
  1010. d_printf("\tBOOL _fIsHtmlFind %d\n", obj -> _fIsHtmlFind);
  1011. //BOOL _CacheCopy
  1012. d_printf("\tBOOL _CacheCopy %d\n", obj -> _CacheCopy);
  1013. //BOOL _CachePerUserItem
  1014. d_printf("\tBOOL _CachePerUserItem %d\n", obj -> _CachePerUserItem);
  1015. //BOOL _fForcedExpiry
  1016. d_printf("\tBOOL _fForcedExpiry %d\n", obj -> _fForcedExpiry);
  1017. //BOOL _fLazyUpdate
  1018. d_printf("\tBOOL _fLazyUpdate %d\n", obj -> _fLazyUpdate);
  1019. //LPSTR _OriginalUrl
  1020. d_printf("\tLPSTR _OriginalUrl %s\n", obj -> _OriginalUrl);
  1021. #ifdef LAZY_WRITE
  1022. #endif // LAZY_WRITE
  1023. //DWORD _ReadBufferSize
  1024. d_printf("\tDWORD _ReadBufferSize %d\n", obj -> _ReadBufferSize);
  1025. //DWORD _WriteBufferSize
  1026. d_printf("\tDWORD _WriteBufferSize %d\n", obj -> _WriteBufferSize);
  1027. //ICSTRING _HostName
  1028. d_printf("\tICSTRING (*) _HostName 0x%x\n", OFFSET( INTERNET_CONNECT_HANDLE_OBJECT, _HostName) );
  1029. //XSTRING _xsUser
  1030. d_printf("\tXSTRING (*) _xsUser 0x%x\n", OFFSET( INTERNET_CONNECT_HANDLE_OBJECT, _xsUser) );
  1031. //XSTRING _xsPass
  1032. d_printf("\tXSTRING (*) _xsPass 0x%x\n", OFFSET( INTERNET_CONNECT_HANDLE_OBJECT, _xsPass) );
  1033. //XSTRING _xsProxyUser
  1034. d_printf("\tXSTRING (*) _xsProxyUser 0x%x\n", OFFSET( INTERNET_CONNECT_HANDLE_OBJECT, _xsProxyUser) );
  1035. //XSTRING _xsProxyPass
  1036. d_printf("\tXSTRING (*) _xsProxyPass 0x%x\n", OFFSET( INTERNET_CONNECT_HANDLE_OBJECT, _xsProxyPass) );
  1037. //INTERNET_PORT _HostPort
  1038. d_printf("\tINTERNET_PORT _HostPort %d\n", obj -> _HostPort);
  1039. //INTERNET_SCHEME _SchemeType
  1040. d_printf("\tINTERNET_SCHEME _SchemeType %d\n", obj -> _SchemeType);
  1041. //LPSTR _LastResponseInfo
  1042. d_printf("\tLPSTR _LastResponseInfo %s\n", obj -> _LastResponseInfo);
  1043. //DWORD _LastResponseInfoLength
  1044. d_printf("\tDWORD _LastResponseInfoLength %d\n", obj -> _LastResponseInfoLength);
  1045. //BOOL _bViaProxy
  1046. d_printf("\tBOOL _bViaProxy %d\n", obj -> _bViaProxy);
  1047. //BOOL _bNoHeaders
  1048. d_printf("\tBOOL _bNoHeaders %d\n", obj -> _bNoHeaders);
  1049. //BOOL _bNetFailed
  1050. d_printf("\tBOOL _bNetFailed %d\n", obj -> _bNetFailed);
  1051. d_printf("\n");
  1052. } // INTERNET_CONNECT_HANDLE_OBJECT
  1053. ///////////////////////////////////
  1054. //
  1055. // Dump the LIST_ENTRY structure
  1056. //
  1057. ///////////////////////////////////
  1058. VOID
  1059. do_list_entry(
  1060. DWORD addr
  1061. )
  1062. {
  1063. BOOL b;
  1064. char block[ sizeof( LIST_ENTRY ) ];
  1065. LIST_ENTRY * obj = (LIST_ENTRY *) &block;
  1066. b = GetData(
  1067. addr,
  1068. block,
  1069. sizeof( LIST_ENTRY ),
  1070. NULL);
  1071. if ( !b ) {
  1072. d_printf("couldn't read LIST_ENTRY at 0x%x; sorry.\n", addr);
  1073. return;
  1074. }
  1075. d_printf("LIST_ENTRY @ 0x%x \n\n", addr);
  1076. //struct _LIST_ENTRY * Flink
  1077. d_printf("\tstruct _LIST_ENTRY * Flink = 0x%X\n", obj -> Flink);
  1078. //struct _LIST_ENTRY * Blink
  1079. d_printf("\tstruct _LIST_ENTRY * Blink = 0x%X\n", obj -> Blink);
  1080. d_printf("\n");
  1081. }
  1082. DECLARE_API( lste )
  1083. {
  1084. DWORD dwAddr;
  1085. INIT_DPRINTF();
  1086. dwAddr = d_GetExpression(lpArgumentString);
  1087. if ( !dwAddr )
  1088. {
  1089. return;
  1090. }
  1091. do_list_entry(dwAddr);
  1092. }
  1093. ///////////////////////////////////
  1094. //
  1095. // Dump the SERIALIZED_LIST structure
  1096. //
  1097. ///////////////////////////////////
  1098. VOID
  1099. do_serialized_list(
  1100. DWORD addr
  1101. )
  1102. {
  1103. BOOL b;
  1104. char block[ sizeof( SERIALIZED_LIST ) ];
  1105. SERIALIZED_LIST * obj = (SERIALIZED_LIST *) &block;
  1106. b = GetData(
  1107. addr,
  1108. block,
  1109. sizeof( SERIALIZED_LIST ),
  1110. NULL);
  1111. if ( !b ) {
  1112. d_printf("couldn't read SERIALIZED_LIST at 0x%x; sorry.\n", addr);
  1113. return;
  1114. }
  1115. d_printf("SERIALIZED_LIST @ 0x%x \n\n", addr);
  1116. #if INET_DEBUG
  1117. //DWORD Signature
  1118. d_printf("\tDWORD Signature %d\n", obj -> Signature);
  1119. //RESOURCE_INFO ResourceInfo
  1120. d_printf("\tRESOURCE_INFO (*) ResourceInfo 0X%X\n",
  1121. ((DWORD)addr + offsetof(SERIALIZED_LIST, ResourceInfo))
  1122. );
  1123. //LONG LockCount
  1124. d_printf("\tLONG LockCount %d\n", obj -> LockCount);
  1125. #endif // INET_DEBUG
  1126. //LIST_ENTRY List
  1127. d_printf("\tLIST_ENTRY (*) List 0X%X\n",
  1128. ((DWORD)addr + offsetof(SERIALIZED_LIST, List))
  1129. );
  1130. //do_list_entry( (DWORD) &obj->List );
  1131. //LONG ElementCount
  1132. d_printf("\tLONG ElementCount %ld\n", obj -> ElementCount);
  1133. d_printf("\n");
  1134. }
  1135. DECLARE_API( serialist )
  1136. {
  1137. DWORD dwAddr;
  1138. INIT_DPRINTF();
  1139. dwAddr = d_GetExpression(lpArgumentString);
  1140. if ( !dwAddr )
  1141. {
  1142. return;
  1143. }
  1144. do_serialized_list(dwAddr);
  1145. }
  1146. /////////////////////////////////////////////////
  1147. //
  1148. // PROXY_INFO structure
  1149. //
  1150. /////////////////////////////////////////////////
  1151. VOID
  1152. do_proxy_info(
  1153. DWORD addr
  1154. )
  1155. {
  1156. BOOL b;
  1157. char block[ sizeof( PROXY_INFO ) ];
  1158. PROXY_INFO * obj = (PROXY_INFO *) &block;
  1159. b = GetData(
  1160. addr,
  1161. block,
  1162. sizeof( PROXY_INFO ),
  1163. NULL);
  1164. if ( !b ) {
  1165. d_printf("couldn't read PROXY_INFO at 0x%x; sorry.\n", addr);
  1166. return;
  1167. }
  1168. d_printf("PROXY_INFO @ 0x%x \n\n", addr);
  1169. //PROXY_SERVER_LIST * _ProxyServerList
  1170. d_printf("\tPROXY_SERVER_LIST * _ProxyServerList = 0X%X\n",obj -> _ProxyServerList);
  1171. //AUTO_PROXY_DLLS * _AutoProxyList
  1172. d_printf("\tAUTO_PROXY_DLLS * _AutoProxyList = 0X%X\n", obj -> _AutoProxyList);
  1173. //PROXY_BYPASS_LIST * _ProxyBypassList
  1174. d_printf("\tPROXY_BYPASS_LIST * _ProxyBypassList = 0X%X\n", obj -> _ProxyBypassList);
  1175. //DWORD _Error
  1176. d_printf("\tDWORD _Error %d\n", obj -> _Error);
  1177. //RESOURCE_LOCK _Lock
  1178. d_printf("\tRESOURCE_LOCK (*) _Lock 0X%X\n", OFFSET(PROXY_INFO, _Lock));
  1179. //BOOL _Modified
  1180. d_printf("\tBOOL _Modified %d\n", obj -> _Modified);
  1181. //BAD_PROXY_LIST _BadProxyList
  1182. d_printf("\tBAD_PROXY_LIST _BadProxyList 0X%X\n", OFFSET(PROXY_INFO, _BadProxyList));
  1183. d_printf("\n");
  1184. }
  1185. DECLARE_API( proxyinfo )
  1186. {
  1187. DWORD dwAddr;
  1188. INIT_DPRINTF();
  1189. dwAddr = d_GetExpression(lpArgumentString);
  1190. if ( !dwAddr )
  1191. {
  1192. return;
  1193. }
  1194. do_proxy_info(dwAddr);
  1195. }
  1196. /////////////////////////////////////////////////
  1197. //
  1198. // PROXY_BYPASS_LIST_ENTRY structure
  1199. //
  1200. /////////////////////////////////////////////////
  1201. DECLARE_API( proxybyplste )
  1202. {
  1203. DWORD dwAddr;
  1204. INIT_DPRINTF();
  1205. dwAddr = d_GetExpression(lpArgumentString);
  1206. if ( !dwAddr )
  1207. {
  1208. return;
  1209. }
  1210. do_PROXY_BYPASS_LIST_ENTRY(dwAddr);
  1211. }
  1212. VOID
  1213. do_PROXY_BYPASS_LIST_ENTRY(
  1214. DWORD addr
  1215. )
  1216. {
  1217. BOOL b;
  1218. char block[ sizeof( PROXY_BYPASS_LIST_ENTRY ) ];
  1219. PROXY_BYPASS_LIST_ENTRY * obj = (PROXY_BYPASS_LIST_ENTRY *) &block;
  1220. b = GetData(
  1221. addr,
  1222. block,
  1223. sizeof( PROXY_BYPASS_LIST_ENTRY ),
  1224. NULL);
  1225. if ( !b ) {
  1226. d_printf("couldn't read PROXY_BYPASS_LIST_ENTRY at 0x%x; sorry.\n", addr);
  1227. return;
  1228. }
  1229. d_printf("PROXY_BYPASS_LIST_ENTRY @ 0x%x \n\n", addr);
  1230. //LIST_ENTRY _List
  1231. d_printf("\tLIST_ENTRY (*) _List 0x%x\n", OFFSET( PROXY_BYPASS_LIST_ENTRY, _List) );
  1232. //INTERNET_SCHEME _Scheme
  1233. d_printf("\tINTERNET_SCHEME _Scheme %d\n", obj -> _Scheme);
  1234. //ICSTRING _Name
  1235. d_printf("\tICSTRING (*) _Name 0x%x\n", OFFSET( PROXY_BYPASS_LIST_ENTRY, _Name) );
  1236. //INTERNET_PORT _Port
  1237. d_printf("\tINTERNET_PORT _Port %d\n", obj -> _Port);
  1238. //BOOL _LocalSemantics
  1239. d_printf("\tBOOL _LocalSemantics %d\n", obj -> _LocalSemantics);
  1240. d_printf("\n");
  1241. } // PROXY_BYPASS_LIST_ENTRY
  1242. /////////////////////////////////////////////////
  1243. //
  1244. // PROXY_BYPASS_LIST structure
  1245. //
  1246. /////////////////////////////////////////////////
  1247. DECLARE_API( proxybyplst )
  1248. {
  1249. DWORD dwAddr;
  1250. INIT_DPRINTF();
  1251. dwAddr = d_GetExpression(lpArgumentString);
  1252. if ( !dwAddr )
  1253. {
  1254. return;
  1255. }
  1256. do_PROXY_BYPASS_LIST(dwAddr);
  1257. }
  1258. VOID
  1259. do_PROXY_BYPASS_LIST(
  1260. DWORD addr
  1261. )
  1262. {
  1263. BOOL b;
  1264. char block[ sizeof( PROXY_BYPASS_LIST ) ];
  1265. PROXY_BYPASS_LIST * obj = (PROXY_BYPASS_LIST *) &block;
  1266. b = GetData(
  1267. addr,
  1268. block,
  1269. sizeof( PROXY_BYPASS_LIST ),
  1270. NULL);
  1271. if ( !b ) {
  1272. d_printf("couldn't read PROXY_BYPASS_LIST at 0x%x; sorry.\n", addr);
  1273. return;
  1274. }
  1275. d_printf("PROXY_BYPASS_LIST @ 0x%x \n\n", addr);
  1276. //SERIALIZED_LIST _List
  1277. d_printf("\tSERIALIZED_LIST (*) _List 0x%x\n", OFFSET( PROXY_BYPASS_LIST, _List) );
  1278. //DWORD _Error
  1279. d_printf("\tDWORD _Error %d\n", obj -> _Error);
  1280. d_printf("\n");
  1281. } // PROXY_BYPASS_LIST
  1282. /////////////////////////////////////////////////
  1283. //
  1284. // PROXY_SERVER_LIST_ENTRY structure
  1285. //
  1286. /////////////////////////////////////////////////
  1287. DECLARE_API( proxysrvlste )
  1288. {
  1289. DWORD dwAddr;
  1290. INIT_DPRINTF();
  1291. dwAddr = d_GetExpression(lpArgumentString);
  1292. if ( !dwAddr )
  1293. {
  1294. return;
  1295. }
  1296. do_PROXY_SERVER_LIST_ENTRY(dwAddr);
  1297. }
  1298. VOID
  1299. do_PROXY_SERVER_LIST_ENTRY(
  1300. DWORD addr
  1301. )
  1302. {
  1303. BOOL b;
  1304. char block[ sizeof( PROXY_SERVER_LIST_ENTRY ) ];
  1305. PROXY_SERVER_LIST_ENTRY * obj = (PROXY_SERVER_LIST_ENTRY *) &block;
  1306. b = GetData(
  1307. addr,
  1308. block,
  1309. sizeof( PROXY_SERVER_LIST_ENTRY ),
  1310. NULL);
  1311. if ( !b ) {
  1312. d_printf("couldn't read PROXY_SERVER_LIST_ENTRY at 0x%x; sorry.\n", addr);
  1313. return;
  1314. }
  1315. d_printf("PROXY_SERVER_LIST_ENTRY @ 0x%x \n\n", addr);
  1316. //LIST_ENTRY _List
  1317. d_printf("\tLIST_ENTRY (*) _List 0x%x\n", OFFSET( PROXY_SERVER_LIST_ENTRY, _List) );
  1318. //INTERNET_SCHEME _Protocol
  1319. d_printf("\tINTERNET_SCHEME _Protocol %d\n", obj -> _Protocol);
  1320. //INTERNET_SCHEME _Scheme
  1321. d_printf("\tINTERNET_SCHEME _Scheme %d\n", obj -> _Scheme);
  1322. //ICSTRING _ProxyName
  1323. d_printf("\tICSTRING (*) _ProxyName 0x%x\n", OFFSET( PROXY_SERVER_LIST_ENTRY, _ProxyName) );
  1324. //INTERNET_PORT _ProxyPort
  1325. d_printf("\tINTERNET_PORT _ProxyPort %d\n", obj -> _ProxyPort);
  1326. d_printf("\n");
  1327. } // PROXY_SERVER_LIST_ENTRY
  1328. /////////////////////////////////////////////////
  1329. //
  1330. // PROXY_SERVER_LIST structure
  1331. //
  1332. /////////////////////////////////////////////////
  1333. DECLARE_API( proxysrvlst )
  1334. {
  1335. DWORD dwAddr;
  1336. INIT_DPRINTF();
  1337. dwAddr = d_GetExpression(lpArgumentString);
  1338. if ( !dwAddr )
  1339. {
  1340. return;
  1341. }
  1342. do_PROXY_SERVER_LIST(dwAddr);
  1343. }
  1344. VOID
  1345. do_PROXY_SERVER_LIST(
  1346. DWORD addr
  1347. )
  1348. {
  1349. BOOL b;
  1350. char block[ sizeof( PROXY_SERVER_LIST ) ];
  1351. PROXY_SERVER_LIST * obj = (PROXY_SERVER_LIST *) &block;
  1352. b = GetData(
  1353. addr,
  1354. block,
  1355. sizeof( PROXY_SERVER_LIST ),
  1356. NULL);
  1357. if ( !b ) {
  1358. d_printf("couldn't read PROXY_SERVER_LIST at 0x%x; sorry.\n", addr);
  1359. return;
  1360. }
  1361. d_printf("PROXY_SERVER_LIST @ 0x%x \n\n", addr);
  1362. //SERIALIZED_LIST _List
  1363. d_printf("\tSERIALIZED_LIST (*) _List 0x%x\n", OFFSET( PROXY_SERVER_LIST, _List) );
  1364. //DWORD _Error
  1365. d_printf("\tDWORD _Error %d\n", obj -> _Error);
  1366. d_printf("\n");
  1367. } // PROXY_SERVER_LIST
  1368. /////////////////////////////////////////////////
  1369. //
  1370. // ICSocket structure
  1371. //
  1372. /////////////////////////////////////////////////
  1373. DECLARE_API( ICSocket )
  1374. {
  1375. DWORD dwAddr;
  1376. INIT_DPRINTF();
  1377. dwAddr = d_GetExpression(lpArgumentString);
  1378. if ( !dwAddr )
  1379. {
  1380. return;
  1381. }
  1382. do_ICSocket(dwAddr);
  1383. }
  1384. VOID
  1385. do_ICSocket(
  1386. DWORD addr
  1387. )
  1388. {
  1389. BOOL b;
  1390. char block[ sizeof( ICSocket ) ];
  1391. ICSocket * obj = (ICSocket *) &block;
  1392. b = GetData(
  1393. addr,
  1394. block,
  1395. sizeof( ICSocket ),
  1396. NULL);
  1397. if ( !b ) {
  1398. d_printf("couldn't read ICSocket at 0x%x; sorry.\n", addr);
  1399. return;
  1400. }
  1401. d_printf("ICSocket @ 0x%x \n\n", addr);
  1402. //LIST_ENTRY m_List
  1403. d_printf("\tLIST_ENTRY (*) m_List 0x%x\n", OFFSET( ICSocket, m_List) );
  1404. //DWORD m_dwTimeout
  1405. d_printf("\tDWORD m_dwTimeout %d\n", obj -> m_dwTimeout);
  1406. //LONG m_ReferenceCount
  1407. d_printf("\tLONG m_ReferenceCount %d\n", obj -> m_ReferenceCount);
  1408. //DWORD m_dwFlags
  1409. d_printf("\tDWORD m_dwFlags %d\n", obj -> m_dwFlags);
  1410. // SOCKET m_Socket;
  1411. d_printf("\tSOCKET m_Socket %d\n", obj -> m_Socket);
  1412. //INTERNET_PORT m_Port
  1413. d_printf("\tINTERNET_PORT m_Port %d\n", obj -> m_Port);
  1414. //INTERNET_PORT m_SourcePort
  1415. d_printf("\tINTERNET_PORT m_SourcePort %d\n", obj -> m_SourcePort);
  1416. //BOOL m_bAborted
  1417. d_printf("\tBOOL m_bAborted %d\n", obj -> m_bAborted);
  1418. //DWORD m_SocksAddress
  1419. d_printf("\tDWORD m_SocksAddress %d\n", obj -> m_SocksAddress);
  1420. //INTERNET_PORT m_SocksPort
  1421. d_printf("\tINTERNET_PORT m_SocksPort %d\n", obj -> m_SocksPort);
  1422. #if INET_DEBUG
  1423. //DWORD m_Signature
  1424. d_printf("\tDWORD m_Signature %d\n", obj -> m_Signature);
  1425. #endif
  1426. d_printf("\n");
  1427. } // ICSocket
  1428. /////////////////////////////////////////////////
  1429. //
  1430. // ICSecureSocket structure
  1431. //
  1432. /////////////////////////////////////////////////
  1433. DECLARE_API( ICSecureSocket )
  1434. {
  1435. DWORD dwAddr;
  1436. INIT_DPRINTF();
  1437. dwAddr = d_GetExpression(lpArgumentString);
  1438. if ( !dwAddr )
  1439. {
  1440. return;
  1441. }
  1442. do_ICSecureSocket(dwAddr);
  1443. }
  1444. VOID
  1445. do_ICSecureSocket(
  1446. DWORD addr
  1447. )
  1448. {
  1449. BOOL b;
  1450. char block[ sizeof( ICSecureSocket ) ];
  1451. ICSecureSocket * obj = (ICSecureSocket *) &block;
  1452. b = GetData(
  1453. addr,
  1454. block,
  1455. sizeof( ICSecureSocket ),
  1456. NULL);
  1457. if ( !b ) {
  1458. d_printf("couldn't read ICSecureSocket at 0x%x; sorry.\n", addr);
  1459. return;
  1460. }
  1461. d_printf("ICSecureSocket @ 0x%x \n\n", addr);
  1462. //CtxtHandle m_hContext
  1463. d_printf("\tCtxtHandle (*) m_hContext 0x%x\n", OFFSET( ICSecureSocket, m_hContext) );
  1464. //DWORD m_dwProviderIndex
  1465. d_printf("\tDWORD m_dwProviderIndex %d\n", obj -> m_dwProviderIndex);
  1466. //LPSTR m_lpszHostName
  1467. d_printf("\tLPSTR m_lpszHostName %s\n", obj -> m_lpszHostName);
  1468. //DBLBUFFER * m_pdblbufBuffer
  1469. d_printf("\tDBLBUFFER * m_pdblbufBuffer 0x%x\n", obj -> m_pdblbufBuffer);
  1470. //DWORD m_dwErrorFlags
  1471. d_printf("\tDWORD m_dwErrorFlags %d\n", obj -> m_dwErrorFlags);
  1472. //SECURITY_CACHE_LIST_ENTRY * m_pSecurityInfo
  1473. d_printf("\tSECURITY_CACHE_LIST_ENTRY * m_pSecurityInfo 0x%x\n", obj -> m_pSecurityInfo);
  1474. #if INET_DEBUG
  1475. #endif
  1476. d_printf("\n");
  1477. } // ICSecureSocket
  1478. #if INET_DEBUG
  1479. LPSTR
  1480. MapType(
  1481. FSM_TYPE m_Type
  1482. ) {
  1483. switch (m_Type) {
  1484. case FSM_TYPE_NONE: return "NONE";
  1485. case FSM_TYPE_WAIT_FOR_COMPLETION: return "WAIT_FOR_COMPLETION";
  1486. case FSM_TYPE_RESOLVE_HOST: return "RESOLVE_HOST";
  1487. case FSM_TYPE_SOCKET_CONNECT: return "SOCKET_CONNECT";
  1488. case FSM_TYPE_SOCKET_SEND: return "SOCKET_SEND";
  1489. case FSM_TYPE_SOCKET_RECEIVE: return "SOCKET_RECEIVE";
  1490. case FSM_TYPE_SOCKET_QUERY_AVAILABLE: return "SOCKET_QUERY_AVAILABLE";
  1491. case FSM_TYPE_SECURE_CONNECT: return "SECURE_CONNECT";
  1492. case FSM_TYPE_SECURE_HANDSHAKE: return "SECURE_HANDSHAKE";
  1493. case FSM_TYPE_SECURE_NEGOTIATE: return "SECURE_NEGOTIATE";
  1494. case FSM_TYPE_NEGOTIATE_LOOP: return "NEGOTIATE_LOOP";
  1495. case FSM_TYPE_SECURE_SEND: return "SECURE_SEND";
  1496. case FSM_TYPE_SECURE_RECEIVE: return "SECURE_RECEIVE";
  1497. case FSM_TYPE_GET_CONNECTION: return "GET_CONNECTION";
  1498. case FSM_TYPE_HTTP_SEND_REQUEST: return "HTTP_SEND_REQUEST";
  1499. case FSM_TYPE_MAKE_CONNECTION: return "MAKE_CONNECTION";
  1500. case FSM_TYPE_OPEN_CONNECTION: return "OPEN_CONNECTION";
  1501. case FSM_TYPE_OPEN_PROXY_TUNNEL: return "OPEN_PROXY_TUNNEL";
  1502. case FSM_TYPE_SEND_REQUEST: return "SEND_REQUEST";
  1503. case FSM_TYPE_RECEIVE_RESPONSE: return "RECEIVE_RESPONSE";
  1504. case FSM_TYPE_HTTP_READ: return "HTTP_READ";
  1505. case FSM_TYPE_HTTP_WRITE: return "HTTP_WRITE";
  1506. case FSM_TYPE_READ_DATA: return "READ_DATA";
  1507. case FSM_TYPE_HTTP_QUERY_AVAILABLE: return "HTTP_QUERY_AVAILABLE";
  1508. case FSM_TYPE_DRAIN_RESPONSE: return "DRAIN_RESPONSE";
  1509. case FSM_TYPE_REDIRECT: return "REDIRECT";
  1510. case FSM_TYPE_READ_LOOP: return "READ_LOOP";
  1511. case FSM_TYPE_PARSE_HTTP_URL: return "PARSE_HTTP_URL";
  1512. case FSM_TYPE_PARSE_URL_FOR_HTTP: return "PARSE_URL_FOR_HTTP";
  1513. case FSM_TYPE_READ_FILE: return "READ_FILE";
  1514. case FSM_TYPE_READ_FILE_EX: return "READ_FILE_EX";
  1515. case FSM_TYPE_WRITE_FILE: return "WRITE_FILE";
  1516. case FSM_TYPE_QUERY_DATA_AVAILABLE: return "QUERY_DATA_AVAILABLE";
  1517. }
  1518. return "?";
  1519. }
  1520. #endif // INET_DEBUG
  1521. LPSTR
  1522. MapState(
  1523. IN DWORD State
  1524. ) {
  1525. switch (State) {
  1526. CASE_OF(FSM_STATE_BAD);
  1527. CASE_OF(FSM_STATE_INIT);
  1528. CASE_OF(FSM_STATE_WAIT);
  1529. CASE_OF(FSM_STATE_DONE);
  1530. CASE_OF(FSM_STATE_ERROR);
  1531. CASE_OF(FSM_STATE_CONTINUE);
  1532. CASE_OF(FSM_STATE_FINISH);
  1533. CASE_OF(FSM_STATE_1);
  1534. CASE_OF(FSM_STATE_2);
  1535. CASE_OF(FSM_STATE_3);
  1536. CASE_OF(FSM_STATE_4);
  1537. CASE_OF(FSM_STATE_5);
  1538. CASE_OF(FSM_STATE_6);
  1539. CASE_OF(FSM_STATE_7);
  1540. CASE_OF(FSM_STATE_8);
  1541. CASE_OF(FSM_STATE_9);
  1542. CASE_OF(FSM_STATE_10);
  1543. }
  1544. return "?";
  1545. }