Native C++ Module Example not working as advertised

Smith, Roland 40 Reputation points
2023-12-21T19:21:00.9366667+00:00

I created a module based on this example. It is supposed to add an entry in the Event Log when the OnExecuteRequestHandler and OnPostExecuteRequestHandler events occur on a request.

https://learn.microsoft.com/en-us/iis/web-development-reference/native-code-api-reference/chttpmodule-onexecuterequesthandler-method

I'm getting the OnPostExecuteRequestHandler entry for all requests, not just the mapped file extension. The OnExecuteRequestHandler entry never appears.

The end goal is to perform some processing only on a request for a particular file extension.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,929 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Smith, Roland 40 Reputation points
    2023-12-21T19:43:21.1733333+00:00

    I changed resourceType from File to Unspecified. At first I thought it was working but it is still not working correctly.

    0 comments No comments

  2. Bruce (SqlWork.com) 75,386 Reputation points Moderator
    2023-12-25T18:06:44.5433333+00:00

    Most likely it does not have access to the registry.


  3. Smith, Roland 40 Reputation points
    2024-02-14T13:30:09.6566667+00:00

    It is working, I don't know what I changed that fixed it.

    0 comments No comments

  4. Roland Smith 1 Reputation point
    2024-02-19T00:55:58.7033333+00:00

    My module is working now, I'm not sure exactly what was wrong. I guess that OnExecuteRequestHandler wasn't defined correctly.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.