ReactOS  0.4.15-dev-1397-g19779b3
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_vista.h>
11 
12 #if _WIN32_WINNT != _WIN32_WINNT_VISTA
13 #error "This file must be compiled with _WIN32_WINNT == _WIN32_WINNT_VISTA"
14 #endif
15 
16 // This is defined only in ntifs.h
17 #define REPARSE_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_DATA_BUFFER, GenericReparseBuffer)
18 
19 #define NDEBUG
20 #include <debug.h>
21 
22 /* PUBLIC FUNCTIONS ***********************************************************/
23 
24 /*
25  * @implemented
26  */
27 BOOL
28 WINAPI
30  DWORD dwFlags,
32  PDWORD pdwSize)
33 {
34  BYTE Buffer[sizeof(UNICODE_STRING) + MAX_PATH * sizeof(WCHAR)];
38  DWORD Needed;
39 
42  Buffer,
43  sizeof(Buffer) - sizeof(WCHAR),
44  &Needed);
46  {
47  DynamicBuffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, Needed + sizeof(WCHAR));
48  if (!DynamicBuffer)
49  {
51  return FALSE;
52  }
53 
57  Needed,
58  &Needed);
60  }
62 
63  if (!NT_SUCCESS(Status)) goto Cleanup;
64 
65  if (Result->Length / sizeof(WCHAR) + 1 > *pdwSize)
66  {
68  goto Cleanup;
69  }
70 
71  *pdwSize = Result->Length / sizeof(WCHAR);
72  memcpy(lpExeName, Result->Buffer, Result->Length);
73  lpExeName[*pdwSize] = 0;
74 
75 Cleanup:
76  RtlFreeHeap(RtlGetProcessHeap(), 0, DynamicBuffer);
77 
78  if (!NT_SUCCESS(Status))
79  {
81  }
82 
83  return !Status;
84 }
85 
86 
87 /*
88  * @implemented
89  */
90 BOOL
91 WINAPI
93  DWORD dwFlags,
95  PDWORD pdwSize)
96 {
97  DWORD pdwSizeW = *pdwSize;
98  BOOL Result;
99  LPWSTR lpExeNameW;
100 
101  lpExeNameW = RtlAllocateHeap(RtlGetProcessHeap(),
103  *pdwSize * sizeof(WCHAR));
104  if (!lpExeNameW)
105  {
107  return FALSE;
108  }
109 
110  Result = QueryFullProcessImageNameW(hProcess, dwFlags, lpExeNameW, &pdwSizeW);
111 
112  if (Result)
113  Result = (0 != WideCharToMultiByte(CP_ACP, 0,
114  lpExeNameW,
115  -1,
116  lpExeName,
117  *pdwSize,
118  NULL, NULL));
119 
120  if (Result)
121  *pdwSize = strlen(lpExeName);
122 
123  RtlFreeHeap(RtlGetProcessHeap(), 0, lpExeNameW);
124  return Result;
125 }
126 
127 
128 /*
129  * @unimplemented
130  */
131 HRESULT
132 WINAPI
134  OUT APPLICATION_RECOVERY_CALLBACK* pRecoveryCallback,
135  OUT PVOID* ppvParameter,
136  PDWORD dwPingInterval,
137  PDWORD dwFlags)
138 {
140  return E_FAIL;
141 }
142 
143 
144 /*
145  * @unimplemented
146  */
147 HRESULT
148 WINAPI
150  OUT PWSTR pwzCommandline OPTIONAL,
151  IN OUT PDWORD pcchSize,
152  OUT PDWORD pdwFlags OPTIONAL)
153 {
155  return E_FAIL;
156 }
157 
158 
159 /*
160  * @unimplemented
161  */
162 VOID
163 WINAPI
165 {
167 }
168 
169 
170 /*
171  * @unimplemented
172  */
173 HRESULT
174 WINAPI
176 {
178  return E_FAIL;
179 }
180 
181 
182 /*
183  * @unimplemented
184  */
185 HRESULT
186 WINAPI
187 RegisterApplicationRecoveryCallback(IN APPLICATION_RECOVERY_CALLBACK pRecoveryCallback,
188  IN PVOID pvParameter OPTIONAL,
189  DWORD dwPingInterval,
190  DWORD dwFlags)
191 {
193  return E_FAIL;
194 }
195 
196 
197 /*
198  * @unimplemented
199  */
200 HRESULT
201 WINAPI
203  IN DWORD dwFlags)
204 {
206  return E_FAIL;
207 }
208 
209 
210 /*
211  * @implemented
212  */
213 BOOLEAN
214 WINAPI
215 CreateSymbolicLinkW(IN LPCWSTR lpSymlinkFileName,
216  IN LPCWSTR lpTargetFileName,
217  IN DWORD dwFlags)
218 {
221  HANDLE hSymlink = NULL;
222  UNICODE_STRING SymlinkFileName = { 0, 0, NULL };
223  UNICODE_STRING TargetFileName = { 0, 0, NULL };
224  BOOLEAN bAllocatedTarget = FALSE, bRelativePath = FALSE;
225  LPWSTR lpTargetFullFileName = NULL;
226  SIZE_T cbPrintName;
227  SIZE_T cbReparseData;
228  PREPARSE_DATA_BUFFER pReparseData = NULL;
229  PBYTE pBufTail;
231  ULONG dwCreateOptions;
232  DWORD dwErr;
233 
234  if(!lpSymlinkFileName || !lpTargetFileName || (dwFlags | SYMBOLIC_LINK_FLAG_DIRECTORY) != SYMBOLIC_LINK_FLAG_DIRECTORY)
235  {
237  return FALSE;
238  }
239 
240  if(dwFlags & SYMBOLIC_LINK_FLAG_DIRECTORY)
241  dwCreateOptions = FILE_DIRECTORY_FILE;
242  else
243  dwCreateOptions = FILE_NON_DIRECTORY_FILE;
244 
245  switch(RtlDetermineDosPathNameType_U(lpTargetFileName))
246  {
247  case RtlPathTypeUnknown:
248  case RtlPathTypeRooted:
249  case RtlPathTypeRelative:
250  bRelativePath = TRUE;
251  RtlInitUnicodeString(&TargetFileName, lpTargetFileName);
252  break;
253 
255  {
256  LPWSTR FilePart;
257  SIZE_T cchTargetFullFileName;
258 
259  cchTargetFullFileName = GetFullPathNameW(lpTargetFileName, 0, NULL, &FilePart);
260 
261  if(cchTargetFullFileName == 0)
262  {
263  dwErr = GetLastError();
264  goto Cleanup;
265  }
266 
267  lpTargetFullFileName = RtlAllocateHeap(RtlGetProcessHeap(), 0, cchTargetFullFileName * sizeof(WCHAR));
268 
269  if(lpTargetFullFileName == NULL)
270  {
272  goto Cleanup;
273  }
274 
275  if(GetFullPathNameW(lpTargetFileName, cchTargetFullFileName, lpTargetFullFileName, &FilePart) == 0)
276  {
277  dwErr = GetLastError();
278  goto Cleanup;
279  }
280  }
281 
282  lpTargetFileName = lpTargetFullFileName;
283 
284  // fallthrough
285 
290  default:
291  if(!RtlDosPathNameToNtPathName_U(lpTargetFileName, &TargetFileName, NULL, NULL))
292  {
293  bAllocatedTarget = TRUE;
295  goto Cleanup;
296  }
297  }
298 
299  cbPrintName = wcslen(lpTargetFileName) * sizeof(WCHAR);
300  cbReparseData = FIELD_OFFSET(REPARSE_DATA_BUFFER, SymbolicLinkReparseBuffer.PathBuffer) + TargetFileName.Length + cbPrintName;
301  pReparseData = RtlAllocateHeap(RtlGetProcessHeap(), 0, cbReparseData);
302 
303  if(pReparseData == NULL)
304  {
306  goto Cleanup;
307  }
308 
309  pBufTail = (PBYTE)(pReparseData->SymbolicLinkReparseBuffer.PathBuffer);
310 
311  pReparseData->ReparseTag = (ULONG)IO_REPARSE_TAG_SYMLINK;
312  pReparseData->ReparseDataLength = (USHORT)cbReparseData - REPARSE_DATA_BUFFER_HEADER_SIZE;
313  pReparseData->Reserved = 0;
314 
315  pReparseData->SymbolicLinkReparseBuffer.SubstituteNameOffset = 0;
316  pReparseData->SymbolicLinkReparseBuffer.SubstituteNameLength = TargetFileName.Length;
317  pBufTail += pReparseData->SymbolicLinkReparseBuffer.SubstituteNameOffset;
318  RtlCopyMemory(pBufTail, TargetFileName.Buffer, TargetFileName.Length);
319 
320  pReparseData->SymbolicLinkReparseBuffer.PrintNameOffset = pReparseData->SymbolicLinkReparseBuffer.SubstituteNameLength;
321  pReparseData->SymbolicLinkReparseBuffer.PrintNameLength = (USHORT)cbPrintName;
322  pBufTail += pReparseData->SymbolicLinkReparseBuffer.PrintNameOffset;
323  RtlCopyMemory(pBufTail, lpTargetFileName, cbPrintName);
324 
325  pReparseData->SymbolicLinkReparseBuffer.Flags = 0;
326 
327  if(bRelativePath)
328  pReparseData->SymbolicLinkReparseBuffer.Flags |= 1; // TODO! give this lone flag a name
329 
330  if(!RtlDosPathNameToNtPathName_U(lpSymlinkFileName, &SymlinkFileName, NULL, NULL))
331  {
333  goto Cleanup;
334  }
335 
337 
339  (
340  &hSymlink,
343  &IoStatusBlock,
344  NULL,
346  0,
347  FILE_CREATE,
349  NULL,
350  0
351  );
352 
353  if(!NT_SUCCESS(Status))
354  {
356  goto Cleanup;
357  }
358 
360  (
361  hSymlink,
362  NULL,
363  NULL,
364  NULL,
365  &IoStatusBlock,
367  pReparseData,
368  cbReparseData,
369  NULL,
370  0
371  );
372 
373  if(!NT_SUCCESS(Status))
374  {
376  DispInfo.DeleteFile = TRUE;
377  NtSetInformationFile(hSymlink, &IoStatusBlock, &DispInfo, sizeof(DispInfo), FileDispositionInformation);
378 
380  goto Cleanup;
381  }
382 
383  dwErr = NO_ERROR;
384 
385 Cleanup:
386  if(hSymlink)
387  NtClose(hSymlink);
388 
389  RtlFreeUnicodeString(&SymlinkFileName);
390  if (bAllocatedTarget)
391  {
392  RtlFreeHeap(RtlGetProcessHeap(),
393  0,
394  TargetFileName.Buffer);
395  }
396 
397  if(lpTargetFullFileName)
398  RtlFreeHeap(RtlGetProcessHeap(), 0, lpTargetFullFileName);
399 
400  if(pReparseData)
401  RtlFreeHeap(RtlGetProcessHeap(), 0, pReparseData);
402 
403  if(dwErr)
404  {
406  return FALSE;
407  }
408 
409  return TRUE;
410 }
411 
412 
413 /*
414  * @implemented
415  */
416 BOOLEAN
417 NTAPI
418 CreateSymbolicLinkA(IN LPCSTR lpSymlinkFileName,
419  IN LPCSTR lpTargetFileName,
420  IN DWORD dwFlags)
421 {
422  PWCHAR SymlinkW, TargetW;
423  BOOLEAN Ret;
424 
425  if(!lpSymlinkFileName || !lpTargetFileName)
426  {
428  return FALSE;
429  }
430 
431  if (!(SymlinkW = FilenameA2W(lpSymlinkFileName, FALSE)))
432  return FALSE;
433 
434  if (!(TargetW = FilenameA2W(lpTargetFileName, TRUE)))
435  return FALSE;
436 
437  Ret = CreateSymbolicLinkW(SymlinkW,
438  TargetW,
439  dwFlags);
440 
441  RtlFreeHeap(RtlGetProcessHeap(), 0, SymlinkW);
442  RtlFreeHeap(RtlGetProcessHeap(), 0, TargetW);
443 
444  return Ret;
445 }
446 
447 
448 /*
449  * @unimplemented
450  */
451 DWORD
452 WINAPI
454  OUT LPWSTR lpszFilePath,
455  IN DWORD cchFilePath,
456  IN DWORD dwFlags)
457 {
458  if (dwFlags & ~(VOLUME_NAME_DOS | VOLUME_NAME_GUID | VOLUME_NAME_NT |
459  VOLUME_NAME_NONE | FILE_NAME_NORMALIZED | FILE_NAME_OPENED))
460  {
462  return 0;
463  }
464 
466  return 0;
467 }
468 
469 
470 /*
471  * @implemented
472  */
473 DWORD
474 WINAPI
476  OUT LPSTR lpszFilePath,
477  IN DWORD cchFilePath,
478  IN DWORD dwFlags)
479 {
480  WCHAR FilePathW[MAX_PATH];
481  UNICODE_STRING FilePathU;
482  DWORD PrevLastError;
483  DWORD Ret = 0;
484 
485  if (cchFilePath != 0 &&
486  cchFilePath > sizeof(FilePathW) / sizeof(FilePathW[0]))
487  {
488  FilePathU.Length = 0;
489  FilePathU.MaximumLength = (USHORT)cchFilePath * sizeof(WCHAR);
490  FilePathU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
491  0,
492  FilePathU.MaximumLength);
493  if (FilePathU.Buffer == NULL)
494  {
496  return 0;
497  }
498  }
499  else
500  {
501  FilePathU.Length = 0;
502  FilePathU.MaximumLength = sizeof(FilePathW);
503  FilePathU.Buffer = FilePathW;
504  }
505 
506  /* save the last error code */
507  PrevLastError = GetLastError();
509 
510  /* call the unicode version that does all the work */
512  FilePathU.Buffer,
513  cchFilePath,
514  dwFlags);
515 
516  if (GetLastError() == ERROR_SUCCESS)
517  {
518  /* no error, restore the last error code and convert the string */
519  SetLastError(PrevLastError);
520 
521  Ret = FilenameU2A_FitOrFail(lpszFilePath,
522  cchFilePath,
523  &FilePathU);
524  }
525 
526  /* free allocated memory if necessary */
527  if (FilePathU.Buffer != FilePathW)
528  {
529  RtlFreeHeap(RtlGetProcessHeap(),
530  0,
531  FilePathU.Buffer);
532  }
533 
534  return Ret;
535 }
536 
537 
538 /*
539  * @unimplemented
540  */
541 BOOL
542 WINAPI
544  IN DWORD nPeriodMilliseconds,
545  IN DWORD nBytesPerPeriod,
546  IN BOOL bDiscardable,
547  OUT LPDWORD lpTransferSize,
548  OUT LPDWORD lpNumOutstandingRequests)
549 {
551  return FALSE;
552 }
553 
554 
555 /*
556  * @unimplemented
557  */
558 BOOL
559 WINAPI
561  OUT LPDWORD lpPeriodMilliseconds,
562  OUT LPDWORD lpBytesPerPeriod,
563  OUT LPBOOL pDiscardable,
564  OUT LPDWORD lpTransferSize,
565  OUT LPDWORD lpNumOutstandingRequests)
566 {
568  return FALSE;
569 }
570 
571 
572 /*
573  * @unimplemented
574  */
575 HANDLE
576 WINAPI
578  IN LPFILE_ID_DESCRIPTOR lpFileID,
579  IN DWORD dwDesiredAccess,
580  IN DWORD dwShareMode,
581  IN LPSECURITY_ATTRIBUTES lpSecurityAttributes OPTIONAL,
582  IN DWORD dwFlags)
583 {
585  return INVALID_HANDLE_VALUE;
586 }
587 
588 
589 
590 /*
591  Vista+ MUI support functions
592 
593  References:
594  Evolution of MUI Support across Windows Versions: http://msdn.microsoft.com/en-US/library/ee264317.aspx
595  Comparing Windows XP Professional Multilingual Options: http://technet.microsoft.com/en-us/library/bb457045.aspx
596 
597  More info:
598  http://msdn.microsoft.com/en-us/goglobal/bb978454.aspx
599  http://msdn.microsoft.com/en-us/library/dd319074.aspx
600 */
601 
602 /* FUNCTIONS *****************************************************************/
603 
604 BOOL
605 WINAPI
607  DWORD dwFlags,
608  PCWSTR pcwszFilePath,
609  PFILEMUIINFO pFileMUIInfo,
610  DWORD *pcbFileMUIInfo)
611 {
612  DPRINT1("%x %p %p %p\n", dwFlags, pcwszFilePath, pFileMUIInfo, pcbFileMUIInfo);
614  return FALSE;
615 }
616 
617 /*
618  * @unimplemented
619  */
620 BOOL
621 WINAPI
623  DWORD dwFlags,
624  PCWSTR pcwszFilePath,
625  PWSTR pwszLanguage,
626  PULONG pcchLanguage,
627  PWSTR pwszFileMUIPath,
628  PULONG pcchFileMUIPath,
629  PULONGLONG pululEnumerator)
630 {
631  DPRINT1("%x %p %p %p %p %p\n", dwFlags, pcwszFilePath, pwszLanguage, pwszFileMUIPath, pcchFileMUIPath, pululEnumerator);
633  return FALSE;
634 }
635 
636 /*
637  * @unimplemented
638  */
639 #if 0 // This is Windows 7+
640 BOOL
641 WINAPI
642 GetProcessPreferredUILanguages(
643  DWORD dwFlags,
644  PULONG pulNumLanguages,
645  PZZWSTR pwszLanguagesBuffer,
646  PULONG pcchLanguagesBuffer)
647 {
648  DPRINT1("%x %p %p %p\n", dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer);
650  return FALSE;
651 }
652 #endif
653 
654 /*
655 * @unimplemented
656 */
657 BOOL
658 WINAPI
660  DWORD dwFlags,
661  PULONG pulNumLanguages,
662  PZZWSTR pwszLanguagesBuffer,
663  PULONG pcchLanguagesBuffer)
664 {
665  DPRINT1("%x %p %p %p\n", dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer);
667  return FALSE;
668 }
669 
670 /*
671  * @unimplemented
672  */
673 BOOL
674 WINAPI
676  DWORD dwFlags,
677  PULONG pulNumLanguages,
678  PZZWSTR pwszLanguagesBuffer,
679  PULONG pcchLanguagesBuffer)
680 {
681  DPRINT1("%x %p %p %p\n", dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer);
683  return FALSE;
684 }
685 
686 /*
687  * @unimplemented
688  */
689 LANGID
690 WINAPI
692 {
695  return 0;
696 }
697 
698 /*
699  * @unimplemented
700  */
701 BOOL
702 WINAPI
704  DWORD dwFlags,
705  PCZZWSTR pwmszLanguage,
706  PZZWSTR pwszFallbackLanguages,
707  PDWORD pcchFallbackLanguages,
708  PDWORD pdwAttributes)
709 {
710  DPRINT1("%x %p %p %p %p\n", dwFlags, pwmszLanguage, pwszFallbackLanguages, pcchFallbackLanguages, pdwAttributes);
712  return FALSE;
713 }
714 
715 
716 /*
717  * @unimplemented
718  */
719 BOOL
720 WINAPI
722  DWORD dwFlags,
723  PULONG pulNumLanguages,
724  PZZWSTR pwszLanguagesBuffer,
725  PULONG pcchLanguagesBuffer)
726 {
727  DPRINT1("%x %p %p %p\n", dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer);
729  return FALSE;
730 }
731 
732 /*
733  * @unimplemented
734  */
735 #if 0 // Tis is Windows 7+
736 BOOL
737 WINAPI
738 SetProcessPreferredUILanguages(
739  DWORD dwFlags,
740  PCZZWSTR pwszLanguagesBuffer,
741  PULONG pulNumLanguages)
742 {
743  DPRINT1("%x %p %p\n", dwFlags, pwszLanguagesBuffer, pulNumLanguages);
745  return FALSE;
746 }
747 #endif
748 
749 /*
750  * @unimplemented
751  */
752 BOOL
753 WINAPI
755  DWORD dwFlags,
756  PCZZWSTR pwszLanguagesBuffer,
757  PULONG pulNumLanguages
758  )
759 {
760  DPRINT1("%x %p %p\n", dwFlags, pwszLanguagesBuffer, pulNumLanguages);
762  return FALSE;
763 }
764 
BOOL WINAPI GetSystemPreferredUILanguages(DWORD dwFlags, PULONG pulNumLanguages, PZZWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer)
Definition: vista.c:659
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
BOOL WINAPI GetUILanguageInfo(DWORD dwFlags, PCZZWSTR pwmszLanguage, PZZWSTR pwszFallbackLanguages, PDWORD pcchFallbackLanguages, PDWORD pdwAttributes)
Definition: vista.c:703
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
BOOLEAN NTAPI CreateSymbolicLinkA(IN LPCSTR lpSymlinkFileName, IN LPCSTR lpTargetFileName, IN DWORD dwFlags)
Definition: vista.c:418
HRESULT WINAPI ApplicationRecoveryInProgress(OUT PBOOL pbCancelled)
Definition: vista.c:175
NTSTATUS NTAPI NtSetInformationFile(HANDLE hFile, PIO_STATUS_BLOCK io, PVOID ptr, ULONG len, FILE_INFORMATION_CLASS FileInformationClass)
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WideCharToMultiByte
Definition: compat.h:111
#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
#define TRUE
Definition: types.h:120
DWORD WINAPI GetFinalPathNameByHandleW(IN HANDLE hFile, OUT LPWSTR lpszFilePath, IN DWORD cchFilePath, IN DWORD dwFlags)
Definition: vista.c:453
BOOL WINAPI QueryFullProcessImageNameA(HANDLE hProcess, DWORD dwFlags, LPSTR lpExeName, PDWORD pdwSize)
Definition: vista.c:92
uint16_t * PWSTR
Definition: typedefs.h:56
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
#define CP_ACP
Definition: compat.h:109
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:590
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
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:81
uint16_t * PWCHAR
Definition: typedefs.h:56
_NullNull_terminated_ CONST WCHAR * PCZZWSTR
Definition: ntbasedef.h:422
_NullNull_terminated_ WCHAR * PZZWSTR
Definition: ntbasedef.h:421
BOOL WINAPI SetFileBandwidthReservation(IN HANDLE hFile, IN DWORD nPeriodMilliseconds, IN DWORD nBytesPerPeriod, IN BOOL bDiscardable, OUT LPDWORD lpTransferSize, OUT LPDWORD lpNumOutstandingRequests)
Definition: vista.c:543
char * LPSTR
Definition: xmlstorage.h:182
#define NO_ERROR
Definition: dderror.h:5
#define E_FAIL
Definition: ddrawi.h:102
static LPFILE_ID_DESCRIPTOR
Definition: file.c:37
static BOOLEAN bSuccess
Definition: drive.cpp:419
#define FILE_WRITE_ATTRIBUTES
Definition: nt_native.h:649
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
static DWORD LPSTR lpExeName
Definition: process.c:72
WCHAR PathBuffer[1]
Definition: shellext.h:176
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
unsigned char * LPBYTE
Definition: typedefs.h:53
DWORD FilenameU2A_FitOrFail(LPSTR DestA, INT destLen, PUNICODE_STRING SourceU)
Definition: fileutils.c:56
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
HRESULT WINAPI RegisterApplicationRecoveryCallback(IN APPLICATION_RECOVERY_CALLBACK pRecoveryCallback, IN PVOID pvParameter OPTIONAL, DWORD dwPingInterval, DWORD dwFlags)
Definition: vista.c:187
unsigned int BOOL
Definition: ntddk_ex.h:94
#define REPARSE_DATA_BUFFER_HEADER_SIZE
Definition: vista.c:17
unsigned char BOOLEAN
_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
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
HRESULT WINAPI GetApplicationRestart(IN HANDLE hProcess, OUT PWSTR pwzCommandline OPTIONAL, IN OUT PDWORD pcchSize, OUT PDWORD pdwFlags OPTIONAL)
Definition: vista.c:149
DWORD dwErr
Definition: service.c:36
BOOLEAN WINAPI CreateSymbolicLinkW(IN LPCWSTR lpSymlinkFileName, IN LPCWSTR lpTargetFileName, IN DWORD dwFlags)
Definition: vista.c:215
Status
Definition: gdiplustypes.h:24
HANDLE WINAPI OpenFileById(IN HANDLE hFile, IN LPFILE_ID_DESCRIPTOR lpFileID, IN DWORD dwDesiredAccess, IN DWORD dwShareMode, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes OPTIONAL, IN DWORD dwFlags)
Definition: vista.c: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)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LONG HRESULT
Definition: typedefs.h:79
#define MAX_PATH
Definition: compat.h:34
#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:611
LANGID WINAPI GetThreadUILanguage(VOID)
Definition: vista.c:691
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
PWCHAR FilenameA2W(LPCSTR NameA, BOOL alloc)
Definition: fileutils.c:18
DWORD WINAPI GetFinalPathNameByHandleA(IN HANDLE hFile, OUT LPSTR lpszFilePath, IN DWORD cchFilePath, IN DWORD dwFlags)
Definition: vista.c:475
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
BOOL WINAPI GetFileBandwidthReservation(IN HANDLE hFile, OUT LPDWORD lpPeriodMilliseconds, OUT LPDWORD lpBytesPerPeriod, OUT LPBOOL pDiscardable, OUT LPDWORD lpTransferSize, OUT LPDWORD lpNumOutstandingRequests)
Definition: vista.c:560
USHORT ReparseDataLength
Definition: shellext.h:166
BOOL WINAPI GetThreadPreferredUILanguages(DWORD dwFlags, PULONG pulNumLanguages, PZZWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer)
Definition: vista.c:675
_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
static const WCHAR Cleanup[]
Definition: register.c:80
#define SYNCHRONIZE
Definition: nt_native.h:61
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned char BYTE
Definition: xxhash.c:193
ULONG_PTR SIZE_T
Definition: typedefs.h:80
VOID WINAPI ApplicationRecoveryFinished(IN BOOL bSuccess)
Definition: vista.c:164
BOOL WINAPI GetFileMUIPath(DWORD dwFlags, PCWSTR pcwszFilePath, PWSTR pwszLanguage, PULONG pcchLanguage, PWSTR pwszFileMUIPath, PULONG pcchFileMUIPath, PULONGLONG pululEnumerator)
Definition: vista.c:622
BOOL * LPBOOL
Definition: windef.h:162
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
BOOL WINAPI GetUserPreferredUILanguages(DWORD dwFlags, PULONG pulNumLanguages, PZZWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer)
Definition: vista.c:721
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
HRESULT WINAPI GetApplicationRecoveryCallback(IN HANDLE hProcess, OUT APPLICATION_RECOVERY_CALLBACK *pRecoveryCallback, OUT PVOID *ppvParameter, PDWORD dwPingInterval, PDWORD dwFlags)
Definition: vista.c:133
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL WINAPI QueryFullProcessImageNameW(HANDLE hProcess, DWORD dwFlags, LPWSTR lpExeName, PDWORD pdwSize)
Definition: vista.c:29
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:384
uint32_t * LPDWORD
Definition: typedefs.h:59
unsigned int ULONG
Definition: retypes.h:1
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define UNIMPLEMENTED
Definition: debug.h:115
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define FSCTL_SET_REPARSE_POINT
Definition: winioctl.h:98
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL WINAPI SetThreadPreferredUILanguages(DWORD dwFlags, PCZZWSTR pwszLanguagesBuffer, PULONG pulNumLanguages)
Definition: vista.c:754
#define FILE_OPEN_REPARSE_POINT
Definition: from_kernel.h:46
BYTE * PBYTE
Definition: pedump.c:66
#define IO_REPARSE_TAG_SYMLINK
Definition: iotypes.h:7219
HRESULT WINAPI RegisterApplicationRestart(IN PCWSTR pwzCommandline OPTIONAL, IN DWORD dwFlags)
Definition: vista.c:202
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
NTSYSAPI RTL_PATH_TYPE NTAPI RtlDetermineDosPathNameType_U(_In_ PCWSTR Path)
BOOL WINAPI GetFileMUIInfo(DWORD dwFlags, PCWSTR pcwszFilePath, PFILEMUIINFO pFileMUIInfo, DWORD *pcbFileMUIInfo)
Definition: vista.c:606
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68