ReactOS 0.4.15-dev-7711-g5627da4
vista.c File Reference
#include <k32_vista.h>
#include <debug.h>
Include dependency graph for vista.c:

Go to the source code of this file.

Macros

#define REPARSE_DATA_BUFFER_HEADER_SIZE   FIELD_OFFSET(REPARSE_DATA_BUFFER, GenericReparseBuffer)
 
#define NDEBUG
 

Functions

BOOL WINAPI QueryFullProcessImageNameW (HANDLE hProcess, DWORD dwFlags, LPWSTR lpExeName, PDWORD pdwSize)
 
BOOL WINAPI QueryFullProcessImageNameA (HANDLE hProcess, DWORD dwFlags, LPSTR lpExeName, PDWORD pdwSize)
 
HRESULT WINAPI GetApplicationRecoveryCallback (IN HANDLE hProcess, OUT APPLICATION_RECOVERY_CALLBACK *pRecoveryCallback, OUT PVOID *ppvParameter, PDWORD dwPingInterval, PDWORD dwFlags)
 
HRESULT WINAPI GetApplicationRestart (IN HANDLE hProcess, OUT PWSTR pwzCommandline OPTIONAL, IN OUT PDWORD pcchSize, OUT PDWORD pdwFlags OPTIONAL)
 
VOID WINAPI ApplicationRecoveryFinished (IN BOOL bSuccess)
 
HRESULT WINAPI ApplicationRecoveryInProgress (OUT PBOOL pbCancelled)
 
HRESULT WINAPI RegisterApplicationRecoveryCallback (IN APPLICATION_RECOVERY_CALLBACK pRecoveryCallback, IN PVOID pvParameter OPTIONAL, DWORD dwPingInterval, DWORD dwFlags)
 
HRESULT WINAPI RegisterApplicationRestart (IN PCWSTR pwzCommandline OPTIONAL, IN DWORD dwFlags)
 
BOOLEAN WINAPI CreateSymbolicLinkW (IN LPCWSTR lpSymlinkFileName, IN LPCWSTR lpTargetFileName, IN DWORD dwFlags)
 
BOOLEAN NTAPI CreateSymbolicLinkA (IN LPCSTR lpSymlinkFileName, IN LPCSTR lpTargetFileName, IN DWORD dwFlags)
 
DWORD WINAPI GetFinalPathNameByHandleW (IN HANDLE hFile, OUT LPWSTR lpszFilePath, IN DWORD cchFilePath, IN DWORD dwFlags)
 
DWORD WINAPI GetFinalPathNameByHandleA (IN HANDLE hFile, OUT LPSTR lpszFilePath, IN DWORD cchFilePath, IN DWORD dwFlags)
 
BOOL WINAPI SetFileBandwidthReservation (IN HANDLE hFile, IN DWORD nPeriodMilliseconds, IN DWORD nBytesPerPeriod, IN BOOL bDiscardable, OUT LPDWORD lpTransferSize, OUT LPDWORD lpNumOutstandingRequests)
 
BOOL WINAPI GetFileBandwidthReservation (IN HANDLE hFile, OUT LPDWORD lpPeriodMilliseconds, OUT LPDWORD lpBytesPerPeriod, OUT LPBOOL pDiscardable, OUT LPDWORD lpTransferSize, OUT LPDWORD lpNumOutstandingRequests)
 
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)
 
BOOL WINAPI GetFileMUIInfo (DWORD dwFlags, PCWSTR pcwszFilePath, PFILEMUIINFO pFileMUIInfo, DWORD *pcbFileMUIInfo)
 
BOOL WINAPI GetFileMUIPath (DWORD dwFlags, PCWSTR pcwszFilePath, PWSTR pwszLanguage, PULONG pcchLanguage, PWSTR pwszFileMUIPath, PULONG pcchFileMUIPath, PULONGLONG pululEnumerator)
 
BOOL WINAPI GetSystemPreferredUILanguages (DWORD dwFlags, PULONG pulNumLanguages, PZZWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer)
 
BOOL WINAPI GetThreadPreferredUILanguages (DWORD dwFlags, PULONG pulNumLanguages, PZZWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer)
 
LANGID WINAPI GetThreadUILanguage (VOID)
 
BOOL WINAPI GetUILanguageInfo (DWORD dwFlags, PCZZWSTR pwmszLanguage, PZZWSTR pwszFallbackLanguages, PDWORD pcchFallbackLanguages, PDWORD pdwAttributes)
 
