We are using FSHooks to hook the delete...
Articles and Tips: qna
01 May 2002
Q.
We are using FSHooks to hook the delete file event on Netware 5 and Netware 6 versions of NSS. From what we have read on Novell's web pages, NSS is backwards compatible with FSHooks. Though they seem to return the information back in a different order.
In the case of FSHOOK_POST_GEN_ERASEFILE, the traditional NetWare returned a volume number, dir base (to the parent of the deleted file) and then a path string (with the deleted file) and a path component count of 1. With the NSS stuff, we get a volume number, a dir base, a null path string and a patch component count of 0.
For opens, etc., we have dealt with this type of change. But in this case, when we try to get the path associated with the dir base, we get a 0x9C ERR_INVALID_PATH. This seems to be because we are trying to reference a file that has been deleted, where as previously we had the deleted file and the dir base referencing the parent. We are using FEMapVolumeAndDirectoryToPathForNS to try to get the path from the dir base, which is successful for the open and others.
A.
The only way I can think of a workaround would be to hook the FSHOOK_PRE_GEN_ERASEFILE, call FEMapVolumeAndDirectoryToPathForNS()on the dir base and store the result. With a successful POST hook, you would have the file information from the PRE hook. Since you can block in a PRE Hook, this should work.
Since you would be making the API call FEMapVolumeAndDirectoryToPathForNS(), which requires CLIB context within the hook, make sure to SetThreadGroupID().
* Originally published in Novell AppNotes
Disclaimer
The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.