Hi,Tony
Thanks for your reply. I tried the following code:
RtlInitUnicodeString(&testName, L"\??\UNC\172.21.12.17\test\test.txt");
InitializeObjectAttributes( &ObjectAttributes,
&testName,
OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE,
NULL,
NULL );
status = IoCreateFileSpecifyDeviceObjectHint(
&FileHandle, // File Handle
FILE_READ_ATTRIBUTES, // Desired Access
&ObjectAttributes, // Attributes
&IoStatus, // IO Status Block
NULL, // Allocation size
FILE_ATTRIBUTE_NORMAL, // File attributes
FILE_SHARE_DELETE,
FILE_OPEN, // Create disposition
FILE_NON_DIRECTORY_FILE, // Create options
NULL, // EA buffer
0, // EA size
CreateFileTypeNone, // CreateFileType
NULL, // Extra create parameters
IO_IGNORE_SHARE_ACCESS_CHECK,
DevExt->NLExtHeader.AttachedToDeviceObject // Device object to use for
open
);
/*
status = ZwCreateFile(
&FileHandle,
FILE_READ_ATTRIBUTES, // Desired Access
&ObjectAttributes, // Attributes
&IoStatus, // IO Status Block
NULL,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_DELETE,
FILE_OPEN,
FILE_NON_DIRECTORY_FILE ,
NULL,
0
);
*/
The return stutus = STATUS_INVALID_PARAMETER
I debug the DevExt->NLExtHeader.AttachedToDeviceObject,
it’s drivername “\FileSystem\MRxSmb”, so it is
\Device\LanmanRedirector,right?
If i use the zwcreate(), it return 0. And if i open the local drive file, it
works fine.
Do you know why?
Thanks
Ben
From: “Tony Mason”
>Reply-To: “Windows File Systems Devs Interest List”
>To: “Windows File Systems Devs Interest List”
>Subject: RE: [ntfsd] IoCreateFileSpecifyDeviceObjectHint can open the UNC
>files?
>Date: Wed, 22 Mar 2006 11:55:02 -0500
>
>By “it doesn’t work” I assume you mean it doesn’t compile, right? If
>that is not the case you might want to be more specific about what you
>mean.
>
>Also, what device object are you using as the hint? The name needs to
>be valid relative to that device object (although this wouldn’t make it
>not compile, this would make it not run properly.)
>
>Regards,
>
>Tony
>
>Tony Mason
>Consulting Partner
>OSR Open Systems Resources, Inc.
>http://www.osr.com
>
>
>Looking forward to seeing you at the next OSR File Systems class in
>Boston, MA April 18-21, 2006.
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of Bin Zeng
>Sent: Wednesday, March 22, 2006 10:59 AM
>To: ntfsd redirect
>Subject: [ntfsd] IoCreateFileSpecifyDeviceObjectHint can open the UNC
>files?
>
>Hi,All
>
>I tried to open the UNC file with the funtion
>IoCreateFileSpecifyDeviceObjectHint.
>It doesn’t work, but it works fine with zwcreate()
>
>I used the string as following:
>
>RtlInitUnicodeString(
>&testName,L"\Device\UNC\172.21.12.17\test\test.txt");
>
>Can IoCreateFileSpecifyDeviceObjectHint open the UNC files?
>
>Thanks
>
>Ben
>
>
>
>
>—
>Questions? First check the IFS FAQ at
>https://www.osronline.com/article.cfm?id=17
>
>You are currently subscribed to ntfsd as: xxxxx@osr.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>—
>Questions? First check the IFS FAQ at
>https://www.osronline.com/article.cfm?id=17
>
>You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
>To unsubscribe send a blank email to xxxxx@lists.osr.com