You can use this support function to retrieve special IIS properties defined in SF_PROPERTY_IIS.
BOOL WINAPI * ServerSupportFunction(
PHTTP_FILTER_CONTEXT pfc,
enum SF_REQ_TYPE SF_REQ_GET_PROPERTY,
PVOID pData,
DWORD ul1,
DWORD ul2
);
The only valid value for ul1 is SF_PROPERTY_INSTANCE_NUM_ID. Your ISAPI filter can use this property to discover the server instance number for the current request. This information could then be used to access the metabase, for example. Note that if your ISAPI filter calls this support function before the preproc headers event, IIS will not yet know which server instance is handling the request, and pData will be set to NULL.