Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function is an application-defined function. The Web Server calls it when a notification event for which the filter has registered (in GetFilterVersion) occurs. ISAPI filters export this function so the Web Server service can pass information and control to the filters.

Note:
Registering ISAPI filters for raw data notifications (SF_NOTIFY_READ_RAW_DATA and SF_NOTIFY_SEND_RAW_DATA notification types) is deprecated. Applications should write ISAPI extensions to process and generate data that is sent to and from the Web Server.

Syntax

DWORD WINAPI HttpFilterProc(
  PHTTP_FILTER_CONTEXT
 pfc, 
  DWORD 
NotificationType, 
  VOID*
 pvNotification
);

Parameters

pfc

[in] Pointer to an HTTP_FILTER_CONTEXTstructure that is associated with the current, active HTTP transaction.

NotificationType

[in] Pointer to a bitmask that indicates the type of notification event that is being processed.

pvNotification

[in] Pointer to a notification-specific structure that contains additional information about the current context of the request. The following table shows the possible notification types and the corresponding structures.

Notification type Structure

SF_NOTIFY_READ_RAW_DATA

HTTP_FILTER_RAW_DATA

SF_NOTIFY_SEND_RAW_DATA

HTTP_FILTER_RAW_DATA

SF_NOTIFY_PREPROC_HEADERS

HTTP_FILTER_PREPROC_HEADERS

SF_NOTIFY_AUTHENTICATION

HTTP_FILTER_AUTHENT

SF_NOTIFY_URL_MAP

HTTP_FILTER_URL_MAP

SF_NOTIFY_LOG

HTTP_FILTER_LOG

SF_NOTIFY_ACCESS_DENIED

HTTP_FILTER_ACCESS_DENIED

SF_NOTIFY_SEND_RESPONSE

HTTP_FILTER_SEND_RESPONSE

Return Value

Returns a DWORDstatus code that indicates how the application handled the event. The following table shows the possible return values.

Return value Description

SF_STATUS_REQ_FINISHED

The filter has handled the HTTP request. The server should disconnect the session.

SF_STATUS_REQ_FINISHED_KEEP_CONN

Treated the same as SF_STATUS_REQ_FINISHED. After this notification is received, the connection is closed.

SF_STATUS_REQ_NEXT_NOTIFICATION

The next filter in the notification chain should be called.

SF_STATUS_REQ_HANDLED_NOTIFICATION

This filter handled the notification. No other handlers should be called for this particular notification type.

SF_STATUS_REQ_ERROR

An error occurred. The server should call GetLastErrorand indicate the error to the client. The HTTP request will generally be aborted when this status is returned. The client should call SetLastErrorwith the nature of the failure.

Remarks

This function usually serves as the dispatch for a Web (ISAPI) filter. Separate functions are often created to serve as handlers for the separate notifications, especially if the handling code is complicated.

Requirements

Header httpfilt.h
Library Developer Implemented
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2000 and later, Smartphone 2002 and later

See Also

Reference

GetFilterVersion

Other Resources

SetLastError