ReactOS 0.4.15-dev-7924-g5949c20
RtlGetFullPathName_UstrEx.c File Reference
#include "precomp.h"
Include dependency graph for RtlGetFullPathName_UstrEx.c:

Go to the source code of this file.

Macros

#define ok_eq_ustr(str1, str2)
 
#define RtlPathTypeNotSet   123
 
#define broken(x)   0
 

Enumerations

enum  PREFIX_TYPE {
  PrefixNone , PrefixCurrentDrive , PrefixCurrentPath , PrefixCurrentPathWithoutLastPart ,
  PrefixNone , PrefixCurrentDrive , PrefixCurrentPath , PrefixCurrentPathWithoutLastPart ,
  PrefixNone , PrefixCurrentDrive , PrefixCurrentPath , PrefixCurrentPathWithoutLastPart
}
 

Functions

 NTSTATUS (NTAPI *pRtlGetFullPathName_UstrEx)(IN PUNICODE_STRING FileName
 
static BOOLEAN CheckStringBuffer (PCUNICODE_STRING String, PCWSTR Expected)
 
static BOOLEAN CheckBuffer (PVOID Buffer, SIZE_T Size, UCHAR Value)
 
static VOID RunTestCases (VOID)
 
 START_TEST (RtlGetFullPathName_UstrEx)
 

Variables

IN PUNICODE_STRING StaticString
 
IN PUNICODE_STRING IN PUNICODE_STRING DynamicString
 
IN PUNICODE_STRING IN PUNICODE_STRING IN PUNICODE_STRINGStringUsed
 
IN PUNICODE_STRING IN PUNICODE_STRING IN PUNICODE_STRING IN PSIZE_T FilePartSize OPTIONAL
 
IN PUNICODE_STRING IN PUNICODE_STRING IN PUNICODE_STRING IN PSIZE_T FilePartSize OUT PBOOLEAN NameInvalid
 
IN PUNICODE_STRING IN PUNICODE_STRING IN PUNICODE_STRING IN PSIZE_T FilePartSize OUT PBOOLEAN OUT RTL_PATH_TYPEPathType
 

Macro Definition Documentation

◆ broken

#define broken (   x)    0

Definition at line 116 of file RtlGetFullPathName_UstrEx.c.

◆ ok_eq_ustr

#define ok_eq_ustr (   str1,
  str2 
)
Value:
do { \
ok((str1)->Buffer == (str2)->Buffer, "Buffer modified\n"); \
ok((str1)->Length == (str2)->Length, "Length modified\n"); \
ok((str1)->MaximumLength == (str2)->MaximumLength, "MaximumLength modified\n"); \
} while (0)
Definition: bufpool.h:45
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_In_ WDFDMATRANSACTION _In_ size_t MaximumLength

Definition at line 38 of file RtlGetFullPathName_UstrEx.c.

◆ RtlPathTypeNotSet

#define RtlPathTypeNotSet   123

Definition at line 112 of file RtlGetFullPathName_UstrEx.c.

Enumeration Type Documentation

◆ PREFIX_TYPE

Enumerator
PrefixNone 
PrefixCurrentDrive 
PrefixCurrentPath 
PrefixCurrentPathWithoutLastPart 
PrefixNone 
PrefixCurrentDrive 
PrefixCurrentPath 
PrefixCurrentPathWithoutLastPart 
PrefixNone 
PrefixCurrentDrive 
PrefixCurrentPath 
PrefixCurrentPathWithoutLastPart 

Definition at line 118 of file RtlGetFullPathName_UstrEx.c.

Function Documentation

◆ CheckBuffer()

static BOOLEAN CheckBuffer ( PVOID  Buffer,
SIZE_T  Size,
UCHAR  Value 
)
static

Definition at line 93 of file RtlGetFullPathName_UstrEx.c.

97{
98 PUCHAR Array = Buffer;
99 SIZE_T i;
100
101 for (i = 0; i < Size; i++)
102 {
103 if (Array[i] != Value)
104 {
105 trace("Expected %x, found %x at offset %lu\n", Value, Array[i], (ULONG)i);
106 return FALSE;
107 }
108 }
109 return TRUE;
110}
#define trace
Definition: atltest.h:70
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
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
Definition: glfuncs.h:248
ULONG_PTR SIZE_T
Definition: typedefs.h:80
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by START_TEST().

◆ CheckStringBuffer()

static BOOLEAN CheckStringBuffer ( PCUNICODE_STRING  String,
PCWSTR  Expected 
)
static

Definition at line 46 of file RtlGetFullPathName_UstrEx.c.