BOOL WINAPI GetUserPreferredUILanguages (DWORD dwFlags, PULONG pulNumLanguages, PZZWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer)
 
BOOL WINAPI SetThreadPreferredUILanguages (DWORD dwFlags, PCZZWSTR pwszLanguagesBuffer, PULONG pulNumLanguages)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 19 of file vista.c.

◆ REPARSE_DATA_BUFFER_HEADER_SIZE

#define REPARSE_DATA_BUFFER_HEADER_SIZE   FIELD_OFFSET(REPARSE_DATA_BUFFER, GenericReparseBuffer)

Definition at line 17 of file vista.c.

Function Documentation

◆ ApplicationRecoveryFinished()

VOID WINAPI ApplicationRecoveryFinished ( IN BOOL  bSuccess)

Definition at line 164 of file vista.c.

165{
167}
#define UNIMPLEMENTED
Definition: debug.h:115

◆ ApplicationRecoveryInProgress()

HRESULT WINAPI ApplicationRecoveryInProgress ( OUT PBOOL  pbCancelled)

Definition at line 175 of file vista.c.

176{
178 return E_FAIL;
179}
#define E_FAIL
Definition: ddrawi.h:102

◆ CreateSymbolicLinkA()

BOOLEAN NTAPI CreateSymbolicLinkA ( IN LPCSTR  lpSymlinkFileName,
IN LPCSTR  lpTargetFileName,
IN DWORD  dwFlags 
)

Definition at line 418 of file vista.c.

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}
unsigned char BOOLEAN
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
PWCHAR FilenameA2W(LPCSTR NameA, BOOL alloc)
Definition: fileutils.c:18
BOOLEAN WINAPI CreateSymbolicLinkW(IN LPCWSTR lpSymlinkFileName, IN LPCWSTR lpTargetFileName, IN DWORD dwFlags)
Definition: vista.c:215
uint16_t * PWCHAR
Definition: typedefs.h:56
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ CreateSymbolicLinkW()

BOOLEAN WINAPI CreateSymbolicLinkW ( IN LPCWSTR  lpSymlinkFileName,
IN LPCWSTR  lpTargetFileName,
IN DWORD  dwFlags 
)

Definition at line 215 of file vista.c.

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 {
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 {
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 {
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,
344 NULL,
346 0,
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,
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
385Cleanup:
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}
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
#define FILE_NON_DIRECTORY_FILE
Definition: constants.h:492
DWORD dwErr
Definition: service.c:36
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define NO_ERROR
Definition: dderror.h:5
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
static const WCHAR Cleanup[]
Definition: register.c:80
unsigned long DWORD
Definition: ntddk_ex.h:95
@ FileDispositionInformation
Definition: from_kernel.h:74
#define FILE_CREATE
Definition: from_kernel.h:55
#define FILE_OPEN_REPARSE_POINT
Definition: from_kernel.h:46
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
Status
Definition: gdiplustypes.h:25
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define REPARSE_DATA_BUFFER_HEADER_SIZE
Definition: vista.c:17
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
NTSYSAPI RTL_PATH_TYPE NTAPI RtlDetermineDosPathNameType_U(_In_ PCWSTR Path)
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)
@ RtlPathTypeRootLocalDevice
Definition: rtltypes.h:478
@ RtlPathTypeDriveRelative
Definition: rtltypes.h:474
@ 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
@ RtlPathTypeUnknown
Definition: rtltypes.h:471
#define SYNCHRONIZE
Definition: nt_native.h:61
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI NtSetInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
Definition: iofunc.c:3096
#define FILE_WRITE_ATTRIBUTES
Definition: nt_native.h:649
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
#define DELETE
Definition: nt_native.h:57
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
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)
NTSYSAPI NTSTATUS NTAPI NtFsControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
BYTE * PBYTE
Definition: pedump.c:66
unsigned short USHORT
Definition: pedump.c:61
#define FSCTL_SET_REPARSE_POINT
Definition: winioctl.h:98
WCHAR PathBuffer[1]
Definition: shellext.h:176
struct _REPARSE_DATA_BUFFER::@319::@321 SymbolicLinkReparseBuffer
USHORT ReparseDataLength
Definition: shellext.h:166
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG
Definition: typedefs.h:59
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define IO_REPARSE_TAG_SYMLINK
Definition: iotypes.h:7240
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CreateSymbolicLinkA().

◆ GetApplicationRecoveryCallback()

