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 2:
Opening and reading of the Protector.dat file
DWORD _stdcall OpenAndReadFile(DWORD dwDDB, DWORD hDevice, LPDIOC lpDIOCParms)
{
PDWORD pdw;
int pAction=1; //Fail/Open
DWORD bRead;
int Error;
unsigned char *ProtFileTmp;
pdw = (PDWORD)lpDIOCParms->lpvOutBuffer;
ProtFileTmp = (unsigned char *) lpDIOCParms->lpvInBuffer;
strcpy(ProtectorFileName, ProtFileTmp);
if(R0_OpenCreateFile(FALSE, 0x0, 0, pAction, R0_NO_CACHE, ProtectorFileName,
&pHandle, &pAction))
return -1;
if(R0_GetFileSize(pHandle, &bRead))
return -1;
if(!(UsersAndPaths = HeapAllocateAsm(bRead+2, HEAPZEROINIT))){
R0_CloseFile(pHandle);
return -1;
}
if(R0_ReadFile(FALSE, pHandle, bRead, 0, UsersAndPaths, &bRead)){
R0_CloseFile(pHandle);
HeapFreeAsm(UsersAndPaths, 0);
return -1;
}
if(R0_CloseFile(pHandle))
return -1;
*(WORD *) (UsersAndPaths+bRead) = 0xFFFF;
Out_Debug_String("PROTECTOR: Memory allocated & File Opened!\n\r");
return(NO_ERROR);
}