NtCreateFile and STATUS_OBJECT_PATH_NOT_FOUND (0x0000003A)
"Craig Edwards" <[email protected]>
| Newsgroups | gmane.linux.ports.xbox.devel |
|---|---|
| Organization | H.A. Enterprises Pty Ltd |
| Message-ID | <[email protected]> |
I am trying to port OpenXDK to compile under the GCC toolset, and have
made a great deal of progress but can't seem to figure out why I get the
error mentioned in the subject. I realise that this isn't strictly (or
even) related to xbox-linux, but I've been following this group for a
while and figure you guys are the reigning experts in calling the
xboxkrnl.exe APIs. Anyway, my code is listed below:
RtlInitAnsiString(&filename, "\\??\\C:\\BLAH.TXT");
debugPrint("Path="); debugPrint(filename.Buffer);
debugPrint("Length="); debugPrintNum(filename.Length);
debugPrint("MaxLength="); debugPrintNum(filename.MaximumLength);
Attributes.ObjectName = &filename;
Attributes.RootDirectory = NULL;
Attributes.Attributes = OBJ_CASE_INSENSITIVE;
ntStatus = NtCreateFile(
&FileHandle,
GENERIC_READ | SYNCHRONIZE,
&Attributes,
&Iosb,
0,
0,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
FILE_OPEN,
FILE_RANDOM_ACCESS | FILE_SYNCHRONOUS_IO_NONALERT
);
debugPrint("NtStatus="); debugPrintNum(ntStatus);
debugPrint("DosError="); debugPrintNum(RtlNtStatusToDosError(ntStatus));
debugPrint("Handle="); debugPrintNum((int)FileHandle);
This runs with the following output (debugPrint is a debug function that
writes to the video buffer in a small font so I can tell what is going on):
Path=\??\C:\BLAH.TXT
Length=0x0000000F
MaxLength=0x00000010
NtStatus=0x0000003A
DosError=0x00000003
Handle=0x00030FA0
I have tried myriads of different options (different drives (C:, D: and
F:), file names, flags, etc) but *always* get the same error. I know that
other calls to xboxkrnl.exe APIs work just fine (RtlXXX,
HalReturnToFirmware), and indeed, it seems to call NtCreateFile
successfully, but it seems to think it can't find the file. I've been
wrestling with this for days now; any advice or thoughts that anyone might
be able to provide would be greatly appreciated. Thanks a lot.
--
Craig Edwards
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com