HRESULT WINAPI GetApplicationRecoveryCallback ( IN HANDLE  hProcess,
OUT APPLICATION_RECOVERY_CALLBACK *  pRecoveryCallback,
OUT PVOID ppvParameter,
PDWORD  dwPingInterval,
PDWORD  dwFlags 
)

Definition at line 133 of file vista.c.

138{
140 return E_FAIL;
141}

◆ GetApplicationRestart()

HRESULT WINAPI GetApplicationRestart ( IN HANDLE  hProcess,
OUT PWSTR pwzCommandline  OPTIONAL,
IN OUT PDWORD  pcchSize,
OUT PDWORD pdwFlags  OPTIONAL 
)

Definition at line 149 of file vista.c.

153{
155 return E_FAIL;
156}

◆ GetFileBandwidthReservation()

BOOL WINAPI GetFileBandwidthReservation ( IN HANDLE  hFile,
OUT LPDWORD  lpPeriodMilliseconds,
OUT LPDWORD  lpBytesPerPeriod,
OUT LPBOOL  pDiscardable,
OUT LPDWORD  lpTransferSize,
OUT LPDWORD  lpNumOutstandingRequests 
)

Definition at line 560 of file vista.c.

566{
568 return FALSE;
569}

◆ GetFileMUIInfo()

BOOL WINAPI GetFileMUIInfo ( DWORD  dwFlags,
PCWSTR  pcwszFilePath,
PFILEMUIINFO  pFileMUIInfo,
DWORD pcbFileMUIInfo 
)

Definition at line 606 of file vista.c.

611{
612 DPRINT1("%x %p %p %p\n", dwFlags, pcwszFilePath, pFileMUIInfo, pcbFileMUIInfo);
614 return FALSE;
615}
#define DPRINT1
Definition: precomp.h:8
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ GetFileMUIPath()

BOOL WINAPI GetFileMUIPath ( DWORD  dwFlags,
PCWSTR  pcwszFilePath,
PWSTR  pwszLanguage,
PULONG  pcchLanguage,
PWSTR  pwszFileMUIPath,
PULONG  pcchFileMUIPath,
PULONGLONG  pululEnumerator 
)

Definition at line 622 of file vista.c.

630{
631 DPRINT1("%x %p %p %p %p %p\n", dwFlags, pcwszFilePath, pwszLanguage, pwszFileMUIPath, pcchFileMUIPath, pululEnumerator);
633 return FALSE;
634}

◆ GetFinalPathNameByHandleA()

DWORD WINAPI GetFinalPathNameByHandleA ( IN HANDLE  hFile,
OUT LPSTR  lpszFilePath,
IN DWORD  cchFilePath,
IN DWORD  dwFlags 
)

Definition at line 475 of file vista.c.

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
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}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MAX_PATH
Definition: compat.h:34
DWORD FilenameU2A_FitOrFail(LPSTR DestA, INT destLen, PUNICODE_STRING SourceU)
Definition: fileutils.c:56
DWORD WINAPI GetFinalPathNameByHandleW(IN HANDLE hFile, OUT LPWSTR lpszFilePath, IN DWORD cchFilePath, IN DWORD dwFlags)
Definition: vista.c:453
_In_ HANDLE hFile
Definition: mswsock.h:90
USHORT MaximumLength
Definition: env_spec_w32.h:370

◆ GetFinalPathNameByHandleW()

DWORD WINAPI GetFinalPathNameByHandleW ( IN HANDLE  hFile,
OUT LPWSTR  lpszFilePath,
IN DWORD  cchFilePath,
IN DWORD  dwFlags 
)

Definition at line 453 of file vista.c.

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}

Referenced by GetFinalPathNameByHandleA().

◆ GetSystemPreferredUILanguages()

BOOL WINAPI GetSystemPreferredUILanguages ( DWORD  dwFlags,
PULONG  pulNumLanguages,
PZZWSTR  pwszLanguagesBuffer,
PULONG  pcchLanguagesBuffer 
)

Definition at line 659 of file vista.c.

664{
665 DPRINT1("%x %p %p %p\n", dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer);
667 return FALSE;
668}

Referenced by InitFunctionPointers().

◆ GetThreadPreferredUILanguages()

BOOL WINAPI GetThreadPreferredUILanguages ( DWORD  dwFlags,
PULONG  pulNumLanguages,
PZZWSTR  pwszLanguagesBuffer,
PULONG  pcchLanguagesBuffer 
)

Definition at line 675 of file vista.c.

680{
681 DPRINT1("%x %p %p %p\n", dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer);
683 return FALSE;
684}

