Hi all,
Iam sending the string “C:\myfile.txt” from my application folder.Is it
correct to pass this string as a PWCSTR in RtlInitUnicodeString.But Iam
getting the createFile failed status.Please help me.
Thanks&Regards
sobana.D
Hi all,
Iam sending the string “C:\myfile.txt” from my application folder.Is it
correct to pass this string as a PWCSTR in RtlInitUnicodeString.But Iam
getting the createFile failed status.Please help me.
Thanks&Regards
sobana.D
Use “\\.\c:\myfile.txt”.
Cheers
Kiran
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Sobana
Sent: Wednesday, May 26, 2004 9:55 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] CreateFile
Hi all,
Iam sending the string “C:\myfile.txt” from my application folder.Is
it
correct to pass this string as a PWCSTR in RtlInitUnicodeString.But Iam
getting the createFile failed status.Please help me.
Thanks&Regards
sobana.D
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
… Try this sample… …
void OpenFileExample (void)
{
HANDLE hFile;
hFile = CreateFile (TEXT(“”\\?\c:\myfile.txt""),
GENERIC_READ, // Open for reading
FILE_SHARE_READ, // Share for reading
NULL, // No security
OPEN_ALWAYS, // Opens if exists else creates new file
FILE_ATTRIBUTE_NORMAL, // Normal file
NULL); // No template file
if (hFile == INVALID_HANDLE_VALUE)
{
// Your error-handling code goes here.
return;
}
} // End of OpenFileExample code
==================================
Regards
M.C.Krishnama Raju
-----Original Message-----
From: Krishnama Raju
Sent: Wednesday, May 26, 2004 10:26 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] CreateFile