49{
50 SIZE_T ExpectedLength = wcslen(Expected) * sizeof(WCHAR);
51 SIZE_T EqualLength;
53 SIZE_T i;
54
55 if (String->Length != ExpectedLength)
56 {
57 ok(0, "String length is %u, expected %lu\n", String->Length, (ULONG)ExpectedLength);
58 Result = FALSE;
59 }
60
61 EqualLength = RtlCompareMemory(String->Buffer, Expected, ExpectedLength);
62 if (EqualLength != ExpectedLength)
63 {
64 ok(0, "String is '%wZ', expected '%S'\n", String, Expected);
65 Result = FALSE;
66 }
67
68 if (String->Buffer[String->Length / sizeof(WCHAR)] != UNICODE_NULL)
69 {
70 ok(0, "Not null terminated\n");
71 Result = FALSE;
72 }
73
74 /* the function nulls the rest of the buffer! */
75 for (i = String->Length + sizeof(UNICODE_NULL); i < String->MaximumLength; i++)
76 {
77 UCHAR Char = ((PUCHAR)String->Buffer)[i];
78 if (Char != 0)
79 {
80 ok(0, "Found 0x%x at offset %lu, expected 0x%x\n", Char, (ULONG)i, 0);
81 /* don't count this as a failure unless the string was actually wrong */
82 //Result = FALSE;
83 /* don't flood the log */
84 break;
85 }
86 }
87
88 return Result;
89}
BOOLEAN Expected
unsigned char BOOLEAN
#define ok(value,...)
Definition: atltest.h:57
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define UNICODE_NULL
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_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
Definition: wsk.h:409
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by RunTestCases().

◆ NTSTATUS()

NTSTATUS ( NTAPI pRtlGetFullPathName_UstrEx)

◆ RunTestCases()

static VOID RunTestCases ( VOID  )
static

Definition at line 128 of file RtlGetFullPathName_UstrEx.c.