Referenced by InitFunctionPointers().

◆ GetThreadUILanguage()

LANGID WINAPI GetThreadUILanguage ( VOID  )

Definition at line 691 of file vista.c.

692{
695 return 0;
696}

◆ GetUILanguageInfo()

BOOL WINAPI GetUILanguageInfo ( DWORD  dwFlags,
PCZZWSTR  pwmszLanguage,
PZZWSTR  pwszFallbackLanguages,
PDWORD  pcchFallbackLanguages,
PDWORD  pdwAttributes 
)

Definition at line 703 of file vista.c.

709{
710 DPRINT1("%x %p %p %p %p\n", dwFlags, pwmszLanguage, pwszFallbackLanguages, pcchFallbackLanguages, pdwAttributes);
712 return FALSE;
713}

◆ GetUserPreferredUILanguages()

BOOL WINAPI GetUserPreferredUILanguages ( DWORD  dwFlags,
PULONG  pulNumLanguages,
PZZWSTR  pwszLanguagesBuffer,
PULONG  pcchLanguagesBuffer 
)

Definition at line 721 of file vista.c.

726{
727 DPRINT1("%x %p %p %p\n", dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer);
729 return FALSE;
730}

Referenced by InitFunctionPointers().

◆ OpenFileById()

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 at line 577 of file vista.c.

583{
586}
#define INVALID_HANDLE_VALUE
Definition: compat.h:731

◆ QueryFullProcessImageNameA()

BOOL WINAPI QueryFullProcessImageNameA ( HANDLE  hProcess,
DWORD  dwFlags,
LPSTR  lpExeName,
PDWORD  pdwSize 
)

Definition at line 92 of file vista.c.

96{
97 DWORD pdwSizeW = *pdwSize;
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)
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}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI QueryFullProcessImageNameW(HANDLE hProcess, DWORD dwFlags, LPWSTR lpExeName, PDWORD pdwSize)
Definition: vista.c:29
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:71
static DWORD LPSTR lpExeName
Definition: process.c:72
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
_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

◆ QueryFullProcessImageNameW()

BOOL WINAPI QueryFullProcessImageNameW ( HANDLE  hProcess,
DWORD  dwFlags,
LPWSTR  lpExeName,
PDWORD  pdwSize 
)

Definition at line 29 of file vista.c.

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
76 RtlFreeHeap(RtlGetProcessHeap(), 0, DynamicBuffer);
77
78 if (!NT_SUCCESS(Status))
79 {
81 }
82
83 return !Status;
84}
Definition: bufpool.h:45
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
struct _UNICODE_STRING UNICODE_STRING
@ ProcessImageFileName
Definition: winternl.h:397
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
Definition: query.c:59
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
unsigned char * LPBYTE
Definition: typedefs.h:53
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
unsigned char BYTE
Definition: xxhash.c:193

Referenced by QueryFullProcessImageNameA().

◆ RegisterApplicationRecoveryCallback()

HRESULT WINAPI RegisterApplicationRecoveryCallback ( IN APPLICATION_RECOVERY_CALLBACK  pRecoveryCallback,
IN PVOID pvParameter  OPTIONAL,
DWORD  dwPingInterval,
DWORD  dwFlags 
)

Definition at line 187 of file vista.c.

191{
193 return E_FAIL;
194}

◆ RegisterApplicationRestart()

HRESULT WINAPI RegisterApplicationRestart ( IN PCWSTR pwzCommandline  OPTIONAL,
IN DWORD  dwFlags 
)

Definition at line 202 of file vista.c.

204{
206 return E_FAIL;
207}

◆ SetFileBandwidthReservation()

BOOL WINAPI SetFileBandwidthReservation ( IN HANDLE  hFile,
IN DWORD  nPeriodMilliseconds,
IN DWORD  nBytesPerPeriod,
IN BOOL  bDiscardable,
OUT LPDWORD  lpTransferSize,
OUT LPDWORD  lpNumOutstandingRequests 
)

Definition at line 543 of file vista.c.

549{
551 return FALSE;
552}

◆ SetThreadPreferredUILanguages()

BOOL WINAPI SetThreadPreferredUILanguages ( DWORD  dwFlags,
PCZZWSTR  pwszLanguagesBuffer,
PULONG  pulNumLanguages 
)

Definition at line 754 of file vista.c.

759{
760 DPRINT1("%x %p %p\n", dwFlags, pwszLanguagesBuffer, pulNumLanguages);
762 return FALSE;
763}