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 3: The user login routine
DWORD ChangeUser(DWORD dwDDB, DWORD hDevice, LPDIOC lpDIOCParms)
{
PDWORD pdw;
unsigned char *User, *Pass, *BufferTmp=UsersAndPaths;
unsigned char UserTmp[20], Password[20];
WORD Checksum=0, i, j;
BOOL Success = FALSE;
pdw = (PDWORD)lpDIOCParms->lpvInBuffer;
User = (char *) pdw[0];
Pass = (char *) pdw[1];
strcpy(UserTmp, User);
strcpy(Password, Pass);
for(i=0; i<strlen(Password); i++){
Checksum += Password[i];
}
while(*BufferTmp != 0xFF){
j=strlen(BufferTmp);
if(j == strlen(UserTmp)){
for(i=0;i<j;i++){
if((BufferTmp[i] & 0xDF) != (UserTmp[i] & 0xDF))
break;
}
if(i==j){
if(*(WORD *)(BufferTmp+j+1) == Checksum)
Success = TRUE;
else
Success = FALSE;
break;
}
}
else{
BufferTmp += j + 3; //Skip 0 & password
while(*(WORD *)(BufferTmp++)) //Search for word 0
;
BufferTmp++;
}
}
if(Success){
UserPathPtr = BufferTmp+j+3;
strcpy(LoggedUser, UserTmp);
return 0;
}
else
return -1;
}