Sorry for the delay in my response.
The mothod you are using is fine, but there is an easier way to debug your
provider. I'd write a small test application that can just load your
provider in-proc and query it. Do do this, simply instantiate function
discovery, create a query to your provider, then add the query constraint
that says to load your provider in-proc, and then finally execute your
query. It should look something like this
wprintf( L"CoCreate the Function Discovery object..." );
hr = CoCreateInstance(
__uuidof(FunctionDiscovery),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IFunctionDiscovery),
reinterpret_cast<void**>(&pFunDisc)
);
wprintf( L"0x%x\n", hr );
if ( S_OK == hr )
{
wprintf( L"Create an instance collection query..." );
hr = pFunDisc->CreateInstanceCollectionQuery(
L"<string representing your provider>",
NULL,
TRUE,
pFDCallback,
NULL,
&pFunInstsQuery
);
wprintf( L"0x%x\n", hr );
}
if ( S_OK == hr )
{
wprintf( L"Adding inproc constraint on the query..." );
hr = pFunInstsQuery->AddQueryConstraint(
FD_QUERYCONSTRAINT_COMCLSCONTEXT,
FD_CONSTRAINTVALUE_COMCLSCONTEXT_INPROC_SERVER
);
wprintf( L"0x%x\n", hr );
}
if ( S_OK == hr )
{
wprintf( L"Execute the query..." );
hr = pFunInstsQuery->Execute( &pFunInsts );
wprintf( L"0x%x\n", hr );
}
--
Ben McGregor
Software Development Engineer in Test
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2007 Microsoft Corporation. All rights
reserved.
Post by YokeI have been working with the FunctionDiscoveryProvider sample. Since most of
my development work has been in kernel-mode for the past several years, my
COM-based dev skills are a bit rusty. I have been successful by just
attaching the debugger to the FDProviderHostSample process after the Network
Explorer starts it up. I was just wondering if this was the right technique
to use or if there are other debug mechanisms built in for function discovery
providers.
Mike
Post by Ben McGregorHi Mike,
I'm unsure what level of detail you're looking for. Have you taken a look at
the SampleProvider that is provided in the SDK? Are you trying to run your
provider in-proc or out-of-proc? If you're running it in-proc you'd debug
it in the same process as your application using it. If it's out-of-proc
you'd need to debug the service that is hosting your provider.
You can grab the latest SDK from here.
--
Ben McGregor
Software Development Engineer in Test
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2007 Microsoft Corporation. All rights
reserved.
Post by YokeHow do you setup to debug a custom FD provider?
Mike