23#define PrintablePointer(p) ((p) == InvalidPointer ? NULL : (p))
38 if (
Length != ExpectedLength)
53 ok(0,
"Not null terminated\n");
63 ok(0,
"Found 0x%x at offset %lu, expected 0x%x\n", Char, (
ULONG)
i, 0);
108 {
L"C:\\%ls\\Folder1",
L"File1",
NULL,
L"C:\\%ls\\Folder1\\",
L"File1" },
110 {
L"",
L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
113 {
L"",
L"C:\\%ls\\Folder1",
NULL,
L"C:\\%ls\\",
L"Folder1" },
116 {
L"C:\\%ls\\Folder1",
L"",
NULL,
L"C:\\%ls\\Folder1\\",
NULL },
118 {
L"",
L"C:\\%ls\\Folder1\\SomeProgram.exe",
NULL,
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
119 {
L"",
L"C:\\%ls\\Folder1\\SomeProgram.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
122 {
L"",
L"C:\\%ls\\Folder1\\SomeProgram",
L".exe",
NULL,
NULL },
124 {
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe",
NULL,
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
125 {
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
127 {
L"C:\\%ls\\Folder1\\",
L"SomeProgram",
L".exe",
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
128 {
L"C:\\%ls\\Folder1",
L"SomeProgram.exe",
NULL,
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
129 {
L"C:\\%ls\\Folder1",
L"SomeProgram.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
131 {
L"C:\\%ls\\Folder1",
L"SomeProgram",
L".exe",
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
135 {
L"C:\\%ls\\Folder1\\SomeProgram.exe",
L"",
L".exe",
NULL,
NULL },
137 {
L"C:\\%ls\\Folder1\\SomeProgram",
L"",
L".exe",
NULL,
NULL },
139 {
L"C:\\%ls\\Folder1",
L"File1",
NULL,
L"C:\\%ls\\Folder1\\",
L"File1" },
140 {
L"C:\\%ls\\CurrentDirectory",
L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
149 {
L"C:\\%ls\\Folder1;C:\\%ls\\CurrentDirectory",
150 L"File1",
NULL,
L"C:\\%ls\\Folder1\\",
L"File1" },
151 {
L"C:\\%ls\\CurrentDirectory;C:\\%ls\\Folder1",
152 L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
153 {
L"C:\\%ls\\CurrentDirectory ; C:\\%ls\\Folder1",
155 {
L"C:\\%ls\\CurrentDirectory ;C:\\%ls\\Folder1",
156 L"File1",
NULL,
L"C:\\%ls\\Folder1\\",
L"File1" },
157 {
L"C:\\%ls\\CurrentDirectory; C:\\%ls\\Folder1",
158 L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
159 {
L";C:\\%ls\\Folder1",
L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
160 {
L";C:\\%ls\\Folder1;",
L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
161 {
L";C:\\%ls\\Folder1;",
L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
164 {
L"",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
165 {
L"",
L"OnlyInCurr ",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
168 {
L";",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
169 {
L"; ",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
172 {
L";C:\\%ls\\Folder1",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
175 {
L"C:\\%ls\\Folder1;;",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
176 {
L";C:\\%ls\\Folder1;",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
177 {
L"C:\\%ls\\Folder1;C:\\%ls\\Folder2",
179 {
L";C:\\%ls\\Folder1;C:\\%ls\\Folder2",
180 L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
181 {
L"C:\\%ls\\Folder1;;C:\\%ls\\Folder2",
182 L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
183 {
L"C:\\%ls\\Folder1;C:\\%ls\\Folder2;",
185 {
L"C:\\%ls\\Folder1;C:\\%ls\\Folder2;;",
186 L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
188 {
L"",
L"C:\\%ls\\Folder1\\SomeProgram With Spaces",
190 {
L"",
L"C:\\%ls\\Folder1\\SomeProgram With Spaces.exe",
192 {
L"",
L"C:\\%ls\\Folder1\\Program",
L".exe",
NULL,
NULL },
194 {
L"",
L"C:\\%ls\\Folder1\\Program.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program.exe" },
195 {
L"",
L"C:\\%ls\\Folder1\\Program With",
L".exe",
NULL,
NULL },
196 {
L"",
L"C:\\%ls\\Folder1\\Program With.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With.exe" },
197 {
L"",
L"C:\\%ls\\Folder1\\Program With Spaces",
L".exe",
NULL,
NULL },
198 {
L"",
L"C:\\%ls\\Folder1\\Program With Spaces.exe",
199 L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With Spaces.exe" },
201 {
L"C:\\%ls\\Folder1",
L"SomeProgram With Spaces",
203 {
L"C:\\%ls\\Folder1",
L"SomeProgram With Spaces.exe",
205 {
L"C:\\%ls\\Folder1",
L"Program",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program.exe" },
206 {
L"C:\\%ls\\Folder1",
L"Program.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program.exe" },
207 {
L"C:\\%ls\\Folder1",
L"Program With",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With.exe" },
209 {
L"C:\\%ls\\Folder1",
L"Program With.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With.exe" },
210 {
L"C:\\%ls\\Folder1",
L"Program With Spaces",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With Spaces.exe" },
211 {
L"C:\\%ls\\Folder1",
L"Program With Spaces.exe",
212 L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With Spaces.exe" },
242 swprintf(ResultPath,
Tests[
i].ResultPath, CustomPath, CustomPath, CustomPath, CustomPath);
243 if (
Tests[
i].ResultFileName)
246 "PartName = %p (%ls), expected %p\n",
253 "PartName = %p (%ls), expected NULL\n",
257 ok(Okay ==
TRUE,
"CheckStringBuffer failed. Got '%ls', expected '%ls'\n",
Buffer, ResultPath);
262 ok(Okay ==
TRUE,
"CheckBuffer failed\n");
265 "PartName = %p (%ls), expected %p\n",
271#define MAKE_DIRECTORY(path) \
273 swprintf(FileName, path, CustomPath); \
274 Success = CreateDirectoryW(FileName, NULL); \
275 ok(Success, "CreateDirectory failed, results might not be accurate\n"); \
278#define MAKE_FILE(path) \
280 swprintf(FileName, path, CustomPath); \
281 Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); \
282 ok(Handle != INVALID_HANDLE_VALUE, \
283 "CreateFile failed, results might not be accurate\n"); \
284 if (Handle != INVALID_HANDLE_VALUE) CloseHandle(Handle); \
287#define DELETE_DIRECTORY(path) \
289 swprintf(FileName, path, CustomPath); \
290 Success = RemoveDirectoryW(FileName); \
292 "RemoveDirectory failed (%lu), test might leave stale directory\n", \
296#define DELETE_FILE(path) \
298 swprintf(FileName, path, CustomPath); \
299 Success = DeleteFileW(FileName); \
301 "DeleteFile failed (%lu), test might leave stale file\n", \
324 ok(
Success,
"CreateDirectory failed, results might not be accurate\n");
330 ok(
Success,
"SetCurrentDirectory failed\n");
332 MAKE_FILE(
L"C:\\%ls\\Folder1\\SomeProgram.exe");
333 MAKE_FILE(
L"C:\\%ls\\Folder1\\SomeProgram2.exe");
334 MAKE_FILE(
L"C:\\%ls\\Folder1\\SomeProgram2.exe.exe");
335 MAKE_FILE(
L"C:\\%ls\\Folder1\\SomeProgram3.exe.exe");
337 MAKE_FILE(
L"C:\\%ls\\Folder1\\Program With.exe");
338 MAKE_FILE(
L"C:\\%ls\\Folder1\\Program With Spaces.exe");
339 MAKE_FILE(
L"C:\\%ls\\CurrentDirectory\\File1");
340 MAKE_FILE(
L"C:\\%ls\\CurrentDirectory\\OnlyInCurr");
370 ok(Okay,
"CheckBuffer failed\n");
380 ok(Okay,
"CheckBuffer failed\n");
392 DELETE_FILE(
L"C:\\%ls\\Folder1\\Program With Spaces.exe");
#define MAKE_DIRECTORY(path)
#define PrintablePointer(p)
static BOOLEAN CheckStringBuffer(PCWSTR Buffer, SIZE_T Length, SIZE_T MaximumLength, PCWSTR Expected)
static VOID RunTestCases(PCWSTR CustomPath)
#define DELETE_DIRECTORY(path)
#define DELETE_FILE(path)
static BOOLEAN CheckBuffer(PVOID Buffer, SIZE_T Size, UCHAR Value)
#define EndSeh(ExpectedStatus)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
#define RtlCompareMemory(s1, s2, l)
struct _FileName FileName
_Inout_opt_ PUNICODE_STRING Extension
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define RtlFillMemory(Dest, Length, Fill)
NTSYSAPI ULONG NTAPI RtlDosSearchPath_U(_In_ PCWSTR Path, _In_ PCWSTR FileName, _In_ PCWSTR Extension, _In_ ULONG BufferSize, _Out_ PWSTR Buffer, _Out_ PWSTR *PartName)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STATUS_ACCESS_VIOLATION
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define INVALID_FILE_ATTRIBUTES
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_ WDFDMATRANSACTION _In_ size_t MaximumLength
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO