<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 7/29/2013 18:02, Mislav Blazevic
wrote:<br>
</div>
<blockquote
cite="mid:CAH9-oXQdsk1DZNWdKso7PtgUipahcPVJQLq8syBeeQHubnd2sw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>First of all, pardon my ignorance, I am new to wine and
winapi.</div>
<div><br>
</div>
I am trying to implement apphelp.dll and I ran into issues with
NtCreateFile: It always returns 0xc0000103,
STATUS_NOT_A_DIRECTORY, and I am not sure what that means. Here
is code:
<div>
<br>
</div>
<div>/* This function is not in API, but written for internal
use */</div>
<div>
<div>HANDLE WINAPI SdbOpenFile( LPCWSTR path, PATH_TYPE type )</div>
<div>{</div>
<div><span style="white-space:pre"> </span><span
style="white-space:pre">/* SNIP */</span></div>
<div><span class="" style="white-space:pre"> </span>if (type
== DOS_PATH)</div>
<div><span class="" style="white-space:pre"> </span>if
(!RtlDosPathNameToNtPathName_U(path, &str, NULL, NULL))</div>
<div><span class="" style="white-space:pre"> </span>return
NULL;</div>
<div><span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre"> </span>InitializeObjectAttributes(&attr,
&str, OBJ_CASE_INSENSITIVE, NULL, NULL);</div>
<div><span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre"> </span>status =
NtCreateFile(&file, GENERIC_READ | SYNCHRONIZE |
FILE_READ_ATTRIBUTES,</div>
<div><span class="" style="white-space:pre"> </span>
&attr, &io, NULL, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ,</div>
<div><span class="" style="white-space:pre"> </span>
FILE_OPEN, FILE_DIRECTORY_FILE, NULL, 0);</div>
<div><span style="white-space:pre"> /* SNIP */</span><br>
</div>
<div><span class="" style="white-space:pre"> </span>return
file;</div>
<div>}</div>
</div>
<div><br>
</div>
<div>Function is called like this:</div>
<div><br>
</div>
<div>
<div><span class="" style="white-space:pre"> </span>WCHAR
szFileName[1024] = {0};</div>
<div><span class="" style="white-space:pre"> </span>ExpandEnvironmentStringsW(L"%SystemRoot%\\sample.sdb",
szFileName, 1024); // for testing purposes</div>
<div><span class="" style="white-space:pre"> </span>SdbOpenFile(szFileName,
DOS_PATH);</div>
</div>
<div><br>
</div>
<div>Compiled with winegcc.</div>
<div>I am sure that C:\windows\sample.sdb exists. What am I
doing wrong?</div>
</div>
</blockquote>
Probably you don't nee<strong></strong><strong></strong>d
FILE_DIRECTORY_FILE if it's not a directory?<br>
</body>
</html>