ReactOS  0.4.14-dev-1115-gebeeb9d
vista.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS system libraries
4  * PURPOSE: Vista functions
5  * PROGRAMMER: Thomas Weidenmueller <w3seek@reactos.com>
6  */
7 
8 /* INCLUDES *******************************************************************/
9 
10 #include <k32.h>
11 
12 #define NDEBUG
13 #include <debug.h>
14 
15 #if _WIN32_WINNT >= 0x600
16 
17 /* FIXME: Move these RTL declarations to the NDK */
19 NTAPI
22  IN PLARGE_INTEGER TimeOut OPTIONAL);
23 
25 NTAPI
27  IN OUT PRTL_SRWLOCK SRWLock,
28  IN PLARGE_INTEGER TimeOut OPTIONAL,
29  IN ULONG Flags);
30 
31 /* PUBLIC FUNCTIONS ***********************************************************/
32 
33 /*
34  * @implemented
35  */
36 BOOL
37 WINAPI
38 SleepConditionVariableCS(IN OUT PCONDITION_VARIABLE ConditionVariable,
40  IN DWORD dwMilliseconds)
41 {
43 #if 0
44  LARGE_INTEGER TimeOut;
45  PLARGE_INTEGER TimeOutPtr = NULL;
46 
47  if (dwMilliseconds != INFINITE)
48  {
49  TimeOut.QuadPart = dwMilliseconds * -10000LL;
50  TimeOutPtr = &TimeOut;
51  }
52 
55  TimeOutPtr);
56 #endif
57  if (!NT_SUCCESS(Status))
58  {
60  return FALSE;
61  }
62 
63  return TRUE;
64 }
65 
66 
67 /*
68  * @implemented
69  */
70 BOOL
71 WINAPI
72 SleepConditionVariableSRW(IN OUT PCONDITION_VARIABLE ConditionVariable,
73  IN OUT PSRWLOCK SRWLock,
74  IN DWORD dwMilliseconds,
75  IN ULONG Flags)
76 {
78 #if 0
79  LARGE_INTEGER TimeOut;
80  PLARGE_INTEGER TimeOutPtr = NULL;
81 
82  if (dwMilliseconds != INFINITE)
83  {
84  TimeOut.QuadPart = dwMilliseconds * -10000LL;
85  TimeOutPtr = &TimeOut;
86  }
87 
89  (PRTL_SRWLOCK)SRWLock,
90  TimeOutPtr,
91  Flags);
92 #endif
93  if (!NT_SUCCESS(Status))
94  {
96  return FALSE;
97  }
98 
99  return TRUE;
100 }
101 
102 
103 /*
104  * @implemented
105  */
107  IN DWORD dwSpinCount,
108  IN DWORD flags)
109 {
111 
112  /* FIXME: Flags ignored */
113 
114  /* Initialize the critical section */
116  (PRTL_CRITICAL_SECTION)lpCriticalSection,
117  dwSpinCount);
118  if (!NT_SUCCESS(Status))
119  {
120  /* Set failure code */
122  return FALSE;
123  }
124 
125  /* Success */
126  return TRUE;
127 }
128 
129 
130 /*
131  * @implemented
132  */
133 BOOL
134 WINAPI
135 QueryFullProcessImageNameW(HANDLE hProcess,
136  DWORD dwFlags,
138  PDWORD pdwSize)
139 {
140  BYTE Buffer[sizeof(UNICODE_STRING) + MAX_PATH * sizeof(WCHAR)];
144  DWORD Needed;
145 
148  Buffer,
149  sizeof(Buffer) - sizeof(WCHAR),
150  &Needed);
152  {
153  DynamicBuffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, Needed + sizeof(WCHAR));
154  if (!DynamicBuffer)
155  {
157  return FALSE;
158  }
159 
163  Needed,
164  &Needed);
166  }
167  else Result = (PUNICODE_STRING)Buffer;
168 
169  if (!NT_SUCCESS(Status)) goto Cleanup;
170 
171  if (Result->Length / sizeof(WCHAR) + 1 > *pdwSize)
172  {
174  goto Cleanup;
175  }
176 
177  *pdwSize = Result->Length / sizeof(WCHAR);
178  memcpy(lpExeName, Result->Buffer, Result->Length);
179  lpExeName[*pdwSize] = 0;
180 
181 Cleanup:
182  RtlFreeHeap(RtlGetProcessHeap(), 0, DynamicBuffer);
183 
184  if (!NT_SUCCESS(Status))
185  {
187  }
188 
189  return !Status;
190 }
191 
192 
193 /*
194  * @implemented
195  */
196 BOOL
197 WINAPI
198 QueryFullProcessImageNameA(HANDLE hProcess,
199  DWORD dwFlags,
201  PDWORD pdwSize)
202 {
203  DWORD pdwSizeW = *pdwSize;
204  BOOL Result;
205  LPWSTR lpExeNameW;
206 
207  lpExeNameW = RtlAllocateHeap(RtlGetProcessHeap(),
209  *pdwSize * sizeof(WCHAR));
210  if (!lpExeNameW)
211  {
213  return FALSE;
214  }
215 
216  Result = QueryFullProcessImageNameW(hProcess, dwFlags, lpExeNameW, &pdwSizeW);
217 
218  if (Result)
219  Result = (0 != WideCharToMultiByte(CP_ACP, 0,
220  lpExeNameW,
221  -1,
222  lpExeName,
223  *pdwSize,
224  NULL, NULL));
225 
226  if (Result)
227  *pdwSize = strlen(lpExeName);
228 
229  RtlFreeHeap(RtlGetProcessHeap(), 0, lpExeNameW);
230  return Result;
231 }
232 
233 
234 /*
235  * @unimplemented
236  */
237 HRESULT
238 WINAPI
239 GetApplicationRecoveryCallback(IN HANDLE hProcess,
240  OUT APPLICATION_RECOVERY_CALLBACK* pRecoveryCallback,
241  OUT PVOID* ppvParameter,
242  PDWORD dwPingInterval,
243  PDWORD dwFlags)
244 {
246  return E_FAIL;
247 }
248 
249 
250 /*
251  * @unimplemented
252  */
253 HRESULT
254 WINAPI
255 GetApplicationRestart(IN HANDLE hProcess,
256  OUT PWSTR pwzCommandline OPTIONAL,
257  IN OUT PDWORD pcchSize,
258  OUT PDWORD pdwFlags OPTIONAL)
259 {
261  return E_FAIL;
262 }
263 
264 
265 /*
266  * @unimplemented
267  */
268 VOID
269 WINAPI
270 RecoveryFinished(IN BOOL bSuccess)
271 {
273 }
274 
275 
276 /*
277  * @unimplemented
278  */
279 HRESULT
280 WINAPI
281 RecoveryInProgress(OUT PBOOL pbCancelled)
282 {
284  return E_FAIL;
285 }
286 
287 
288 /*
289  * @unimplemented
290  */
291 HRESULT
292 WINAPI
293 RegisterApplicationRecoveryCallback(IN APPLICATION_RECOVERY_CALLBACK pRecoveryCallback,
294  IN PVOID pvParameter OPTIONAL,
295  DWORD dwPingInterval,
296  DWORD dwFlags)
297 {
299  return E_FAIL;
300 }
301 
302 
303 /*
304  * @unimplemented
305  */
306 HRESULT
307 WINAPI
308 RegisterApplicationRestart(IN PCWSTR pwzCommandline OPTIONAL,
309  IN DWORD dwFlags)
310 {
312  return E_FAIL;
313 }
314 
315 
316 /*
317  * @implemented
318  */
319 BOOLEAN
320 WINAPI
321 CreateSymbolicLinkW(IN LPCWSTR lpSymlinkFileName,
322  IN LPCWSTR lpTargetFileName,
323  IN DWORD dwFlags)
324 {
327  HANDLE hSymlink = NULL;
328  UNICODE_STRING SymlinkFileName = { 0, 0, NULL };
329  UNICODE_STRING TargetFileName = { 0, 0, NULL };
330  BOOLEAN bAllocatedTarget = FALSE, bRelativePath = FALSE;
331  LPWSTR lpTargetFullFileName = NULL;
332  SIZE_T cbPrintName;
333  SIZE_T cbReparseData;
334  PREPARSE_DATA_BUFFER pReparseData = NULL;
335  PBYTE pBufTail;
337  ULONG dwCreateOptions;
338  DWORD dwErr;
339 
340  if(!lpSymlinkFileName || !lpTargetFileName || (dwFlags | SYMBOLIC_LINK_FLAG_DIRECTORY) != SYMBOLIC_LINK_FLAG_DIRECTORY)
341  {
343  return FALSE;
344  }
345 
346  if(dwFlags & SYMBOLIC_LINK_FLAG_DIRECTORY)
347  dwCreateOptions = FILE_DIRECTORY_FILE;
348  else
349  dwCreateOptions = FILE_NON_DIRECTORY_FILE;
350 
351  switch(RtlDetermineDosPathNameType_U(lpTargetFileName))
352  {
353  case RtlPathTypeUnknown:
354  case RtlPathTypeRooted:
355  case RtlPathTypeRelative:
356  bRelativePath = TRUE;
357  RtlInitUnicodeString(&TargetFileName, lpTargetFileName);
358  break;
359 
361  {
362  LPWSTR FilePart;
363  SIZE_T cchTargetFullFileName;
364 
365  cchTargetFullFileName = GetFullPathNameW(lpTargetFileName, 0, NULL, &FilePart);
366 
367  if(cchTargetFullFileName == 0)
368  {
369  dwErr = GetLastError();
370  goto Cleanup;
371  }
372 
373  lpTargetFullFileName = RtlAllocateHeap(RtlGetProcessHeap(), 0, cchTargetFullFileName * sizeof(WCHAR));
374 
375  if(lpTargetFullFileName == NULL)
376  {
378  goto Cleanup;
379  }
380 
381  if(GetFullPathNameW(lpTargetFileName, cchTargetFullFileName, lpTargetFullFileName, &FilePart) == 0)
382  {
383  dwErr = GetLastError();
384  goto Cleanup;
385  }
386  }
387 
388  lpTargetFileName = lpTargetFullFileName;
389 
390  // fallthrough
391 
396  default:
397  if(!RtlDosPathNameToNtPathName_U(lpTargetFileName, &TargetFileName, NULL, NULL))
398  {
399  bAllocatedTarget = TRUE;
401  goto Cleanup;
402  }
403  }
404 
405  cbPrintName = wcslen(lpTargetFileName) * sizeof(WCHAR);
406  cbReparseData = FIELD_OFFSET(REPARSE_DATA_BUFFER, SymbolicLinkReparseBuffer.PathBuffer) + TargetFileName.Length + cbPrintName;
407  pReparseData = RtlAllocateHeap(RtlGetProcessHeap(), 0, cbReparseData);
408 
409  if(pReparseData == NULL)
410  {
412  goto Cleanup;
413  }
414 
415  pBufTail = (PBYTE)(pReparseData->SymbolicLinkReparseBuffer.PathBuffer);
416 
417  pReparseData->ReparseTag = (ULONG)IO_REPARSE_TAG_SYMLINK;
418  pReparseData->ReparseDataLength = (USHORT)cbReparseData - REPARSE_DATA_BUFFER_HEADER_SIZE;
419  pReparseData->Reserved = 0;
420 
421  pReparseData->SymbolicLinkReparseBuffer.SubstituteNameOffset = 0;
422  pReparseData->SymbolicLinkReparseBuffer.SubstituteNameLength = TargetFileName.Length;
423  pBufTail += pReparseData->SymbolicLinkReparseBuffer.SubstituteNameOffset;
424  RtlCopyMemory(pBufTail, TargetFileName.Buffer, TargetFileName.Length);
425 
426  pReparseData->SymbolicLinkReparseBuffer.PrintNameOffset = pReparseData->SymbolicLinkReparseBuffer.SubstituteNameLength;
427  pReparseData->SymbolicLinkReparseBuffer.PrintNameLength = (USHORT)cbPrintName;
428  pBufTail += pReparseData->SymbolicLinkReparseBuffer.PrintNameOffset;
429  RtlCopyMemory(pBufTail, lpTargetFileName, cbPrintName);
430 
431  pReparseData->SymbolicLinkReparseBuffer.Flags = 0;
432 
433  if(bRelativePath)
434  pReparseData->SymbolicLinkReparseBuffer.Flags |= 1; // TODO! give this lone flag a name
435 
436  if(!RtlDosPathNameToNtPathName_U(lpSymlinkFileName, &SymlinkFileName, NULL, NULL))
437  {
439  goto Cleanup;
440  }
441 
443 
445  (
446  &hSymlink,
449  &IoStatusBlock,
450  NULL,
452  0,
453  FILE_CREATE,
455  NULL,
456  0
457  );
458 
459  if(!NT_SUCCESS(Status))
460  {
462  goto Cleanup;
463  }
464 
466  (
467  hSymlink,
468  NULL,
469  NULL,
470  NULL,
471  &IoStatusBlock,
473  pReparseData,
474  cbReparseData,
475  NULL,
476  0
477  );
478 
479  if(!NT_SUCCESS(Status))
480  {
482  DispInfo.DeleteFile = TRUE;
483  NtSetInformationFile(hSymlink, &IoStatusBlock, &DispInfo, sizeof(DispInfo), FileDispositionInformation);
484 
486  goto Cleanup;
487  }
488 
489  dwErr = NO_ERROR;
490 
491 Cleanup:
492  if(hSymlink)
493  NtClose(hSymlink);
494 
495  RtlFreeUnicodeString(&SymlinkFileName);
496  if (bAllocatedTarget)
497  {
498  RtlFreeHeap(RtlGetProcessHeap(),
499  0,
500  TargetFileName.Buffer);
501  }
502 
503  if(lpTargetFullFileName)
504  RtlFreeHeap(RtlGetProcessHeap(), 0, lpTargetFullFileName);
505 
506  if(pReparseData)
507  RtlFreeHeap(RtlGetProcessHeap(), 0, pReparseData);
508 
509  if(dwErr)
510  {
512  return FALSE;
513  }
514 
515  return TRUE;
516 }
517 
518 
519 /*
520  * @implemented
521  */
522 BOOLEAN
523 NTAPI
524 CreateSymbolicLinkA(IN LPCSTR lpSymlinkFileName,
525  IN LPCSTR lpTargetFileName,
526  IN DWORD dwFlags)
527 {
528  PWCHAR SymlinkW, TargetW;
529  BOOLEAN Ret;
530 
531  if(!lpSymlinkFileName || !lpTargetFileName)
532  {
534  return FALSE;
535  }
536 
537  if (!(SymlinkW = FilenameA2W(lpSymlinkFileName, FALSE)))
538  return FALSE;
539 
540  if (!(TargetW = FilenameA2W(lpTargetFileName, TRUE)))
541  return FALSE;
542 
543  Ret = CreateSymbolicLinkW(SymlinkW,
544  TargetW,
545  dwFlags);
546 
547  RtlFreeHeap(RtlGetProcessHeap(), 0, SymlinkW);
548  RtlFreeHeap(RtlGetProcessHeap(), 0, TargetW);
549 
550  return Ret;
551 }
552 
553 
554 /*
555  * @unimplemented
556  */
557 DWORD
558 WINAPI
559 GetFinalPathNameByHandleW(IN HANDLE hFile,
560  OUT LPWSTR lpszFilePath,
561  IN DWORD cchFilePath,
562  IN DWORD dwFlags)
563 {
564  if (dwFlags & ~(VOLUME_NAME_DOS | VOLUME_NAME_GUID | VOLUME_NAME_NT |
565  VOLUME_NAME_NONE | FILE_NAME_NORMALIZED | FILE_NAME_OPENED))
566  {
568  return 0;
569  }
570 
572  return 0;
573 }
574 
575 
576 /*
577  * @implemented
578  */
579 DWORD
580 WINAPI
581 GetFinalPathNameByHandleA(IN HANDLE hFile,
582  OUT LPSTR lpszFilePath,
583  IN DWORD cchFilePath,
584  IN DWORD dwFlags)
585 {
586  WCHAR FilePathW[MAX_PATH];
587  UNICODE_STRING FilePathU;
588  DWORD PrevLastError;
589  DWORD Ret = 0;
590 
591  if (cchFilePath != 0 &&
592  cchFilePath > sizeof(FilePathW) / sizeof(FilePathW[0]))
593  {
594  FilePathU.Length = 0;
595  FilePathU.MaximumLength = (USHORT)cchFilePath * sizeof(WCHAR);
596  FilePathU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
597  0,
598  FilePathU.MaximumLength);
599  if (FilePathU.Buffer == NULL)
600  {
602  return 0;
603  }
604  }
605  else
606  {
607  FilePathU.Length = 0;
608  FilePathU.MaximumLength = sizeof(FilePathW);
609  FilePathU.Buffer = FilePathW;
610  }
611 
612  /* save the last error code */
613  PrevLastError = GetLastError();
615 
616  /* call the unicode version that does all the work */
617  Ret = GetFinalPathNameByHandleW(hFile,
618  FilePathU.Buffer,
619  cchFilePath,
620  dwFlags);
621 
622  if (GetLastError() == ERROR_SUCCESS)
623  {
624  /* no error, restore the last error code and convert the string */
625  SetLastError(PrevLastError);
626 
627  Ret = FilenameU2A_FitOrFail(lpszFilePath,
628  cchFilePath,
629  &FilePathU);
630  }
631 
632  /* free allocated memory if necessary */
633  if (FilePathU.Buffer != FilePathW)
634  {
635  RtlFreeHeap(RtlGetProcessHeap(),
636  0,
637  FilePathU.Buffer);
638  }
639 
640  return Ret;
641 }
642 
643 
644 /*
645  * @unimplemented
646  */
647 BOOL
648 WINAPI
649 SetFileBandwidthReservation(IN HANDLE hFile,
650  IN DWORD nPeriodMilliseconds,
651  IN DWORD nBytesPerPeriod,
652  IN BOOL bDiscardable,
653  OUT LPDWORD lpTransferSize,
654  OUT LPDWORD lpNumOutstandingRequests)
655 {
657  return FALSE;
658 }
659 
660 
661 /*
662  * @unimplemented
663  */
664 BOOL
665 WINAPI
666 GetFileBandwidthReservation(IN HANDLE hFile,
667  OUT LPDWORD lpPeriodMilliseconds,
668  OUT LPDWORD lpBytesPerPeriod,
669  OUT LPBOOL pDiscardable,
670  OUT LPDWORD lpTransferSize,
671  OUT LPDWORD lpNumOutstandingRequests)
672 {
674  return FALSE;
675 }
676 
677 
678 /*
679  * @unimplemented
680  */
681 HANDLE
682 WINAPI
683 OpenFileById(IN HANDLE hFile,
684  IN LPFILE_ID_DESCRIPTOR lpFileID,
685  IN DWORD dwDesiredAccess,
686  IN DWORD dwShareMode,
687  IN LPSECURITY_ATTRIBUTES lpSecurityAttributes OPTIONAL,
688  IN DWORD dwFlags)
689 {
691  return INVALID_HANDLE_VALUE;
692 }
693 
694 
695 /*
696  * @implemented
697  */
698 ULONGLONG
699 WINAPI
701 {
702  ULARGE_INTEGER TickCount;
703 
704  while (TRUE)
705  {
706  TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time;
707  TickCount.LowPart = SharedUserData->TickCount.LowPart;
708 
709  if (TickCount.HighPart == (ULONG)SharedUserData->TickCount.High2Time) break;
710 
711  YieldProcessor();
712  }
713 
714  return (UInt32x32To64(TickCount.LowPart, SharedUserData->TickCountMultiplier) >> 24) +
715  (UInt32x32To64(TickCount.HighPart, SharedUserData->TickCountMultiplier) << 8);
716 }
717 
718 #endif
719 
720 /*
721  Vista+ MUI support functions
722 
723  References:
724  Evolution of MUI Support across Windows Versions: http://msdn.microsoft.com/en-US/library/ee264317.aspx
725  Comparing Windows XP Professional Multilingual Options: http://technet.microsoft.com/en-us/library/bb457045.aspx
726 
727  More info:
728  http://msdn.microsoft.com/en-us/goglobal/bb978454.aspx
729  http://msdn.microsoft.com/en-us/library/dd319074.aspx
730 */
731 
732 /* FUNCTIONS *****************************************************************/
733 
734 BOOL
735 WINAPI
737  DWORD dwFlags,
738  PCWSTR pcwszFilePath,
739  PFILEMUIINFO pFileMUIInfo,
740  DWORD *pcbFileMUIInfo)
741 {
742  DPRINT1("%x %p %p %p\n", dwFlags, pcwszFilePath, pFileMUIInfo, pcbFileMUIInfo);
744  return FALSE;
745 }
746 
747 /*
748  * @unimplemented
749  */
750 BOOL
751 WINAPI
753  DWORD dwFlags,
754  PCWSTR pcwszFilePath,
755  PWSTR pwszLanguage,
756  PULONG pcchLanguage,
757  PWSTR pwszFileMUIPath,
758  PULONG pcchFileMUIPath,
759  PULONGLONG pululEnumerator)
760 {
761  DPRINT1("%x %p %p %p %p %p\n", dwFlags, pcwszFilePath, pwszLanguage, pwszFileMUIPath, pcchFileMUIPath, pululEnumerator);
763  return FALSE;
764 }
765 
766 /*
767  * @unimplemented
768  */
769 BOOL
770 WINAPI
772  DWORD dwFlags,
773  PULONG pulNumLanguages,
774  PZZWSTR pwszLanguagesBuffer,
775  PULONG pcchLanguagesBuffer)
776 {
777  DPRINT1("%x %p %p %p\n", dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer);
779  return FALSE;
780 }
781 
782 /*
783 * @unimplemented
784 */
785 BOOL
786 WINAPI
788  DWORD dwFlags,
789  PULONG pulNumLanguages,
790  PZZWSTR pwszLanguagesBuffer,
791  PULONG pcchLanguagesBuffer)
792 {
793  DPRINT1("%x %p %p %p\n", dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer);
795  return FALSE;
796 }
797 
798 /*
799  * @unimplemented
800  */
801 BOOL
802 WINAPI
804  DWORD dwFlags,
805  PULONG pulNumLanguages,
806  PZZWSTR pwszLanguagesBuffer,
807  PULONG pcchLanguagesBuffer)
808 {
809  DPRINT1("%x %p %p %p\n", dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer);
811  return FALSE;
812 }
813 
814 /*
815  * @unimplemented
816  */
817 LANGID
818 WINAPI
820 {
823  return 0;
824 }
825 
826 /*
827  * @unimplemented
828  */
829 BOOL
830 WINAPI
832  DWORD dwFlags,
833  PCZZWSTR pwmszLanguage,
834  PZZWSTR pwszFallbackLanguages,
835  PDWORD pcchFallbackLanguages,
836  PDWORD pdwAttributes)
837 {
838  DPRINT1("%x %p %p %p %p\n", dwFlags, pwmszLanguage, pwszFallbackLanguages, pcchFallbackLanguages, pdwAttributes);
840  return FALSE;
841 }
842 
843 
844 /*
845  * @unimplemented
846  */
847 BOOL
848 WINAPI
850  DWORD dwFlags,
851  PULONG pulNumLanguages,
852  PZZWSTR pwszLanguagesBuffer,
853  PULONG pcchLanguagesBuffer)
854 {
855  DPRINT1("%x %p %p %p\n", dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer);
857  return FALSE;
858 }
859 
860 /*
861  * @unimplemented
862  */
863 BOOL
864 WINAPI
866  DWORD dwFlags,
867  PCZZWSTR pwszLanguagesBuffer,
868  PULONG pulNumLanguages)
869 {
870  DPRINT1("%x %p %p\n", dwFlags, pwszLanguagesBuffer, pulNumLanguages);
872  return FALSE;
873 }
874 
875 
876 /*
877  * @unimplemented
878  */
879 BOOL
880 WINAPI
882  DWORD dwFlags,
883  PCZZWSTR pwszLanguagesBuffer,
884  PULONG pulNumLanguages
885  )
886 {
887  DPRINT1("%x %p %p\n", dwFlags, pwszLanguagesBuffer, pulNumLanguages);
889  return FALSE;
890 }
891 
NTSTATUS NTAPI RtlSleepConditionVariableSRW(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable, IN OUT PRTL_SRWLOCK SRWLock, IN PLARGE_INTEGER TimeOut OPTIONAL, IN ULONG Flags)
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
const uint16_t * PCWSTR
Definition: typedefs.h:56
#define IN
Definition: typedefs.h:39
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define LL
Definition: tui.h:85
NTSTATUS NTAPI NtSetInformationFile(HANDLE hFile, PIO_STATUS_BLOCK io, PVOID ptr, ULONG len, FILE_INFORMATION_CLASS FileInformationClass)
BOOL WINAPI SetProcessPreferredUILanguages(DWORD dwFlags, PCZZWSTR pwszLanguagesBuffer, PULONG pulNumLanguages)
Definition: vista.c:865
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WideCharToMultiByte
Definition: compat.h:101
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
USHORT MaximumLength
Definition: env_spec_w32.h:370
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
struct _REPARSE_DATA_BUFFER::@310::@312 SymbolicLinkReparseBuffer
BOOL WINAPI GetFileMUIInfo(DWORD dwFlags, PCWSTR pcwszFilePath, PFILEMUIINFO pFileMUIInfo, DWORD *pcbFileMUIInfo)
Definition: vista.c:736
uint16_t * PWSTR
Definition: typedefs.h:55
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
#define CP_ACP
Definition: compat.h:99
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define FILE_CREATE
Definition: from_kernel.h:55
NTSTATUS NTAPI NtQueryInformationProcess(IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength OPTIONAL)
Definition: query.c:59
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
$ULONG LowPart
Definition: ntbasedef.h:576
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
NTSYSCALLAPI NTSTATUS NTAPI NtFsControlFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG FsControlCode, PVOID InputBuffer, ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength)
WORD LANGID
Definition: typedefs.h:80
uint16_t * PWCHAR
Definition: typedefs.h:55
_NullNull_terminated_ CONST WCHAR * PCZZWSTR
Definition: ntbasedef.h:428
_NullNull_terminated_ WCHAR * PZZWSTR
Definition: ntbasedef.h:427
char * LPSTR
Definition: xmlstorage.h:182
#define NO_ERROR
Definition: dderror.h:5
#define E_FAIL
Definition: ddrawi.h:102
DWORD FilenameU2A_FitOrFail(LPSTR DestA, INT destLen, PUNICODE_STRING SourceU)
Definition: fileinfo.c:60
static LPFILE_ID_DESCRIPTOR
Definition: file.c:37
static BOOLEAN bSuccess
Definition: drive.cpp:419
ULONGLONG WINAPI GetTickCount64(VOID)
Definition: GetTickCount64.c:9
#define FILE_WRITE_ATTRIBUTES
Definition: nt_native.h:649
LANGID WINAPI GetThreadUILanguage(VOID)
Definition: vista.c:819
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSectionAndSpinCount(_In_ PRTL_CRITICAL_SECTION CriticalSection, _In_ ULONG SpinCount)
FORCEINLINE VOID YieldProcessor(VOID)
Definition: ke.h:32
static DWORD LPSTR lpExeName
Definition: process.c:72
WCHAR PathBuffer[1]
Definition: shellext.h:176
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
unsigned char * LPBYTE
Definition: typedefs.h:53
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI GetUILanguageInfo(DWORD dwFlags, PCZZWSTR pwmszLanguage, PZZWSTR pwszFallbackLanguages, PDWORD pcchFallbackLanguages, PDWORD pdwAttributes)
Definition: vista.c:831
CRITICAL_SECTION CriticalSection
Definition: iprtprio.c:40
static PSRWLOCK
Definition: sync.c:52
unsigned char BOOLEAN
NTSTATUS NTAPI RtlSleepConditionVariableCS(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable, IN OUT PRTL_CRITICAL_SECTION CriticalSection, IN PLARGE_INTEGER TimeOut OPTIONAL)
smooth NULL
Definition: ftsmooth.c:416
_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:426
Definition: bufpool.h:45
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
const char * LPCSTR
Definition: xmlstorage.h:183
BOOL * PBOOL
Definition: windef.h:161
BOOL WINAPI GetFileMUIPath(DWORD dwFlags, PCWSTR pcwszFilePath, PWSTR pwszLanguage, PULONG pcchLanguage, PWSTR pwszFileMUIPath, PULONG pcchFileMUIPath, PULONGLONG pululEnumerator)
Definition: vista.c:752
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
DWORD dwErr
Definition: service.c:36
PWCHAR FilenameA2W(LPCSTR NameA, BOOL alloc)
Definition: fileinfo.c:22
$ULONG HighPart
Definition: ntbasedef.h:577
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
BOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK Lock, DWORD Timeout, ULONG Flags)
Definition: sync.c:121
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LONG HRESULT
Definition: typedefs.h:78
uint64_t ULONGLONG
Definition: typedefs.h:66
BOOL WINAPI SetThreadPreferredUILanguages(DWORD dwFlags, PCZZWSTR pwszLanguagesBuffer, PULONG pulNumLanguages)
Definition: vista.c:881
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define SetLastError(x)
Definition: compat.h:417
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
GLbitfield flags
Definition: glext.h:7161
#define SharedUserData
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
USHORT ReparseDataLength
Definition: shellext.h:166
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define FILE_NON_DIRECTORY_FILE
Definition: constants.h:492
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOL WINAPI GetUserPreferredUILanguages(DWORD dwFlags, PULONG pulNumLanguages, PZZWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer)
Definition: vista.c:849
unsigned char BYTE
Definition: mem.h:68
BOOL WINAPI GetProcessPreferredUILanguages(DWORD dwFlags, PULONG pulNumLanguages, PZZWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer)
Definition: vista.c:771
BOOL WINAPI GetThreadPreferredUILanguages(DWORD dwFlags, PULONG pulNumLanguages, PZZWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer)
Definition: vista.c:803
static const WCHAR Cleanup[]
Definition: register.c:80
#define SYNCHRONIZE
Definition: nt_native.h:61
_In_ HANDLE hFile
Definition: mswsock.h:90
Status
Definition: gdiplustypes.h:24
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:153
ULONG_PTR SIZE_T
Definition: typedefs.h:79
#define REPARSE_DATA_BUFFER_HEADER_SIZE
Definition: iotypes.h:6843
BOOL WINAPI GetSystemPreferredUILanguages(DWORD dwFlags, PULONG pulNumLanguages, PZZWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer)
Definition: vista.c:787
BOOL * LPBOOL
Definition: windef.h:162
unsigned short USHORT
Definition: pedump.c:61
BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD Timeout)
Definition: sync.c:105
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
unsigned int * PULONG
Definition: retypes.h:1
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
DWORD * PDWORD
Definition: pedump.c:68
struct _UNICODE_STRING UNICODE_STRING
#define DPRINT1
Definition: precomp.h:8
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
#define OUT
Definition: typedefs.h:40
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:390
uint32_t * LPDWORD
Definition: typedefs.h:58
unsigned int ULONG
Definition: retypes.h:1
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define UNIMPLEMENTED
Definition: debug.h:114
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define FSCTL_SET_REPARSE_POINT
Definition: winioctl.h:98
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define INFINITE
Definition: serial.h:102
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define UInt32x32To64(a, b)
Definition: intsafe.h:258
#define FILE_OPEN_REPARSE_POINT
Definition: from_kernel.h:46
BYTE * PBYTE
Definition: pedump.c:66
#define IO_REPARSE_TAG_SYMLINK
Definition: iotypes.h:6884
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
NTSYSAPI BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(_In_opt_z_ PCWSTR DosPathName, _Out_ PUNICODE_STRING NtPathName, _Out_opt_ PCWSTR *NtFileNamePart, _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo)
#define DELETE
Definition: nt_native.h:57
LONGLONG QuadPart
Definition: typedefs.h:113
NTSYSAPI RTL_PATH_TYPE NTAPI RtlDetermineDosPathNameType_U(_In_ PCWSTR Path)
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68