I want to change the physical path of certain URLs using the OnUrlMap handler of an ISAPI filter. I can do this by overwriting the contents of pMapInfo->pszPhysicalPath with the new physical path that I want. This works fine as long as the new path is equal or shorter in length to the old path. However, if the new path is longer than the old path, I can't simply overwrite the contents of pMapInfo->pszPhysicalPath.
I tried malloc-ing a new buffer and changing the value of pMapInfo->pszPhysicalPath to the new pointer, but the filter continues to use the physical path specified by the original buffer. I think the filter must already have a pointer to the original buffer and so does not know about the newly allocated buffer.
How can I change the physical path if the new path is longer than the old path?
I tried malloc-ing a new buffer and changing the value of pMapInfo->pszPhysicalPath to the new pointer, but the filter continues to use the physical path specified by the original buffer. I think the filter must already have a pointer to the original buffer and so does not know about the newly allocated buffer.
How can I change the physical path if the new path is longer than the old path?