Webservices API Layer |
Windows Webservices API (WWSAPI) Verification Layer
The WWSAPI plug-in allows developers to catch instances of:
1) A WWSAPI being called which references an invalid intrinsic WWSAPI object.
2) A WWSAPI being called which references a single threaded object already in use.
3) An intrinsic object freed with an asynchronous call pending.
4) Calling blocking APIs from short threads.
Additionally, this plug-in:
5) Tracks the use of objects from instantiation to deletion.
6) Force calls that can be completed asynchronously to be completed synchronously. This is to prevent applications depending on a particular behavior from a call taking a WS_ASYNC_CONTEXT.
7) Provides a human readable description when an API is passed a bad object, or an object is in use using the !avrf �ws �obj debugger extension (shown below)
8) For channel, service proxy and service host, each call tracked will show the current state of the object.
By default, the following checkers are enabled:
Property NameDescriptionValidateObjectValidates that the intrinsic object is validTrackObjectTracks the use of an object through its lifetime
Other checkers that can be enabled in this provider through the properties UI are:
Property NameDescriptionCheckTimeoutValidates that async functions are completed within the timeout (specified as TimeoutValForceSyncForce the sync path to be taken when a WS_ASYNC_CONTEXT context is supplied to an API.
A debugger extension is provided (!avrf �ws �obj) which displays opened and closed intrinsic WWSAPI objects. If this extension is suffixed by an object, it will display verbose information about the usage of this object.
!avrf -ws �obj
This command displays the intrinsic WWSAPI objects which are being tracked, both created and closed. Note that the closed objects are stored in a circular queue, so there is a ceiling to the total number of objects tracked.
Objects are added when the following APIs successfully complete: WsCreateChannel(), WsCreateChannelForListener(), WsCreateServiceHost(), WsCreateServiceProxy(), WsCreateServiceProxyFromTemplate(), WsCreateError(), WsCreateHeap(), WsCreateListener(), WsCreateMetadata(), WsCreateMessage(), WsCreateMessageForChannel(), WsCreateReader(), WsCreateWriter(), WsCreateXmlBuffer(), WsReadXmlBuffer(), WsReadXmlBufferFromBytes()
Objects are moved from the created to the freed list when the corresponding WsFree*() function is called and completes.
!avrf �ws �obj [OBJECT]
This command displays the usage of an intrinsic WWSAPI object. The usage information includes the stack when the object was created, used and freed. If the object is a channel, service host or service proxy, it will display the state of the object prior to the API using the object is called.
Here is an example of the !avrf �ws �obj usage options:
� | Copy Code |
---|---|
0:001> !avrf -ws -obj Objects dependent on internal objects allocated: Objects currently allocated: 0x00000000048566C0 (Type=Heap, Thread=0x000001bc, Pending Operations=0) 0x0000000001BE6780 (Type=Error, Thread=0x000001bc, Pending Operations=0) 0x0000000001C13580 (Type=Service Proxy, Thread=0x000001bc, Pending Operations=0) Freed objects: 0x0000000001C17170 (Type=Service Proxy, Thread=0x000001bc) 0x0000000004856730 (Type=Heap, Thread=0x000001bc) 0x0000000001BE6820 (Type=Error, Thread=0x000001bc) 0:001> !avrf -ws -obj 0x0000000001C13580 Object @ 0x0000000001C13580 Type = Service Proxy Thread = 0x000001bc Internal Reference = 0x00000000026C5E80 Created stack: vfnws!VfHookWsCreateServiceProxy+0x00aa BLUESTONE!WST_WebServices::WsCreateServiceProxy+0x00d8 BLUESTONE!ServiceProxy::Connect+0x0116 BLUESTONE!ServiceModel_SimpleTest::SimpleClient+0x0607 BLUESTONE!ServiceModelTestGroup_Simple_Test02_Run+0x0041 BLUESTONE!Fnshell2::FnshellConfiguration::RunTest+0x002e BLUESTONE!Fnshell2::TESTCASE::Run+0x00d6 BLUESTONE!fnsMsgProc+0x02d6 BLUESTONE!fnsRunTestsWorkerThread+0x085f KERNEL32!BaseThreadInitThunk+0x000d ntdll!RtlUserThreadStart+0x001d Last 4 operations Operation #1 created in thread 0x00000000000001BC Service proxy state before operation = Created Callstack: vfnws!VfHookWsGetServiceProxyProperty+0x0053 BLUESTONE!WST_WebServices::WsGetServiceProxyProperty+0x009b BLUESTONE!ServiceProxy::GetState+0x004b BLUESTONE!ServiceProxy::VerifyState+0x001c BLUESTONE!ServiceProxy::Connect+0x01c7 BLUESTONE!ServiceModel_SimpleTest::SimpleClient+0x0607 BLUESTONE!ServiceModelTestGroup_Simple_Test02_Run+0x0041 BLUESTONE!Fnshell2::FnshellConfiguration::RunTest+0x002e BLUESTONE!Fnshell2::TESTCASE::Run+0x00d6 BLUESTONE!fnsMsgProc+0x02d6 BLUESTONE!fnsRunTestsWorkerThread+0x085f KERNEL32!BaseThreadInitThunk+0x000d ntdll!RtlUserThreadStart+0x001d Operation #2 created in thread 0x00000000000001BC Service proxy state before operation = Created Callstack: vfnws!VfHookWsOpenServiceProxy+0x0079 BLUESTONE!WST_WebServices::WsOpenServiceProxy+0x0092 BLUESTONE!ServiceProxy::Connect+0x03d3 BLUESTONE!ServiceModel_SimpleTest::SimpleClient+0x0607 BLUESTONE!ServiceModelTestGroup_Simple_Test02_Run+0x0041 BLUESTONE!Fnshell2::FnshellConfiguration::RunTest+0x002e BLUESTONE!Fnshell2::TESTCASE::Run+0x00d6 BLUESTONE!fnsMsgProc+0x02d6 BLUESTONE!fnsRunTestsWorkerThread+0x085f KERNEL32!BaseThreadInitThunk+0x000d ntdll!RtlUserThreadStart+0x001d Operation #3 created in thread 0x00000000000001BC Service proxy state before operation = Open Callstack: vfnws!VfHookWsGetServiceProxyProperty+0x0053 BLUESTONE!WST_WebServices::WsGetServiceProxyProperty+0x009b BLUESTONE!ServiceProxy::GetState+0x004b BLUESTONE!ServiceProxy::VerifyState+0x001c BLUESTONE!ServiceProxy::Connect+0x0484 BLUESTONE!ServiceModel_SimpleTest::SimpleClient+0x0607 BLUESTONE!ServiceModelTestGroup_Simple_Test02_Run+0x0041 BLUESTONE!Fnshell2::FnshellConfiguration::RunTest+0x002e BLUESTONE!Fnshell2::TESTCASE::Run+0x00d6 BLUESTONE!fnsMsgProc+0x02d6 BLUESTONE!fnsRunTestsWorkerThread+0x085f KERNEL32!BaseThreadInitThunk+0x000d ntdll!RtlUserThreadStart+0x001d Operation #4 created in thread 0x00000000000001BC Service proxy state before operation = Open Callstack: vfnws!VfHookWsCall+0x00a6 BLUESTONE!DefaultBinding_ICalculator_Add+0x008b BLUESTONE!ServiceModelTestGroup_Simple_Function+0x010a BLUESTONE!ServiceModel_SimpleTest::SimpleClient+0x069a BLUESTONE!ServiceModelTestGroup_Simple_Test02_Run+0x0041 BLUESTONE!Fnshell2::FnshellConfiguration::RunTest+0x002e BLUESTONE!Fnshell2::TESTCASE::Run+0x00d6 BLUESTONE!fnsMsgProc+0x02d6 BLUESTONE!fnsRunTestsWorkerThread+0x085f KERNEL32!BaseThreadInitThunk+0x000d ntdll!RtlUserThreadStart+0x001d Asynchronous Callback = BLUESTONE!ServiceModelTestGroup_Simple_Callback Asynchronous CallbackState = 0x0000000005EBDC30 Completed asynchronously with HRESULT=0x00000000 in thread 0x00000000000001BC Asynchronous callback stack: vfnws!VfHookWsCall+0x00e3 BLUESTONE!DefaultBinding_ICalculator_Add+0x008b BLUESTONE!ServiceModelTestGroup_Simple_Function+0x010a BLUESTONE!ServiceModel_SimpleTest::SimpleClient+0x069a BLUESTONE!ServiceModelTestGroup_Simple_Test02_Run+0x0041 BLUESTONE!Fnshell2::FnshellConfiguration::RunTest+0x002e BLUESTONE!Fnshell2::TESTCASE::Run+0x00d6 BLUESTONE!fnsMsgProc+0x02d6 BLUESTONE!fnsRunTestsWorkerThread+0x085f KERNEL32!BaseThreadInitThunk+0x000d ntdll!RtlUserThreadStart+0x001d Closed stack: 0:001> |