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.

1099 lines
38 KiB

  1. #include <wmiexts.h>
  2. #include <oleauto.h>
  3. #include <wbemutil.h>
  4. #ifndef COREPROX_POLARITY
  5. #define COREPROX_POLARITY
  6. #endif
  7. #include <arena.h>
  8. #include <faster.h>
  9. #include <faststr.h>
  10. #include <wbemint.h>
  11. #include <fastcls.h>
  12. #include <var.h>
  13. #include <fastinst.h>
  14. #include <wbemdatapacket.h>
  15. //#include <smartnextpacket.h>
  16. #pragma pack( push )
  17. #pragma pack( 1 )
  18. // IWbemWCOSmartEnum::Next() Header. Changing this will
  19. // cause the main version to change
  20. typedef struct tagWBEM_DATAPACKET_SMARTENUM_NEXT
  21. {
  22. DWORD dwSizeOfHeader; // Size of the header struct. Data immediately follows header.
  23. DWORD dwDataSize; // Size of Data following header.
  24. } WBEM_DATAPACKET_SMARTENUM_NEXT;
  25. typedef WBEM_DATAPACKET_SMARTENUM_NEXT* PWBEM_DATAPACKET_SMARTENUM_NEXT;
  26. // restore packing
  27. #pragma pack( pop )
  28. //#include <objarraypacket.h>
  29. #pragma pack( push )
  30. #pragma pack( 1 )
  31. // IWbemClassObject Array Header. Changing this will
  32. // cause the main version to change
  33. typedef struct tagWBEM_DATAPACKET_OBJECT_ARRAY
  34. {
  35. DWORD dwSizeOfHeader; // Size of the header struct. Data immediately follows header.
  36. DWORD dwDataSize; // Size of Data following header.
  37. DWORD dwNumObjects; // Number of objects in the array
  38. } WBEM_DATAPACKET_OBJECT_ARRAY;
  39. typedef WBEM_DATAPACKET_OBJECT_ARRAY* PWBEM_DATAPACKET_OBJECT_ARRAY;
  40. // restore packing
  41. #pragma pack( pop )
  42. #pragma pack( push )
  43. #pragma pack( 1 )
  44. // IWbemObjectSink::Indicate() Header. Changing this will
  45. // cause the main version to change
  46. typedef struct tagWBEM_DATAPACKET_OBJECTSINK_INDICATE
  47. {
  48. DWORD dwSizeOfHeader; // Size of the header struct. Data immediately follows header.
  49. DWORD dwDataSize; // Size of Data following header.
  50. } WBEM_DATAPACKET_OBJECTSINK_INDICATE;
  51. typedef WBEM_DATAPACKET_OBJECTSINK_INDICATE* PWBEM_DATAPACKET_OBJECTSINK_INDICATE;
  52. // restore packing
  53. #pragma pack( pop )
  54. #pragma pack( push )
  55. #pragma pack( 1 )
  56. // IWbemObjectSink::Indicate() Header. Changing this will
  57. // cause the main version to change
  58. typedef struct tagWBEM_DATAPACKET_UNBOUNDSINK_INDICATE
  59. {
  60. DWORD dwSizeOfHeader; // Size of the header struct. Data immediately follows header.
  61. DWORD dwDataSize; // Size of Data following header.
  62. DWORD dwLogicalConsumerSize; // Size of Logical Consumer Object
  63. } WBEM_DATAPACKET_UNBOUNDSINK_INDICATE;
  64. #ifdef _WIN64
  65. typedef UNALIGNED WBEM_DATAPACKET_UNBOUNDSINK_INDICATE * PWBEM_DATAPACKET_UNBOUNDSINK_INDICATE;
  66. #else
  67. typedef WBEM_DATAPACKET_UNBOUNDSINK_INDICATE * PWBEM_DATAPACKET_UNBOUNDSINK_INDICATE;
  68. #endif
  69. // restore packing
  70. #pragma pack( pop )
  71. #pragma pack( push )
  72. #pragma pack( 1 )
  73. // IWbemMultiTarget::DeliverEvent() Header. Changing this will
  74. // cause the main version to change
  75. typedef struct tagWBEM_DATAPACKET_MULTITARGET_DELIVEREVENT
  76. {
  77. DWORD dwSizeOfHeader; // Size of the header struct. Data immediately follows header.
  78. DWORD dwDataSize; // Size of Data following header.
  79. } WBEM_DATAPACKET_MULTITARGET_DELIVEREVENT;
  80. typedef WBEM_DATAPACKET_MULTITARGET_DELIVEREVENT* PWBEM_DATAPACKET_MULTITARGET_DELIVEREVENT;
  81. // restore packing
  82. #pragma pack( pop )
  83. #include <wbemobjpacket.h>
  84. #include <malloc.h>
  85. #ifndef HEAP_ENTRY
  86. typedef struct _HEAP_ENTRY
  87. {
  88. USHORT Size;
  89. USHORT PreviousSize;
  90. UCHAR SmallTagIndex;
  91. UCHAR Flags;
  92. UCHAR UnusedBytes;
  93. UCHAR SegmentIndex;
  94. #if defined(_WIN64)
  95. ULONGLONG Reserved1;
  96. #endif
  97. } HEAP_ENTRY, *PHEAP_ENTRY;
  98. #endif
  99. void GetCompressedString(ULONG_PTR pRemoteAddr,
  100. BYTE * pBuff,
  101. DWORD Size){
  102. if (pRemoteAddr) {
  103. CCompressedString * pCS = (CCompressedString *)_alloca(Size*2);
  104. ReadMemory(pRemoteAddr,pCS,Size*2,0);
  105. pBuff[Size-2]=0;
  106. pBuff[Size-1]=0;
  107. if (pCS->m_fFlags == STRING_FLAG_UNICODE){
  108. WideCharToMultiByte(CP_ACP,0,(WCHAR *)&(pCS->m_cFirstByte),-1,(LPSTR)pBuff,Size-2,NULL,NULL);
  109. } else {
  110. memcpy(pBuff,&(pCS->m_cFirstByte),Size-2);
  111. }
  112. } else {
  113. lstrcpyA((LPSTR)pBuff,"<NULL>");
  114. }
  115. }
  116. /*
  117. protected:
  118. length_t m_nTotalLength;
  119. //CDecorationPart m_DecorationPart;
  120. CClassAndMethods m_ParentPart;
  121. CClassAndMethods m_CombinedPart;
  122. int m_nCurrentMethod;
  123. CLimitationMapping* m_pLimitMapping;
  124. friend class CWbemInstance;
  125. */
  126. /*
  127. CClassPart m_ClassPart;
  128. CMethodPart m_MethodPart;
  129. CWbemClass* m_pClass;
  130. */
  131. void
  132. DumpClass(CClassPart * pCls){
  133. BYTE pBuff[256];
  134. dprintf(" m_pContainer %p m_pParent %p m_pHeader %p\n",pCls->m_pContainer,pCls->m_pParent,pCls->m_pHeader);
  135. DEFINE_CPP_VAR(CClassPart::CClassPartHeader,varHeader);
  136. CClassPart::CClassPartHeader * pHeader = GET_CPP_VAR_PTR( CClassPart::CClassPartHeader , varHeader );
  137. if (pCls->m_pHeader){
  138. ReadMemory((ULONG_PTR)pCls->m_pHeader,pHeader,sizeof(CClassPart::CClassPartHeader),0);
  139. dprintf(" nLength %x fFlags %02x ptrClassName %08x nDataLength %x\n",pHeader->nLength,pHeader->fFlags,pHeader->ptrClassName,pHeader->nDataLength);
  140. }
  141. dprintf(" DL m_nNumStrings %x %08x\n",pCls->m_Derivation.m_nNumStrings,pCls->m_Derivation.m_pnLength);
  142. dprintf(" QS m_nLength %x m_pOthers %08x m_pHeap %08x\n",pCls->m_Qualifiers.m_nLength,pCls->m_Qualifiers.m_pOthers,pCls->m_Qualifiers.m_pHeap);
  143. DEFINE_CPP_VAR(CFastHeap,varCFastHeap);
  144. CFastHeap * pFHeap = GET_CPP_VAR_PTR( CFastHeap , varCFastHeap );
  145. ReadMemory((ULONG_PTR)pCls->m_Qualifiers.m_pHeap,pFHeap,sizeof(CFastHeap),0);
  146. dprintf(" FH m_pHeapData %08x m_pHeapHeader %08x m_pContainer %08x\n",pFHeap->m_pHeapData,pFHeap->m_pHeapHeader,pFHeap->m_pContainer);
  147. dprintf(" m_nPropagationFlag %x m_nRef %x\n",pCls->m_Qualifiers.m_nPropagationFlag,pCls->m_Qualifiers.m_nRef);
  148. dprintf(" m_pControl %08x m_pContainer %08x m_pSecondarySet %08x\n",pCls->m_Qualifiers.m_pControl,pCls->m_Qualifiers.m_pContainer,pCls->m_Qualifiers.m_pSecondarySet);
  149. dprintf(" BA m_nSize %x m_astrStrings %08x\n",pCls->m_Qualifiers.m_astrCurrentNames.m_nSize,pCls->m_Qualifiers.m_astrCurrentNames.m_astrStrings);
  150. int nProp;
  151. if (pCls->m_Properties.m_pnProps) {
  152. ReadMemory((ULONG_PTR)pCls->m_Properties.m_pnProps,&nProp,sizeof(int),0);
  153. dprintf(" PR m_pnProps %08x %x m_pContainer %08x\n",pCls->m_Properties.m_pnProps,nProp,pCls->m_Properties.m_pContainer);
  154. CPropertyLookup * pPropLook = (CPropertyLookup *)_alloca(nProp*sizeof(CPropertyLookup));
  155. ReadMemory((ULONG_PTR)pCls->m_Properties.m_pnProps+sizeof(int),pPropLook,nProp*sizeof(CPropertyLookup),0);
  156. DWORD i;
  157. for (i=0;i<nProp;i++){
  158. pBuff[0]=0;
  159. if ((ULONG_PTR)(pCls->m_Heap.m_pHeapData+pPropLook[i].ptrName) != 0xffffffff){
  160. GetCompressedString((ULONG_PTR)(pCls->m_Heap.m_pHeapData+pPropLook[i].ptrName),pBuff,sizeof(pBuff));
  161. }
  162. DEFINE_CPP_VAR(CPropertyInformation,varCPropertyInformation);
  163. CPropertyInformation * pPropInfo = GET_CPP_VAR_PTR( CPropertyInformation , varCPropertyInformation );
  164. ReadMemory((ULONG_PTR)pCls->m_Heap.m_pHeapData+pPropLook[i].ptrInformation,pPropInfo ,sizeof(CPropertyInformation),0);
  165. dprintf(" prop %d %s Type %08x DataIdx %04x DataOff %08x Origin %08x\n",i,
  166. pBuff,
  167. pPropInfo->nType,
  168. pPropInfo->nDataIndex,
  169. pPropInfo->nDataOffset,
  170. pPropInfo->nOrigin);
  171. if (CheckControlC())
  172. break;
  173. }
  174. } else {
  175. dprintf(" PR m_pnProps %08x m_pContainer %08x\n",pCls->m_Properties.m_pnProps,pCls->m_Properties.m_pContainer);
  176. }
  177. CDataTable * pCData = &pCls->m_Defaults;
  178. dprintf(" DT m_pNullness %08x m_pData %08x m_nLength %x m_nProps %x m_pContainer %08x\n",pCData->m_pNullness,pCData->m_pData,pCData->m_nLength,pCData->m_nProps,pCData->m_pContainer);
  179. dprintf(" FH m_pHeapData %08x m_pHeapHeader %08x m_pContainer %08x\n",pCls->m_Heap.m_pHeapData,pCls->m_Heap.m_pHeapHeader,pCls->m_Heap.m_pContainer);
  180. //CHeapHeader m_LocalHeapHeader;
  181. BYTE * pHeap = pCls->m_Heap.m_pHeapData;
  182. pBuff[0]=0;
  183. if ((DWORD)(pHeader->ptrClassName) != 0xffffffff){
  184. GetCompressedString((ULONG_PTR)(pHeap+pHeader->ptrClassName),pBuff,sizeof(pBuff));
  185. }
  186. dprintf(" __RELPATH %s\n",pBuff);
  187. }
  188. void DecodeStatus(DWORD dwInternalStatus)
  189. {
  190. if (dwInternalStatus & WBEM_OBJ_DECORATION_PART) dprintf("WBEM_OBJ_DECORATION_PART ");
  191. if (dwInternalStatus & WBEM_OBJ_INSTANCE_PART) dprintf("WBEM_OBJ_INSTANCE_PART ");
  192. if (dwInternalStatus & WBEM_OBJ_CLASS_PART) dprintf("WBEM_OBJ_CLASS_PART ");
  193. if (dwInternalStatus & WBEM_OBJ_CLASS_PART_INTERNAL) dprintf("WBEM_OBJ_CLASS_PART_INTERNAL ");
  194. if (dwInternalStatus & WBEM_OBJ_CLASS_PART_SHARED) dprintf("WBEM_OBJ_CLASS_PART_SHARED ");
  195. };
  196. DECLARE_API(wc) {
  197. INIT_API();
  198. DEFINE_CPP_VAR( CWbemClass, varCWbemClass);
  199. CWbemClass * pCls = GET_CPP_VAR_PTR( CWbemClass , varCWbemClass );
  200. ULONG_PTR pByte = 0;
  201. pByte = GetExpression(args);
  202. if (pByte){
  203. ReadMemory(pByte,pCls,sizeof(CWbemClass),0);
  204. dprintf(" m_nRef %d m_bOwnMemory %d\n",pCls->m_nRef,pCls->m_bOwnMemory);
  205. dprintf(" m_nCurrentProp %08x m_lEnumFlags %08x m_lExtEnumFlags %08x\n",pCls->m_nCurrentProp,pCls->m_lEnumFlags,pCls->m_lExtEnumFlags);
  206. dprintf(" m_dwInternalStatus %08x m_pMergedClassObject %08x\n",pCls->m_dwInternalStatus,pCls->m_pMergedClassObject);
  207. BYTE * pData = pCls->m_DecorationPart.m_pfFlags;
  208. BYTE pBuff1[256];
  209. GetCompressedString((ULONG_PTR)pCls->m_DecorationPart.m_pcsServer,pBuff1,sizeof(pBuff1));
  210. BYTE pBuff2[256];
  211. GetCompressedString((ULONG_PTR)pCls->m_DecorationPart.m_pcsNamespace,pBuff2,sizeof(pBuff2));
  212. BYTE b=0xff;
  213. if (pData){
  214. ReadMemory((ULONG_PTR)pData,&b,sizeof(b),0);
  215. }
  216. dprintf(" m_DecorationPart.m_pfFlags %p FLAG %02x\n",pData,b);
  217. dprintf(" Server: %s Namespace: %s\n",pBuff1,pBuff2);
  218. dprintf(" m_LockData: m_lLock %d m_lLockCount %d m_dwThreadId %x\n",pCls->m_LockData.m_lLock,pCls->m_LockData.m_lLockCount,pCls->m_LockData.m_dwThreadId);
  219. dprintf(" m_Lock.m_pData %p\n",pCls->m_Lock.m_pData);
  220. //dprintf(" m_pBlobControl %08x m_refDataTable %08x m_refDataHeap %08x m_refDerivationList %08x\n",pCls->m_pBlobControl,((void *)&pCls->m_refDataTable),((void *)&pCls->m_refDataHeap),((void *)&pCls->m_refDerivationList));
  221. dprintf(" m_pBlobControl %p\n",pCls->m_pBlobControl);
  222. DEFINE_CPP_VAR( CDataTable,varCDataTable);
  223. CDataTable * pCData = GET_CPP_VAR_PTR(CDataTable,varCDataTable);
  224. if(pCData){
  225. ReadMemory((ULONG_PTR)(&(pCls->m_refDataTable)),pCData,sizeof(CDataTable),0);
  226. dprintf(" m_pNullness %p m_pData %p m_nLength %x m_nProps %x m_pContainer %08x\n",pCData->m_pNullness,pCData->m_pData,pCData->m_nLength,pCData->m_nProps,pCData->m_pContainer);
  227. }
  228. DEFINE_CPP_VAR(CFastHeap,varCFastHeap);
  229. CFastHeap * pFHeap = GET_CPP_VAR_PTR( CFastHeap , varCFastHeap );
  230. DWORD * pFoo = (DWORD *)&(pCls->m_refDataHeap);
  231. ReadMemory((ULONG_PTR )pFoo,pFHeap,sizeof(CFastHeap),0);
  232. dprintf(" FH m_pHeapData %p m_pHeapHeader %p m_pContainer %p\n",pFHeap->m_pHeapData,pFHeap->m_pHeapHeader,pFHeap->m_pContainer);
  233. dprintf(" m_nTotalLength %x\n",pCls->m_nTotalLength);
  234. dprintf(" m_ParentPart at offset %x\n",(ULONG_PTR)&pCls->m_ParentPart-(ULONG_PTR)pCls);
  235. dprintf(" m_ParentPart.m_pClassPart at offset %x\n",(ULONG_PTR)&(pCls->m_ParentPart.m_ClassPart)-(ULONG_PTR)pCls);
  236. DumpClass(&(pCls->m_ParentPart.m_ClassPart));
  237. dprintf(" m_CombinedPart at offset %x\n",(ULONG_PTR)&pCls->m_CombinedPart-(ULONG_PTR)pCls);
  238. DumpClass(&(pCls->m_CombinedPart.m_ClassPart));
  239. dprintf(" m_pClass %08x\n",pCls->m_ParentPart.m_pClass);
  240. } else {
  241. dprintf("invalid address %s\n",args);
  242. }
  243. }
  244. void
  245. DumpInstance(CInstancePart * pIns)
  246. {
  247. dprintf(" m_pContainer %08x m_pHeader %08x\n",pIns->m_pContainer,pIns->m_pHeader);
  248. dprintf(" DT m_DataTable m_pNullness %08x m_pData %08x\n",pIns->m_DataTable.m_pNullness,pIns->m_DataTable.m_pData);
  249. dprintf(" m_nLength %x m_nProps %x m_pContainer %08x\n",pIns->m_DataTable.m_nLength,pIns->m_DataTable.m_nProps,pIns->m_DataTable.m_pContainer);
  250. dprintf(" Q m_Qualifiers m_nPropagationFlag %08x m_nRef %x m_pControl %08x\n",pIns->m_Qualifiers.m_nPropagationFlag,pIns->m_Qualifiers.m_nRef,pIns->m_Qualifiers.m_pControl);
  251. dprintf(" m_pContainer %08x m_pSecondarySet %08x\n",pIns->m_Qualifiers.m_pContainer,pIns->m_Qualifiers.m_pSecondarySet);
  252. CFixedBSTRArray * pArr = &(pIns->m_Qualifiers.m_astrCurrentNames);
  253. dprintf(" m_nCurrentIndex %x\n",pIns->m_Qualifiers.m_nCurrentIndex);
  254. DEFINE_CPP_VAR(CInstancePart::CInstancePartHeader,varHeader);
  255. CInstancePart::CInstancePartHeader * pHeader = GET_CPP_VAR_PTR( CInstancePart::CInstancePartHeader , varHeader );
  256. if (pIns->m_pHeader)
  257. {
  258. if (ReadMemory((ULONG_PTR)pIns->m_pHeader,pHeader,sizeof(CInstancePart::CInstancePartHeader),0))
  259. {
  260. dprintf(" nLength %x fFlags %02x ptrClassName %08x \n",pHeader->nLength,pHeader->fFlags,pHeader->ptrClassName);
  261. }
  262. else
  263. {
  264. dprintf("RM %p\n",pIns->m_pHeader);
  265. }
  266. }
  267. dprintf(" FH m_pHeapData %08x m_pHeapHeader %08x m_pContainer %08x\n",pIns->m_Heap.m_pHeapData,pIns->m_Heap.m_pHeapHeader,pIns->m_Heap.m_pContainer);
  268. }
  269. DECLARE_API(wi)
  270. {
  271. INIT_API();
  272. DEFINE_CPP_VAR( CWbemInstance, varCWbemInstance);
  273. CWbemInstance * pCls = GET_CPP_VAR_PTR( CWbemInstance , varCWbemInstance );
  274. ULONG_PTR pByte = 0;
  275. pByte = GetExpression(args);
  276. if (pByte)
  277. {
  278. if (ReadMemory(pByte,pCls,sizeof(CWbemInstance),0))
  279. {
  280. //length_t m_nTotalLength;
  281. //dprintf(" m_nTotalLength %08x\n",pCls->m_nTotalLength);
  282. dprintf(" m_nRef %d m_bOwnMemory %d\n",pCls->m_nRef,pCls->m_bOwnMemory);
  283. dprintf(" m_nCurrentProp %08x m_lEnumFlags %08x m_lExtEnumFlags %08x\n",pCls->m_nCurrentProp,pCls->m_lEnumFlags,pCls->m_lExtEnumFlags);
  284. dprintf(" m_dwInternalStatus %08x\n",pCls->m_dwInternalStatus);
  285. DecodeStatus(pCls->m_dwInternalStatus);
  286. dprintf("\n");
  287. dprintf(" m_pMergedClassObject %08x\n",pCls->m_pMergedClassObject);
  288. BYTE * pData = pCls->m_DecorationPart.m_pfFlags;
  289. BYTE pBuff1[256];
  290. GetCompressedString((ULONG_PTR)pCls->m_DecorationPart.m_pcsServer,pBuff1,sizeof(pBuff1));
  291. BYTE pBuff2[256];
  292. GetCompressedString((ULONG_PTR)pCls->m_DecorationPart.m_pcsNamespace,pBuff2,sizeof(pBuff2));
  293. BYTE b=0xff;
  294. if (pData){
  295. ReadMemory((ULONG_PTR)pData,&b,sizeof(b),0);
  296. }
  297. dprintf(" m_DecorationPart.m_pfFlags %p FLAG %02x\n",pData,b);
  298. dprintf(" Server: %s Namespace: %s\n",pBuff1,pBuff2);
  299. //CClassPart m_ClassPart;
  300. DumpClass(&(pCls->m_ClassPart));
  301. //CInstancePart m_InstancePart;
  302. DumpInstance(&(pCls->m_InstancePart));
  303. //CVar m_CachedKey;
  304. dprintf(" m_vt %08x m_value %08x m_nStatus %08x m_bCanDelete %08x\n",pCls->m_CachedKey.m_vt,pCls->m_CachedKey.m_value.pUnk,pCls->m_CachedKey.m_nStatus,pCls->m_CachedKey.m_bCanDelete);
  305. }
  306. else
  307. {
  308. dprintf("RM %p\n",pByte);
  309. }
  310. }
  311. else
  312. {
  313. dprintf("invalid address %s\n",args);
  314. }
  315. }
  316. DECLARE_API(cp) {
  317. INIT_API();
  318. DEFINE_CPP_VAR( CClassPart, varCClassPart);
  319. CClassPart * pCls = GET_CPP_VAR_PTR( CClassPart , varCClassPart );
  320. ULONG_PTR pByte = 0;
  321. pByte = GetExpression(args);
  322. if (pByte){
  323. ReadMemory(pByte,pCls,sizeof(CClassPart),0);
  324. DumpClass(pCls);
  325. } else {
  326. dprintf("invalid address %s\n",args);
  327. }
  328. }
  329. /*
  330. typedef union
  331. {
  332. char cVal; // VT_I1
  333. BYTE bVal; // VT_UI1
  334. SHORT iVal; // VT_I2
  335. WORD wVal; // VT_UI2
  336. LONG lVal; // VT_I4
  337. DWORD dwVal; // VT_UI4
  338. VARIANT_BOOL boolVal; // VT_BOOL
  339. float fltVal; // VT_R4
  340. double dblVal; // VT_R8
  341. LPSTR pStr; // VT_LPSTR
  342. LPWSTR pWStr; // VT_LPWSTR
  343. BSTR Str; // VT_BSTR (stored as VT_LPWSTR)
  344. FILETIME Time; // VT_FILETIME
  345. BLOB Blob; // VT_BLOB
  346. LPCLSID pClsId; // VT_CLSID
  347. IUnknown* pUnk; // VT_UNKNOWN
  348. IDispatch* pDisp; // VT_DISPATCH
  349. CVarVector *pVarVector; // VT_EX_CVARVECTOR
  350. } METAVALUE;
  351. int m_vt;
  352. METAVALUE m_value;
  353. int m_nStatus;
  354. BOOL m_bCanDelete;
  355. */
  356. DECLARE_API(cvar) {
  357. INIT_API();
  358. DEFINE_CPP_VAR( CVar, varCVar);
  359. CVar * pVar = GET_CPP_VAR_PTR( CVar , varCVar );
  360. WCHAR pwBuff[128];
  361. CHAR pBuff[128];
  362. ULONG_PTR pByte = 0;
  363. pByte = GetExpression(args);
  364. if (pByte){
  365. ReadMemory(pByte,pVar,sizeof(CVar),0);
  366. switch(pVar->m_vt){
  367. case VT_I1:
  368. dprintf("VT_I1 %02x\n",pVar->m_value.cVal);
  369. break;
  370. case VT_UI1:
  371. dprintf("VT_UI1 %02x\n",pVar->m_value.bVal);
  372. break;
  373. case VT_I2:
  374. dprintf("VT_I2 %04x\n",pVar->m_value.iVal);
  375. break;
  376. case VT_UI2:
  377. dprintf("VT_UI2 %04x\n",pVar->m_value.wVal);
  378. break;
  379. case VT_I4:
  380. dprintf("VT_I4 %08x\n",pVar->m_value.lVal);
  381. break;
  382. case VT_UI4:
  383. dprintf("VT_UI4 %08x\n",pVar->m_value.dwVal);
  384. break;
  385. case VT_BOOL:
  386. dprintf("VT_BOOL %04x\n",pVar->m_value.boolVal);
  387. break;
  388. case VT_R4:
  389. dprintf("VT_R4 %f\n",pVar->m_value.fltVal);
  390. break;
  391. case VT_R8:
  392. dprintf("VT_R8 %e\n",pVar->m_value.dblVal);
  393. break;
  394. case VT_LPSTR:
  395. ReadMemory((ULONG_PTR)pVar->m_value.pStr,pBuff,sizeof(pBuff),0);
  396. pBuff[sizeof(pBuff)-1]=0;
  397. dprintf("VT_LPSTR %s\n",pBuff);
  398. break;
  399. case VT_LPWSTR:
  400. case VT_BSTR:
  401. ReadMemory((ULONG_PTR)pVar->m_value.pWStr,pwBuff,sizeof(pwBuff),0);
  402. pwBuff[sizeof(pwBuff)-1]=0;
  403. WideCharToMultiByte(CP_ACP,0,pwBuff,-1,pBuff,sizeof(pBuff),NULL,NULL);
  404. pBuff[sizeof(pBuff)-1]=0;
  405. dprintf("VT_BSTR %s\n",pBuff);
  406. break;
  407. /*
  408. FILETIME Time; // VT_FILETIME
  409. BLOB Blob; // VT_BLOB
  410. LPCLSID pClsId; // VT_CLSID
  411. IUnknown* pUnk; // VT_UNKNOWN
  412. IDispatch* pDisp; // VT_DISPATCH
  413. */
  414. case VT_EX_CVARVECTOR:
  415. //CVarVector *pVarVector; // VT_EX_CVARVECTOR
  416. dprintf("VT_EX_CVARVECTOR %08x\n",pVar->m_value.pVarVector);
  417. break;
  418. default:
  419. dprintf("m_vt %08x\n",pVar->m_vt);
  420. }
  421. } else {
  422. dprintf("invalid address %s\n",args);
  423. }
  424. }
  425. /*
  426. class POLARITY CVarVector
  427. {
  428. int m_nType;
  429. CFlexArray m_Array;
  430. int m_nStatus;
  431. */
  432. LPSTR g_QualStrings[] = {
  433. "", // nothing for index 0
  434. "key",
  435. "",
  436. "read",
  437. "write",
  438. "volatile",
  439. "provider",
  440. "dynamic",
  441. "cimwin32",
  442. "DWORD",
  443. "CIMTYPE"
  444. };
  445. DWORD g_ValLengths[128] =
  446. {
  447. /* 0*/ 0, 0, 2, 4, 4, 8, 0, 0, 4, 0,
  448. /*10*/ 0, 2, 0, 4, 0, 0, 1, 1, 2, 4,
  449. /*20*/ 8, 8, 0, 0, 0, 0, 0, 0, 0, 0,
  450. /*30*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  451. /*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  452. /*50*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  453. /*60*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  454. /*70*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  455. /*80*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  456. /*90*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  457. /*100*/0, 4, 4, 2, 0, 0, 0, 0, 0, 0,
  458. /*110*/0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  459. /*120*/0, 0, 0, 0, 0, 0, 0, 0
  460. };
  461. int lstrlenWunal( WCHAR UNALIGNED * pStr)
  462. {
  463. int ret = 0;
  464. while (*pStr++) ret++;
  465. return ret;
  466. };
  467. VOID
  468. ParseBlob(BYTE * pMemOrg,ULONG_PTR Addr)
  469. {
  470. DWORD ClassPartLength = 0;
  471. DWORD i;
  472. BYTE * pMem = pMemOrg;
  473. BYTE Flags;
  474. BOOL IsInstance = FALSE;
  475. BOOL SkipDecoration = TRUE;
  476. BYTE BFlags = *pMem;
  477. pMem++;
  478. if (OBJECT_FLAG_CLASS & BFlags )
  479. {
  480. dprintf("CLASS\n");
  481. }
  482. if (OBJECT_FLAG_INSTANCE & BFlags )
  483. {
  484. dprintf("INSTANCE\n");
  485. IsInstance = TRUE;
  486. }
  487. if (OBJECT_FLAG_DECORATED & BFlags)
  488. {
  489. dprintf("DECORATED\n");
  490. }
  491. if (OBJECT_FLAG_LIMITED & BFlags)
  492. {
  493. dprintf("LIMITED\n");
  494. }
  495. if (OBJECT_FLAG_CLIENT_ONLY & BFlags)
  496. {
  497. dprintf("CLIENT_ONLY\n");
  498. }
  499. if (BFlags & OBJECT_FLAG_DECORATED)
  500. {
  501. SkipDecoration = FALSE;
  502. //dprintf("decoration:\n");
  503. Flags = *pMem;
  504. pMem++;
  505. if (Flags == STRING_FLAG_UNICODE)
  506. {
  507. dprintf("SERVER : %S\n",pMem);
  508. pMem+=(1+2*lstrlenWunal((WCHAR UNALIGNED *)pMem));
  509. }
  510. else
  511. {
  512. dprintf("SERVER : %s\n",pMem);
  513. pMem+=(1+lstrlenA((CHAR *)pMem));
  514. }
  515. Flags = *pMem;
  516. pMem++;
  517. if (Flags == STRING_FLAG_UNICODE)
  518. {
  519. dprintf("namespace: %S\n",pMem);
  520. pMem+=(1+2*lstrlenWunal((WCHAR UNALIGNED *)pMem));
  521. }
  522. else
  523. {
  524. dprintf("NAMESPACE: %s\n",pMem);
  525. pMem+=(1+lstrlenA((CHAR *)pMem));
  526. }
  527. };
  528. ClassPartLength = *((DWORD UNALIGNED *)pMem);
  529. pMem += sizeof(DWORD);
  530. BYTE Unused = *pMem;
  531. pMem++;
  532. DWORD HeapPtrName = *((DWORD UNALIGNED *)pMem);
  533. pMem += sizeof(DWORD);
  534. DWORD NullDefaultSize = *((DWORD UNALIGNED *)pMem);
  535. pMem += sizeof(DWORD);
  536. DWORD DerivationSize = *((DWORD UNALIGNED *)pMem);
  537. DerivationSize &= 0xFFFF;
  538. //dprintf("D %08x\n",DerivationSize);
  539. DWORD QualSetSize = *((DWORD UNALIGNED *)(pMem+DerivationSize));
  540. //dprintf("Q %08x\n",QualSetSize);
  541. QualSetSize &= 0xFFFF;
  542. DWORD NumProps = *((DWORD UNALIGNED *)(pMem+DerivationSize+QualSetSize));
  543. DWORD UNALIGNED * pPropLookup = (DWORD UNALIGNED *)(pMem+DerivationSize+QualSetSize+sizeof(DWORD));
  544. BYTE * pPropLookup_OOP = (BYTE *)Addr + (pMem - pMemOrg) + DerivationSize+QualSetSize;
  545. BYTE * HeapPtr = pMem + DerivationSize + QualSetSize + sizeof(DWORD) + NumProps*(2*sizeof(DWORD)) + NullDefaultSize;
  546. BYTE * HeapPtr_OOP = (BYTE *)Addr + (pMem - pMemOrg) + DerivationSize + QualSetSize + sizeof(DWORD) + NumProps*(2*sizeof(DWORD)) + NullDefaultSize;
  547. //dprintf("CPLen %p N %p D %p Q %p Prop %p Heap %p\n",
  548. // ClassPartLength,
  549. // NullDefaultSize,
  550. // DerivationSize,QualSetSize,NumProps,*((DWORD UNALIGNED *)HeapPtr));
  551. dprintf(" class_and_method\n");
  552. dprintf(" class_Part\n");
  553. if (0xFFFFFFFF != HeapPtrName)
  554. {
  555. BYTE * pName = HeapPtr + sizeof(DWORD) + HeapPtrName;
  556. Flags = *pName;
  557. pName++;
  558. if (Flags == STRING_FLAG_UNICODE)
  559. {
  560. dprintf(" class : %S\n",pName);
  561. }
  562. else
  563. {
  564. dprintf(" class : %s\n",pName);
  565. }
  566. }
  567. else
  568. {
  569. dprintf(" class : %08x\n",HeapPtrName);
  570. }
  571. // QualSet
  572. dprintf(" qualifierset %p\n",Addr+(pMem + DerivationSize - pMemOrg));
  573. ULONG_PTR pEndQualSet = (ULONG_PTR)pMem + DerivationSize + QualSetSize;
  574. BYTE * pQualSet = pMem + DerivationSize + sizeof(DWORD);
  575. //dprintf(" %p %p\n",pQualSet,pEndQualSet);
  576. while((ULONG_PTR)pQualSet < pEndQualSet)
  577. {
  578. DWORD dwHeapPtr = (*((DWORD UNALIGNED *)pQualSet));
  579. pQualSet += sizeof(DWORD);
  580. BYTE Flavor = *pQualSet;
  581. pQualSet += sizeof(BYTE);
  582. DWORD Type = (*((DWORD UNALIGNED *)pQualSet));
  583. pQualSet += sizeof(DWORD);
  584. BYTE * pData = pQualSet;
  585. pQualSet += g_ValLengths[Type&0x7F];
  586. if (dwHeapPtr & 0x80000000)
  587. {
  588. dprintf(" %s %02x %08x %p\n",g_QualStrings[dwHeapPtr&0x7fffffff],Flavor,Type,*(DWORD UNALIGNED *)pData);
  589. }
  590. else
  591. {
  592. dprintf(" %s %02x %08x %p\n",HeapPtr+dwHeapPtr+1+sizeof(DWORD),Flavor,Type,*(DWORD UNALIGNED *)pData);
  593. }
  594. if (CheckControlC())
  595. break;
  596. }
  597. // property lookup table
  598. dprintf(" propertylookup %p\n",pPropLookup_OOP);
  599. for (i=0;i<NumProps;i++)
  600. {
  601. WORD UNALIGNED * pPropInfo = (WORD UNALIGNED *)(HeapPtr+sizeof(DWORD)+pPropLookup[1]);
  602. dprintf(" %08x %08x %s %08x %04x %08x %08x\n",
  603. pPropLookup[0],pPropLookup[1],
  604. HeapPtr+pPropLookup[0]+1+sizeof(DWORD),
  605. *((DWORD UNALIGNED *)pPropInfo),
  606. *(pPropInfo+2),
  607. *(DWORD UNALIGNED *)(pPropInfo+3),
  608. *(DWORD UNALIGNED *)(pPropInfo+5));
  609. pPropLookup += 2;
  610. }
  611. DWORD dwHeapSize_ClassPart = (*((DWORD UNALIGNED *)HeapPtr))&0x7FFFFFFF;
  612. dprintf(" Heap %p size %08x\n",HeapPtr_OOP,dwHeapSize_ClassPart);
  613. dprintf(" method_Part\n");
  614. BYTE * pMethodPart = HeapPtr + sizeof(DWORD) + dwHeapSize_ClassPart;
  615. BYTE * pMethodPart_OOP = HeapPtr_OOP + sizeof(DWORD) + dwHeapSize_ClassPart;
  616. DWORD dwSizeMethodPart = *((DWORD UNALIGNED *)pMethodPart);
  617. DWORD NumMethods = *((DWORD UNALIGNED *)(pMethodPart+sizeof(DWORD)));
  618. BYTE * pMethodDescription= pMethodPart + 2*sizeof(DWORD);
  619. BYTE * pMethodDescription_OOP = pMethodPart_OOP + 2*sizeof(DWORD);
  620. //BYTE * pHeapMethod_OOP = ;
  621. dprintf(" num_methods : %08x\n",NumMethods);
  622. dprintf(" methods_descr : %p\n",pMethodDescription_OOP);
  623. //dprintf(" heap : %p\n");
  624. BYTE * pCombinedPart = pMethodPart + dwSizeMethodPart;
  625. BYTE * pCombinedPart_OOP = pMethodPart_OOP + dwSizeMethodPart;
  626. if (IsInstance)
  627. {
  628. dprintf(" instance\n");
  629. DWORD dwHeapSize = 4 + (*((DWORD UNALIGNED *)HeapPtr)) & 0x7fffffff;
  630. //BYTE * HeapPtr_OOP
  631. BYTE * pInstancePart = HeapPtr+dwHeapSize;
  632. BYTE * pInstancePart_OOP = HeapPtr_OOP+dwHeapSize;
  633. DWORD dwSize = *((DWORD UNALIGNED *)pInstancePart);
  634. pInstancePart += sizeof(DWORD);
  635. BYTE IFlag = *pInstancePart;
  636. pInstancePart++;
  637. DWORD dwClassNameOffset = *((DWORD UNALIGNED *)pInstancePart);
  638. pInstancePart += sizeof(DWORD);
  639. BYTE * pDataTable = pInstancePart;
  640. BYTE * pDataTable_OOP = pInstancePart_OOP + 2*sizeof(DWORD) + sizeof(BYTE);
  641. DWORD NumBytedNullNess = ((NumProps*2)%8)?(1+((NumProps*2)/8)):((NumProps*2)/8);
  642. BYTE * pDataTableData = pInstancePart + NumBytedNullNess;
  643. BYTE * pDataTableData_OOP = pDataTable_OOP + NumBytedNullNess;
  644. pInstancePart += NullDefaultSize; // this is crucial
  645. BYTE * pQualSet = pInstancePart;
  646. BYTE * pQualSet_OOP = pDataTable_OOP + NullDefaultSize;
  647. DWORD dwQualSetSize = *((DWORD UNALIGNED *)pQualSet);
  648. pInstancePart += dwQualSetSize;
  649. BYTE * pQualSetList = pInstancePart;
  650. BYTE * pInstanceHeap;
  651. BYTE * pInstanceHeap_OOP;
  652. if (0x01 == *pQualSetList)
  653. {
  654. // empty qual set OK
  655. pInstancePart++;
  656. pInstanceHeap = pInstancePart;
  657. pInstanceHeap_OOP = pQualSet_OOP+dwQualSetSize+sizeof(BYTE);
  658. }
  659. else if (0x02 == *pQualSetList)
  660. {
  661. // multiple qualifier set
  662. dprintf("unimplemented");
  663. return;
  664. }
  665. else
  666. {
  667. // invalid qualset
  668. }
  669. //NullDefaultSize
  670. dprintf(" begin %p\n",pInstancePart_OOP);
  671. dprintf(" data_table: null %p data %p\n",pDataTable_OOP,pDataTableData_OOP);
  672. dprintf(" qual_set %p\n",pQualSet_OOP);
  673. dprintf(" heap %p\n",pInstanceHeap_OOP);
  674. }
  675. else
  676. {
  677. dprintf(" class_and_method\n");
  678. dprintf(" start : %p\n",pCombinedPart_OOP);
  679. }
  680. }
  681. DECLARE_API(blob)
  682. {
  683. INIT_API();
  684. char * pArgs = (char *)_alloca(strlen(args)+1);
  685. lstrcpy(pArgs,args);
  686. ULONG_PTR pByte = 0;
  687. ULONG_PTR Size = 0;
  688. while (isspace(*pArgs)) pArgs++;
  689. char * pAddress = pArgs;
  690. //dprintf("%s %s\n",pAddress,pArgs);
  691. // skip good chars
  692. while(*pArgs && !isspace(*pArgs)) pArgs++;
  693. if(*pArgs) // if there are more chars
  694. {
  695. *pArgs = 0; //terminate string
  696. pArgs++;
  697. // skip spaces
  698. while(isspace(*pArgs)) pArgs++;
  699. if (*pArgs)
  700. {
  701. //dprintf("%s\n",pArgs);
  702. Size = GetExpression(pArgs);
  703. }
  704. }
  705. pByte = GetExpression(pAddress);
  706. if (pByte)
  707. {
  708. if (Size)
  709. {
  710. BYTE * pHereMem = (BYTE *)HeapAlloc(GetProcessHeap(),0,Size*2);
  711. if (ReadMemory(pByte,pHereMem,Size*2,0))
  712. {
  713. //dprintf(" object @ %p size %x\n",pByte,Size);
  714. ParseBlob(pHereMem,pByte);
  715. }
  716. else
  717. {
  718. dprintf("RM %p\n",pByte);
  719. }
  720. HeapFree(GetProcessHeap(),0,pHereMem);
  721. }
  722. else
  723. {
  724. HEAP_ENTRY HeapEntry;
  725. if (ReadMemory(pByte-(sizeof(HEAP_ENTRY)),&HeapEntry,sizeof(HEAP_ENTRY),0))
  726. {
  727. Size = HeapEntry.Size*sizeof(HEAP_ENTRY);
  728. BYTE * pHereMem = (BYTE *)HeapAlloc(GetProcessHeap(),0,Size);
  729. if (ReadMemory(pByte,pHereMem,Size,0))
  730. {
  731. ParseBlob(pHereMem,pByte);
  732. }
  733. else
  734. {
  735. dprintf("RM %p\n",pByte);
  736. }
  737. HeapFree(GetProcessHeap(),0,pHereMem);
  738. }
  739. else
  740. {
  741. dprintf("RM %p\n",pByte);
  742. }
  743. }
  744. }
  745. }
  746. DECLARE_API(datap)
  747. {
  748. INIT_API();
  749. ULONG_PTR Addr = GetExpression(args);
  750. if (Addr)
  751. {
  752. DWORD dwSize = 256; // and let's hope
  753. //sizeof(WBEM_DATAPACKET_HEADER) +
  754. //sizeof(WBEM_DATAPACKET_SMARTENUM_NEXT) +
  755. //sizeof(WBEM_DATAPACKET_OBJECT_ARRAY) +
  756. //sizeof(WBEM_DATAPACKET_OBJECT_HEADER);
  757. WBEM_DATAPACKET_HEADER * pData = (WBEM_DATAPACKET_HEADER *)_alloca(dwSize);
  758. if (ReadMemory(Addr,pData,dwSize,NULL))
  759. {
  760. dprintf(" Order %08x\n",pData->dwByteOrdering);
  761. dprintf(" Header %08x DSize %08x Flags %08x %02x ",
  762. pData->dwSizeOfHeader,
  763. pData->dwDataSize,
  764. pData->dwFlags,
  765. pData->bVersion);
  766. switch(pData->bPacketType)
  767. {
  768. case WBEM_DATAPACKETTYPE_OBJECTSINK_INDICATE:
  769. {
  770. dprintf("WBEM_DATAPACKETTYPE_OBJECTSINK_INDICATE\n");
  771. WBEM_DATAPACKET_OBJECTSINK_INDICATE UNALIGNED * pIndicate = (WBEM_DATAPACKET_OBJECTSINK_INDICATE UNALIGNED *)((BYTE *)pData + pData->dwSizeOfHeader);
  772. dprintf(" Header %08x Size %08x\n",pIndicate->dwSizeOfHeader,pIndicate->dwDataSize);
  773. WBEM_DATAPACKET_OBJECT_ARRAY UNALIGNED * pArrayPacket = (WBEM_DATAPACKET_OBJECT_ARRAY UNALIGNED *)((BYTE * )pIndicate+pIndicate->dwSizeOfHeader);
  774. dprintf(" Header %08x Size %08x NumObj %08x\n",
  775. pArrayPacket->dwSizeOfHeader,
  776. pArrayPacket->dwDataSize,
  777. pArrayPacket->dwNumObjects);
  778. WBEM_DATAPACKET_OBJECT_HEADER UNALIGNED * pObjHeader = (WBEM_DATAPACKET_OBJECT_HEADER UNALIGNED *)((BYTE*)pArrayPacket+pArrayPacket->dwSizeOfHeader);
  779. dprintf(" Header %08x dwSizeOfData %08x bObjectType ",pObjHeader->dwSizeOfHeader,pObjHeader->dwSizeOfData);
  780. switch(pObjHeader->bObjectType)
  781. {
  782. case WBEMOBJECT_NONE:
  783. dprintf("WBEMOBJECT_NONE\n");
  784. break;
  785. case WBEMOBJECT_CLASS_FULL:
  786. dprintf("WBEMOBJECT_CLASS_FULL\n");
  787. break;
  788. case WBEMOBJECT_INSTANCE_FULL:
  789. dprintf("WBEMOBJECT_INSTANCE_FULL\n");
  790. break;
  791. case WBEMOBJECT_INSTANCE_NOCLASS:
  792. dprintf("WBEMOBJECT_INSTANCE_NOCLASS\n");
  793. break;
  794. };
  795. dprintf(" data: %p\n",Addr+pData->dwSizeOfHeader+pIndicate->dwSizeOfHeader+pArrayPacket->dwSizeOfHeader+pObjHeader->dwSizeOfHeader);
  796. }
  797. break;
  798. case WBEM_DATAPACKETTYPE_SMARTENUM_NEXT:
  799. {
  800. dprintf("WBEM_DATAPACKETTYPE_SMARTENUM_NEXT\n");
  801. WBEM_DATAPACKET_SMARTENUM_NEXT UNALIGNED * pSNext = (WBEM_DATAPACKET_SMARTENUM_NEXT UNALIGNED *)((BYTE *)pData + pData->dwSizeOfHeader);
  802. dprintf(" Header %08x dwDataSize %08x\n",pSNext->dwSizeOfHeader,pSNext->dwDataSize);
  803. WBEM_DATAPACKET_OBJECT_ARRAY UNALIGNED * pArrayPacket = (WBEM_DATAPACKET_OBJECT_ARRAY UNALIGNED *)((BYTE * )pSNext+pSNext->dwSizeOfHeader);
  804. dprintf(" Header %08x Size %08x NumObj %08x\n",
  805. pArrayPacket->dwSizeOfHeader,
  806. pArrayPacket->dwDataSize,
  807. pArrayPacket->dwNumObjects);
  808. WBEM_DATAPACKET_OBJECT_HEADER UNALIGNED * pObjHeader = (WBEM_DATAPACKET_OBJECT_HEADER UNALIGNED *)((BYTE*)pArrayPacket+pArrayPacket->dwSizeOfHeader);
  809. dprintf(" Header %08x dwSizeOfData %08x bObjectType ",pObjHeader->dwSizeOfHeader,pObjHeader->dwSizeOfData);
  810. switch(pObjHeader->bObjectType)
  811. {
  812. case WBEMOBJECT_NONE:
  813. dprintf("WBEMOBJECT_NONE\n");
  814. break;
  815. case WBEMOBJECT_CLASS_FULL:
  816. dprintf("WBEMOBJECT_CLASS_FULL\n");
  817. break;
  818. case WBEMOBJECT_INSTANCE_FULL:
  819. dprintf("WBEMOBJECT_INSTANCE_FULL\n");
  820. break;
  821. case WBEMOBJECT_INSTANCE_NOCLASS:
  822. dprintf("WBEMOBJECT_INSTANCE_NOCLASS\n");
  823. break;
  824. };
  825. dprintf(" data: %p\n",Addr+pData->dwSizeOfHeader+pSNext->dwSizeOfHeader+pArrayPacket->dwSizeOfHeader+pObjHeader->dwSizeOfHeader);
  826. }
  827. break;
  828. case WBEM_DATAPACKETTYPE_UNBOUNDSINK_INDICATE:
  829. {
  830. dprintf("WBEM_DATAPACKETTYPE_UNBOUNDSINK_INDICATE\n");
  831. WBEM_DATAPACKET_UNBOUNDSINK_INDICATE UNALIGNED * pUnBoundI = (WBEM_DATAPACKET_UNBOUNDSINK_INDICATE UNALIGNED *)((BYTE *)pData + pData->dwSizeOfHeader);
  832. dprintf(" Header %08x dwDataSize %08x dwLogicalConsumerSize %08x\n",pUnBoundI->dwSizeOfHeader,pUnBoundI->dwDataSize,pUnBoundI->dwLogicalConsumerSize);
  833. }
  834. break;
  835. case WBEM_DATAPACKETTYPE_MULTITARGET_DELIVEREVENT:
  836. {
  837. dprintf("WBEM_DATAPACKETTYPE_MULTITARGET_DELIVEREVENT\n");
  838. WBEM_DATAPACKET_MULTITARGET_DELIVEREVENT UNALIGNED * pMultiTgtEvt = (WBEM_DATAPACKET_MULTITARGET_DELIVEREVENT UNALIGNED *)((BYTE*)pData + pData->dwSizeOfHeader);
  839. dprintf(" Header %08x dwDataSize %08x\n",pMultiTgtEvt->dwSizeOfHeader,pMultiTgtEvt->dwDataSize);
  840. WBEM_DATAPACKET_OBJECT_ARRAY UNALIGNED * pArrayPacket = (WBEM_DATAPACKET_OBJECT_ARRAY UNALIGNED *)((BYTE * )pMultiTgtEvt+pMultiTgtEvt->dwSizeOfHeader);
  841. dprintf(" Header %08x Size %08x NumObj %08x\n",
  842. pArrayPacket->dwSizeOfHeader,
  843. pArrayPacket->dwDataSize,
  844. pArrayPacket->dwNumObjects);
  845. WBEM_DATAPACKET_OBJECT_HEADER UNALIGNED * pObjHeader = (WBEM_DATAPACKET_OBJECT_HEADER UNALIGNED *)((BYTE*)pArrayPacket+pArrayPacket->dwSizeOfHeader);
  846. dprintf(" Header %08x dwSizeOfData %08x bObjectType ",pObjHeader->dwSizeOfHeader,pObjHeader->dwSizeOfData);
  847. switch(pObjHeader->bObjectType)
  848. {
  849. case WBEMOBJECT_NONE:
  850. dprintf("WBEMOBJECT_NONE\n");
  851. break;
  852. case WBEMOBJECT_CLASS_FULL:
  853. dprintf("WBEMOBJECT_CLASS_FULL\n");
  854. break;
  855. case WBEMOBJECT_INSTANCE_FULL:
  856. dprintf("WBEMOBJECT_INSTANCE_FULL\n");
  857. break;
  858. case WBEMOBJECT_INSTANCE_NOCLASS:
  859. dprintf("WBEMOBJECT_INSTANCE_NOCLASS\n");
  860. break;
  861. };
  862. }
  863. break;
  864. case WBEM_DATAPACKETTYPE_LAST:
  865. dprintf("WBEM_DATAPACKETTYPE_LAST\n");
  866. break;
  867. }
  868. }
  869. else
  870. {
  871. dprintf("RM %p\n",Addr);
  872. }
  873. }
  874. else
  875. {
  876. dprintf("unable to resolve %s\n",args);
  877. }
  878. }