85{
86
87
88 struct
89 {
97 {
98
103
109
114 { __LINE__,
L"\\\\.\\Something\\",
PrefixNone,
L"\\\\.\\Something\\" },
115
121
124 { __LINE__,
L"\\\\??\\C:\\",
PrefixNone,
L"\\\\??\\C:\\" },
126 { __LINE__,
L"\\\\??\\C:\\test\\",
PrefixNone,
L"\\\\??\\C:\\test\\" },
127 };
133 SIZE_T ExpectedFilePartSize;
137
138 for (
i = 0;
i < TestCount;
i++)
139 {
142 {
145 break;
149 break;
154 break;
155 default:
156 skip(
"Invalid test!\n");
157 continue;
158 }
160 RtlFillMemory(FullPathNameBuffer,
sizeof(FullPathNameBuffer), 0xAA);
164 sizeof(FullPathNameBuffer),
165 FullPathNameBuffer,
168
171
173 FilePartSize = 0;
175 FilePartSize =
ShortName - FullPathNameBuffer;
176
178 {
180 ExpectedFilePartSize = 0;
181 break;
183 ExpectedFilePartSize =
sizeof(
L"C:\\");
184 break;
187 if (ExpectedFilePartSize ==
sizeof(
L"C:\\"))
188 ExpectedFilePartSize -=
sizeof(
WCHAR);
189 break;
191 {
195 if (ExpectedFilePartSize ==
sizeof(
L"C:\\"))
196 ExpectedFilePartSize = 0;
197 else
198 {
202 else
203 ok(0,
"Line %lu: GetCurrentDirectory returned %S\n",
TestCases[
i].
Line, CurrentPath);
204 }
205 break;
206 }
207 default:
208 skip(
"Invalid test!\n");
209 continue;
210 }
211 ExpectedFilePartSize +=
TestCases[
i].FilePartSize;
212 if (ExpectedFilePartSize != 0)
213 ExpectedFilePartSize = (ExpectedFilePartSize -
sizeof(
UNICODE_NULL)) /
sizeof(
WCHAR);
214 ok(FilePartSize == ExpectedFilePartSize,
215 "Line %lu: FilePartSize = %lu, expected %lu\n",
TestCases[
i].
Line, (
ULONG)FilePartSize, (
ULONG)ExpectedFilePartSize);
216 }
217}
static TEST_CASE TestCases[]
static BOOLEAN CheckStringBuffer(PCWSTR Buffer, SIZE_T Length, SIZE_T MaximumLength, PCWSTR Expected)
#define EndSeh(ExpectedStatus)
#define GetCurrentDirectoryW(x, y)
static const WCHAR BackSlash[]
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING ShortName
struct _FileName FileName
#define RtlFillMemory(Dest, Length, Fill)
NTSYSAPI ULONG NTAPI RtlGetFullPathName_U(_In_ PCWSTR FileName, _In_ ULONG Size, _Out_z_bytecap_(Size) PWSTR Buffer, _Out_opt_ PWSTR *ShortName)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList