CFFILE CabFile;
ULONG CabFileOffset = 0;
LARGE_INTEGER ByteOffset;
- WCHAR SourceBuffer[_MAX_PATH] = {L'\0'};
+ WCHAR SourceBuffer[MAX_PATH] = {L'\0'};
+ ULONG ReadCP;
if(KeGetCurrentIrql() != PASSIVE_LEVEL)
return STATUS_INVALID_DEVICE_STATE;
return(Status);
SourceName.Length = 0;
- SourceName.MaximumLength = _MAX_PATH * sizeof(WCHAR);
+ SourceName.MaximumLength = MAX_PATH * sizeof(WCHAR);
SourceName.Buffer = SourceBuffer;
Status = ZwQuerySymbolicLinkObject(Handle,
if(NT_SUCCESS(Status))
{
- if(!bFoundFile && (UINT32)atoi(FileName) == CodePage)
+ if(!bFoundFile)
{
- // We got the correct file.
- // Save the offset and loop through the rest of the file table to find the position, where the actual data starts.
- CabFileOffset = CabFile.FileOffset;
- bFoundFile = TRUE;
+ Status = RtlCharToInteger(FileName, 0, &ReadCP);
+ if (NT_SUCCESS(Status) && ReadCP == CodePage)
+ {
+ // We got the correct file.
+ // Save the offset and loop through the rest of the file table to find the position, where the actual data starts.
+ CabFileOffset = CabFile.FileOffset;
+ bFoundFile = TRUE;
+ }
}
ByteOffset.LowPart += strlen(FileName) + 1;