129{
130 /* TODO: don't duplicate this in the other tests */
131 /* TODO: Drive Relative tests don't work yet if the current drive isn't C: */
132 struct
133 {
134 ULONG Line;
136 PREFIX_TYPE PrefixType;
137 PCWSTR FullPathName;
139 PREFIX_TYPE FilePartPrefixType;
140 SIZE_T FilePartSize;
141 } TestCases[] =
142 {
143// { __LINE__, L"C:", PrefixCurrentPath, L"", RtlPathTypeDriveRelative, PrefixCurrentPathWithoutLastPart }, // This is broken
144 { __LINE__, L"C:\\", PrefixNone, L"C:\\", RtlPathTypeDriveAbsolute },
145 { __LINE__, L"C:\\test", PrefixNone, L"C:\\test", RtlPathTypeDriveAbsolute, PrefixCurrentDrive },
146 { __LINE__, L"C:\\test\\", PrefixNone, L"C:\\test\\", RtlPathTypeDriveAbsolute },
147 { __LINE__, L"C:/test/", PrefixNone, L"C:\\test\\", RtlPathTypeDriveAbsolute },
148
149 { __LINE__, L"C:\\\\test", PrefixNone, L"C:\\test", RtlPathTypeDriveAbsolute, PrefixCurrentDrive },
150 { __LINE__, L"test", PrefixCurrentPath, L"\\test", RtlPathTypeRelative, PrefixCurrentPath, sizeof(WCHAR) },
151 { __LINE__, L"\\test", PrefixCurrentDrive, L"test", RtlPathTypeRooted, PrefixCurrentDrive },
152 { __LINE__, L"/test", PrefixCurrentDrive, L"test", RtlPathTypeRooted, PrefixCurrentDrive },
153 { __LINE__, L".\\test", PrefixCurrentPath, L"\\test", RtlPathTypeRelative, PrefixCurrentPath, sizeof(WCHAR) },
154
155 { __LINE__, L"\\.", PrefixCurrentDrive, L"", RtlPathTypeRooted },
156 { __LINE__, L"\\.\\", PrefixCurrentDrive, L"", RtlPathTypeRooted },
157 { __LINE__, L"\\\\.", PrefixNone, L"\\\\.\\", RtlPathTypeRootLocalDevice },
158 { __LINE__, L"\\\\.\\", PrefixNone, L"\\\\.\\", RtlPathTypeLocalDevice },
159 { __LINE__, L"\\\\.\\Something\\", PrefixNone, L"\\\\.\\Something\\", RtlPathTypeLocalDevice },
160
161 { __LINE__, L"\\??\\", PrefixCurrentDrive, L"??\\", RtlPathTypeRooted },
162 { __LINE__, L"\\??\\C:", PrefixCurrentDrive, L"??\\C:", RtlPathTypeRooted, PrefixCurrentDrive, 3 * sizeof(WCHAR) },
163 { __LINE__, L"\\??\\C:\\", PrefixCurrentDrive, L"??\\C:\\", RtlPathTypeRooted },
164 { __LINE__, L"\\??\\C:\\test", PrefixCurrentDrive, L"??\\C:\\test", RtlPathTypeRooted, PrefixCurrentDrive, 6 * sizeof(WCHAR) },
165 { __LINE__, L"\\??\\C:\\test\\", PrefixCurrentDrive, L"??\\C:\\test\\", RtlPathTypeRooted },
166
167 { __LINE__, L"\\\\??\\", PrefixNone, L"\\\\??\\", RtlPathTypeUncAbsolute },
168 { __LINE__, L"\\\\??\\C:", PrefixNone, L"\\\\??\\C:", RtlPathTypeUncAbsolute },
169 { __LINE__, L"\\\\??\\C:\\", PrefixNone, L"\\\\??\\C:\\", RtlPathTypeUncAbsolute },
170 { __LINE__, L"\\\\??\\C:\\test", PrefixNone, L"\\\\??\\C:\\test", RtlPathTypeUncAbsolute, PrefixNone, sizeof(L"\\\\??\\C:\\") },
171 { __LINE__, L"\\\\??\\C:\\test\\", PrefixNone, L"\\\\??\\C:\\test\\", RtlPathTypeUncAbsolute },
172 };
175 UNICODE_STRING FullPathName;
176 WCHAR FullPathNameBuffer[MAX_PATH];
177 UNICODE_STRING TempString;
179 SIZE_T FilePartSize;
183 WCHAR ExpectedPathName[MAX_PATH];
184 SIZE_T ExpectedFilePartSize;
185 const INT TestCount = sizeof(TestCases) / sizeof(TestCases[0]);
186 INT i;
187 BOOLEAN Okay;
188
189 for (i = 0; i < TestCount; i++)
190 {
191 switch (TestCases[i].PrefixType)
192 {
193 case PrefixNone:
194 ExpectedPathName[0] = UNICODE_NULL;
195 break;
197 GetCurrentDirectoryW(sizeof(ExpectedPathName) / sizeof(WCHAR), ExpectedPathName);
198 ExpectedPathName[3] = UNICODE_NULL;
199 break;
201 {
203 Length = GetCurrentDirectoryW(sizeof(ExpectedPathName) / sizeof(WCHAR), ExpectedPathName);
204 if (Length == 3 && TestCases[i].FullPathName[0])
205 ExpectedPathName[2] = UNICODE_NULL;
206 break;
207 }
208 default:
209 skip("Invalid test!\n");
210 continue;
211 }
212 wcscat(ExpectedPathName, TestCases[i].FullPathName);
214 RtlInitEmptyUnicodeString(&FullPathName, FullPathNameBuffer, sizeof(FullPathNameBuffer));
215 RtlFillMemory(FullPathName.Buffer, FullPathName.MaximumLength, 0xAA);
216 TempString = FileName;
219 FilePartSize = 1234;
220 NameInvalid = (BOOLEAN)-1;
221 LengthNeeded = 1234;
222 StartSeh()
223 Status = pRtlGetFullPathName_UstrEx(&FileName,
224 &FullPathName,
225 NULL,
226 &StringUsed,
227 &FilePartSize,
229 &PathType,
230 &LengthNeeded);
231 ok(Status == STATUS_SUCCESS, "Line %lu: status = %lx\n", TestCases[i].Line, Status);
233 ok_eq_ustr(&FileName, &TempString);
234 ok(FullPathName.Buffer == FullPathNameBuffer, "Line %lu: Buffer modified\n", TestCases[i].Line);
235 ok(FullPathName.MaximumLength == sizeof(FullPathNameBuffer), "Line %lu: MaximumLength modified\n", TestCases[i].Line);
236 Okay = CheckStringBuffer(&FullPathName, ExpectedPathName);
237 ok(Okay, "Line %lu: Wrong path name '%wZ', expected '%S'\n", TestCases[i].Line, &FullPathName, ExpectedPathName);
238 ok(StringUsed == &FullPathName, "Line %lu: StringUsed = %p, expected %p\n", TestCases[i].Line, StringUsed, &FullPathName);
239 switch (TestCases[i].FilePartPrefixType)
240 {
241 case PrefixNone:
242 ExpectedFilePartSize = 0;
243 break;
245 ExpectedFilePartSize = sizeof(L"C:\\");
246 break;
248 ExpectedFilePartSize = GetCurrentDirectoryW(0, NULL) * sizeof(WCHAR);
249 if (ExpectedFilePartSize == sizeof(L"C:\\"))
250 ExpectedFilePartSize -= sizeof(WCHAR);
251 break;
253 {
254 WCHAR CurrentPath[MAX_PATH];
256 ExpectedFilePartSize = GetCurrentDirectoryW(sizeof(CurrentPath) / sizeof(WCHAR), CurrentPath) * sizeof(WCHAR) + sizeof(UNICODE_NULL);
257 if (ExpectedFilePartSize == sizeof(L"C:\\"))
258 ExpectedFilePartSize = 0;
259 else
260 {
261 BackSlash = wcsrchr(CurrentPath, L'\\');
262 if (BackSlash)
263 ExpectedFilePartSize -= wcslen(BackSlash + 1) * sizeof(WCHAR);
264 else
265 ok(0, "Line %lu: GetCurrentDirectory returned %S\n", TestCases[i].Line, CurrentPath);
266 }
267 break;
268 }
269 default:
270 skip("Invalid test!\n");
271 continue;
272 }
273 ExpectedFilePartSize += TestCases[i].FilePartSize;
274 if (ExpectedFilePartSize != 0)
275 ExpectedFilePartSize = (ExpectedFilePartSize - sizeof(UNICODE_NULL)) / sizeof(WCHAR);
276 ok(FilePartSize == ExpectedFilePartSize,
277 "Line %lu: FilePartSize = %lu, expected %lu\n", TestCases[i].Line, (ULONG)FilePartSize, (ULONG)ExpectedFilePartSize);
278 ok(NameInvalid == FALSE, "Line %lu: NameInvalid = %u\n", TestCases[i].Line, NameInvalid);
279 ok(PathType == TestCases[i].PathType, "Line %lu: PathType = %d, expected %d\n", TestCases[i].Line, PathType, TestCases[i].PathType);
280 ok(LengthNeeded == 0, "Line %lu: LengthNeeded = %lu\n", TestCases[i].Line, (ULONG)LengthNeeded);
281 }
282}
static TEST_CASE TestCases[]
Definition: CommandLine.c:101
IN PUNICODE_STRING IN PUNICODE_STRING IN PUNICODE_STRING IN PSIZE_T FilePartSize OUT PBOOLEAN OUT RTL_PATH_TYPE * PathType
#define ok_eq_ustr(str1, str2)
static BOOLEAN CheckStringBuffer(PCUNICODE_STRING String, PCWSTR Expected)
#define RtlPathTypeNotSet
IN PUNICODE_STRING IN PUNICODE_STRING IN PUNICODE_STRING * StringUsed
IN PUNICODE_STRING IN PUNICODE_STRING IN PUNICODE_STRING IN PSIZE_T FilePartSize OUT PBOOLEAN NameInvalid
#define InvalidPointer
#define StartSeh()
Definition: _sntprintf.h:16
#define EndSeh(ExpectedStatus)
Definition: _sntprintf.h:17
#define skip(...)
Definition: atltest.h:64
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756
#define wcsrchr
Definition: compat.h:16
#define MAX_PATH
Definition: compat.h:34
static const WCHAR BackSlash[]
Definition: devclass.c:29
switch(r->id)
Definition: btrfs.c:3046
struct _FileName FileName
Definition: fatprocs.h:896
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION _In_ ULONG _Out_opt_ PULONG LengthNeeded
Definition: fltkernel.h:1343
Status
Definition: gdiplustypes.h:25
GLdouble n
Definition: glext.h:7729
GLfloat GLfloat p
Definition: glext.h:8902
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:599
BOOL expected
Definition: store.c:2063
@ RtlPathTypeRootLocalDevice
Definition: rtltypes.h:478
@ RtlPathTypeRelative
Definition: rtltypes.h:476
@ RtlPathTypeUncAbsolute
Definition: rtltypes.h:472
@ RtlPathTypeRooted
Definition: rtltypes.h:475
@ RtlPathTypeLocalDevice
Definition: rtltypes.h:477
@ RtlPathTypeDriveAbsolute
Definition: rtltypes.h:473
enum _RTL_PATH_TYPE RTL_PATH_TYPE
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define L(x)
Definition: ntvdm.h:50
#define BOOLEAN
Definition: pedump.c:73
_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 STATUS_SUCCESS
Definition: shellext.h:65
Definition: ncftp.h:79
Definition: movable.cpp:9
USHORT MaximumLength
Definition: env_spec_w32.h:370
Definition: name.c:39
Definition: ps.c:97
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( RtlGetFullPathName_UstrEx  )

