Hiding Directories in Windows 95/98/ME
By Vinoj, December 01, 2001
You may need to protect specific Windows 9x directories from prying eyes, or you might want to limit directory access for multiple users of a single PC. Vinoj presents some utilities to set and manage the protection settings of your directories.
December 2001/Hiding Directories in Windows 95/98/ME
Example 1:
Hooking onto IFSMGR to monitor the file system
int _cdecl OurFileHook(pIFSFunc pfn, int nFunction, int nDrive, int nResources, int Cp, pioreq
pir)
{
int iRet;
unsigned long fHan;
DWORD pAction;
DWORD iLen;
iRet=0;
switch(nFunction){
case IFSFN_OPEN:
case IFSFN_FINDOPEN:
case IFSFN_RENAME:
case IFSFN_DELETE:
case IFSFN_DIR:
if((nDrive & 0xFF) != 0xFF){
FileNm[0]= nDrive + '@';
FileNm[1]=':';
iLen=2;
iLen+=UniToBCSPath(&FileNm[2],
pir->ir_ppath->pp_elements,
MAX_PATH, BCS_OEM);
}
else{
iLen=FormNetPath(FileNm, pir);
}
if(ComparePath(FileNm) == FALSE){
iRet=(*(*ppPrevHook))(pfn, nFunction, nDrive,
nResources, Cp, pir);
return iRet; //Do the normal work
}
else{
iRet = 5;
pir->ir_error = 5; //If the path is protected
//return "access denied"
return iRet;
}
}
iRet=(*(*ppPrevHook))(pfn, nFunction, nDrive, nResources, Cp, pir);
return iRet;
}