Definition at line 284 of file RtlGetFullPathName_UstrEx.c.

285{
288 UNICODE_STRING TempString;
291 SIZE_T FilePartSize;
293 BOOLEAN NameInvalidArray[sizeof(ULONGLONG)];
296 BOOLEAN Okay;
297
298 pRtlGetFullPathName_UstrEx = (PVOID)GetProcAddress(GetModuleHandleW(L"ntdll"), "RtlGetFullPathName_UstrEx");
299 if (!pRtlGetFullPathName_UstrEx)
300 {
301 skip("RtlGetFullPathName_UstrEx unavailable\n");
302 return;
303 }
304
305 /* NULL parameters */
306 StartSeh()
307 pRtlGetFullPathName_UstrEx(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
309
311 TempString = FileName;
312 StartSeh()
313 pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
315 ok_eq_ustr(&FileName, &TempString);
316
318 TempString = FileName;
319 StartSeh()
320 pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
322 ok_eq_ustr(&FileName, &TempString);
323
325 StartSeh()
326 pRtlGetFullPathName_UstrEx(NULL, NULL, NULL, NULL, NULL, NULL, &PathType, NULL);
329
330 /* Check what else is initialized before it crashes */
333 FilePartSize = 1234;
334 NameInvalid = (BOOLEAN)-1;
335 LengthNeeded = 1234;
336 StartSeh()
337 pRtlGetFullPathName_UstrEx(NULL, NULL, NULL, &StringUsed, &FilePartSize, &NameInvalid, &PathType, &LengthNeeded);
340 ok(FilePartSize == 0, "FilePartSize = %lu\n", (ULONG)FilePartSize);
344
346 TempString = FileName;
348 FilePartSize = 1234;
349 NameInvalid = (BOOLEAN)-1;
350 LengthNeeded = 1234;
351 StartSeh()
352 pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, &StringUsed, &FilePartSize, &NameInvalid, NULL, &LengthNeeded);
354 ok_eq_ustr(&FileName, &TempString);
356 ok(FilePartSize == 0, "FilePartSize = %lu\n", (ULONG)FilePartSize);
359
360 /* This is the first one that doesn't crash. FileName and PathType cannot be NULL */
362 TempString = FileName;
364 StartSeh()
365 Status = pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, &PathType, NULL);
368 ok_eq_ustr(&FileName, &TempString);
370
372 TempString = FileName;
374 StartSeh()
375 Status = pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, &PathType, NULL);
378 ok_eq_ustr(&FileName, &TempString);
380
381 /* Show that NameInvalid is indeed BOOLEAN */
383 TempString = FileName;
385 RtlFillMemory(NameInvalidArray, sizeof(NameInvalidArray), 0x55);
386 StartSeh()
387 Status = pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NameInvalidArray, &PathType, NULL);
390 ok_eq_ustr(&FileName, &TempString);
392 ok(NameInvalidArray[0] == FALSE, "NameInvalid = %u\n", NameInvalidArray[0]);
393 Okay = CheckBuffer(NameInvalidArray + 1, sizeof(NameInvalidArray) - sizeof(NameInvalidArray[0]), 0x55);
394 ok(Okay, "CheckBuffer failed\n");
395
396 /* Give it a valid path */
398 TempString = FileName;
400 StartSeh()
401 Status = pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, &PathType, NULL);
404 ok_eq_ustr(&FileName, &TempString);
406
407 /* Zero-length static string */
409 TempString = FileName;
412 StartSeh()
413 Status = pRtlGetFullPathName_UstrEx(&FileName, &StaticString, NULL, NULL, NULL, NULL, &PathType, NULL);
416 ok_eq_ustr(&FileName, &TempString);
418
419 /* TODO: play around with StaticString and DynamicString */
420
421 /* Check the actual functionality with different paths */
422 RunTestCases();
423}
IN PUNICODE_STRING StaticString
static VOID RunTestCases(VOID)
static BOOLEAN CheckBuffer(PVOID Buffer, SIZE_T Size, UCHAR Value)
Definition: terminate.cpp:24
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
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 * u
Definition: glfuncs.h:240
#define d
Definition: ke_i.h:81
@ RtlPathTypeUnknown
Definition: rtltypes.h:471
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
#define test
Definition: rosglue.h:37
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
void * PVOID
Definition: typedefs.h:50
uint64_t ULONGLONG
Definition: typedefs.h:67
#define STATUS_OBJECT_NAME_INVALID
Definition: udferr_usr.h:148

Variable Documentation

◆ DynamicString

◆ NameInvalid

◆ OPTIONAL

◆ PathType

◆ StaticString

◆ StringUsed