diff --git a/reactos/dll/win32/kernel32/CMakeLists.txt b/reactos/dll/win32/kernel32/CMakeLists.txt index 4c08677e5ff..e1e46e7bffa 100644 --- a/reactos/dll/win32/kernel32/CMakeLists.txt +++ b/reactos/dll/win32/kernel32/CMakeLists.txt @@ -1,13 +1,6 @@ add_definitions(-D_KERNEL32_) -add_definitions(-DHeapAlloc=RtlAllocateHeap) -add_definitions(-DHeapFree=RtlFreeHeap) -add_definitions(-DGetProcessHeap=RtlGetProcessHeap) - -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - include_directories(${REACTOS_SOURCE_DIR}/include/reactos/subsys) set_rc_compiler() diff --git a/reactos/dll/win32/kernel32/client/file/console.c b/reactos/dll/win32/kernel32/client/file/console.c index 2fc95b58d5f..bccbe58b8a1 100644 --- a/reactos/dll/win32/kernel32/client/file/console.c +++ b/reactos/dll/win32/kernel32/client/file/console.c @@ -4195,145 +4195,4 @@ GetConsoleInputExeNameA(DWORD nBufferLength, LPSTR lpBuffer) return Ret; } - -/*-------------------------------------------------------------- - * GetConsoleHistoryInfo - * - * @implemented - */ -BOOL -WINAPI -GetConsoleHistoryInfo(PCONSOLE_HISTORY_INFO lpConsoleHistoryInfo) -{ - CSR_API_MESSAGE Request; - ULONG CsrRequest = MAKE_CSR_API(GET_HISTORY_INFO, CSR_CONSOLE); - NTSTATUS Status; - if (lpConsoleHistoryInfo->cbSize != sizeof(CONSOLE_HISTORY_INFO)) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - Status = CsrClientCallServer(&Request, NULL, CsrRequest, sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) - { - SetLastErrorByStatus(Status); - return FALSE; - } - lpConsoleHistoryInfo->HistoryBufferSize = Request.Data.GetHistoryInfo.HistoryBufferSize; - lpConsoleHistoryInfo->NumberOfHistoryBuffers = Request.Data.GetHistoryInfo.NumberOfHistoryBuffers; - lpConsoleHistoryInfo->dwFlags = Request.Data.GetHistoryInfo.dwFlags; - return TRUE; -} - - -/*-------------------------------------------------------------- - * SetConsoleHistoryInfo - * - * @implemented - */ -BOOL -WINAPI -SetConsoleHistoryInfo(IN PCONSOLE_HISTORY_INFO lpConsoleHistoryInfo) -{ - CSR_API_MESSAGE Request; - ULONG CsrRequest = MAKE_CSR_API(GET_HISTORY_INFO, CSR_CONSOLE); - NTSTATUS Status; - if (lpConsoleHistoryInfo->cbSize != sizeof(CONSOLE_HISTORY_INFO)) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - Request.Data.SetHistoryInfo.HistoryBufferSize = lpConsoleHistoryInfo->HistoryBufferSize; - Request.Data.SetHistoryInfo.NumberOfHistoryBuffers = lpConsoleHistoryInfo->NumberOfHistoryBuffers; - Request.Data.SetHistoryInfo.dwFlags = lpConsoleHistoryInfo->dwFlags; - Status = CsrClientCallServer(&Request, NULL, CsrRequest, sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) - { - SetLastErrorByStatus(Status); - return FALSE; - } - return TRUE; -} - - -/*-------------------------------------------------------------- - * GetConsoleOriginalTitleW - * - * @unimplemented - */ -DWORD -WINAPI -GetConsoleOriginalTitleW(OUT LPWSTR lpConsoleTitle, - IN DWORD nSize) -{ - DPRINT1("GetConsoleOriginalTitleW(0x%p, 0x%x) UNIMPLEMENTED!\n", lpConsoleTitle, nSize); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/*-------------------------------------------------------------- - * GetConsoleOriginalTitleA - * - * @unimplemented - */ -DWORD -WINAPI -GetConsoleOriginalTitleA(OUT LPSTR lpConsoleTitle, - IN DWORD nSize) -{ - DPRINT1("GetConsoleOriginalTitleA(0x%p, 0x%x) UNIMPLEMENTED!\n", lpConsoleTitle, nSize); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/*-------------------------------------------------------------- - * GetConsoleScreenBufferInfoEx - * - * @unimplemented - */ -BOOL -WINAPI -GetConsoleScreenBufferInfoEx(IN HANDLE hConsoleOutput, - OUT PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx) -{ - DPRINT1("GetConsoleScreenBufferInfoEx(0x%p, 0x%p) UNIMPLEMENTED!\n", hConsoleOutput, lpConsoleScreenBufferInfoEx); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/*-------------------------------------------------------------- - * SetConsoleScreenBufferInfoEx - * - * @unimplemented - */ -BOOL -WINAPI -SetConsoleScreenBufferInfoEx(IN HANDLE hConsoleOutput, - IN PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx) -{ - DPRINT1("SetConsoleScreenBufferInfoEx(0x%p, 0x%p) UNIMPLEMENTED!\n", hConsoleOutput, lpConsoleScreenBufferInfoEx); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/*-------------------------------------------------------------- - * GetCurrentConsoleFontEx - * - * @unimplemented - */ -BOOL -WINAPI -GetCurrentConsoleFontEx(IN HANDLE hConsoleOutput, - IN BOOL bMaximumWindow, - OUT PCONSOLE_FONT_INFOEX lpConsoleCurrentFontEx) -{ - DPRINT1("GetCurrentConsoleFontEx(0x%p, 0x%x, 0x%p) UNIMPLEMENTED!\n", hConsoleOutput, bMaximumWindow, lpConsoleCurrentFontEx); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - /* EOF */ diff --git a/reactos/dll/win32/kernel32/client/file/create.c b/reactos/dll/win32/kernel32/client/file/create.c index 8da66358bd6..ce7c9983118 100644 --- a/reactos/dll/win32/kernel32/client/file/create.c +++ b/reactos/dll/win32/kernel32/client/file/create.c @@ -371,243 +371,4 @@ HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, return FileHandle; } - -/* - * @implemented - */ -BOOLEAN -WINAPI -CreateSymbolicLinkW(IN LPCWSTR lpSymlinkFileName, - IN LPCWSTR lpTargetFileName, - IN DWORD dwFlags) -{ - IO_STATUS_BLOCK IoStatusBlock; - OBJECT_ATTRIBUTES ObjectAttributes; - HANDLE hSymlink = NULL; - UNICODE_STRING SymlinkFileName = { 0, 0, NULL }; - UNICODE_STRING TargetFileName = { 0, 0, NULL }; - BOOLEAN bAllocatedTarget = FALSE, bRelativePath = FALSE; - LPWSTR lpTargetFullFileName = NULL; - SIZE_T cbPrintName; - SIZE_T cbReparseData; - PREPARSE_DATA_BUFFER pReparseData = NULL; - PBYTE pBufTail; - NTSTATUS Status; - ULONG dwCreateOptions; - DWORD dwErr; - - if(!lpSymlinkFileName || !lpTargetFileName || (dwFlags | SYMBOLIC_LINK_FLAG_DIRECTORY) != SYMBOLIC_LINK_FLAG_DIRECTORY) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - if(dwFlags & SYMBOLIC_LINK_FLAG_DIRECTORY) - dwCreateOptions = FILE_DIRECTORY_FILE; - else - dwCreateOptions = FILE_NON_DIRECTORY_FILE; - - switch(RtlDetermineDosPathNameType_U(lpTargetFileName)) - { - case RtlPathTypeUnknown: - case RtlPathTypeRooted: - case RtlPathTypeRelative: - bRelativePath = TRUE; - RtlInitUnicodeString(&TargetFileName, lpTargetFileName); - break; - - case RtlPathTypeDriveRelative: - { - LPWSTR FilePart; - SIZE_T cchTargetFullFileName; - - cchTargetFullFileName = GetFullPathNameW(lpTargetFileName, 0, NULL, &FilePart); - - if(cchTargetFullFileName == 0) - { - dwErr = GetLastError(); - goto Cleanup; - } - - lpTargetFullFileName = RtlAllocateHeap(RtlGetProcessHeap(), 0, cchTargetFullFileName * sizeof(WCHAR)); - - if(lpTargetFullFileName == NULL) - { - dwErr = ERROR_NOT_ENOUGH_MEMORY; - goto Cleanup; - } - - if(GetFullPathNameW(lpTargetFileName, cchTargetFullFileName, lpTargetFullFileName, &FilePart) == 0) - { - dwErr = GetLastError(); - goto Cleanup; - } - } - - lpTargetFileName = lpTargetFullFileName; - - // fallthrough - - case RtlPathTypeUncAbsolute: - case RtlPathTypeDriveAbsolute: - case RtlPathTypeLocalDevice: - case RtlPathTypeRootLocalDevice: - default: - if(!RtlDosPathNameToNtPathName_U(lpTargetFileName, &TargetFileName, NULL, NULL)) - { - bAllocatedTarget = TRUE; - dwErr = ERROR_INVALID_PARAMETER; - goto Cleanup; - } - } - - cbPrintName = wcslen(lpTargetFileName) * sizeof(WCHAR); - cbReparseData = FIELD_OFFSET(REPARSE_DATA_BUFFER, SymbolicLinkReparseBuffer.PathBuffer) + TargetFileName.Length + cbPrintName; - pReparseData = RtlAllocateHeap(RtlGetProcessHeap(), 0, cbReparseData); - - if(pReparseData == NULL) - { - dwErr = ERROR_NOT_ENOUGH_MEMORY; - goto Cleanup; - } - - pBufTail = (PBYTE)(pReparseData->SymbolicLinkReparseBuffer.PathBuffer); - - pReparseData->ReparseTag = (ULONG)IO_REPARSE_TAG_SYMLINK; - pReparseData->ReparseDataLength = (USHORT)cbReparseData - REPARSE_DATA_BUFFER_HEADER_SIZE; - pReparseData->Reserved = 0; - - pReparseData->SymbolicLinkReparseBuffer.SubstituteNameOffset = 0; - pReparseData->SymbolicLinkReparseBuffer.SubstituteNameLength = TargetFileName.Length; - pBufTail += pReparseData->SymbolicLinkReparseBuffer.SubstituteNameOffset; - RtlCopyMemory(pBufTail, TargetFileName.Buffer, TargetFileName.Length); - - pReparseData->SymbolicLinkReparseBuffer.PrintNameOffset = pReparseData->SymbolicLinkReparseBuffer.SubstituteNameLength; - pReparseData->SymbolicLinkReparseBuffer.PrintNameLength = (USHORT)cbPrintName; - pBufTail += pReparseData->SymbolicLinkReparseBuffer.PrintNameOffset; - RtlCopyMemory(pBufTail, lpTargetFileName, cbPrintName); - - pReparseData->SymbolicLinkReparseBuffer.Flags = 0; - - if(bRelativePath) - pReparseData->SymbolicLinkReparseBuffer.Flags |= 1; // TODO! give this lone flag a name - - if(!RtlDosPathNameToNtPathName_U(lpSymlinkFileName, &SymlinkFileName, NULL, NULL)) - { - dwErr = ERROR_PATH_NOT_FOUND; - goto Cleanup; - } - - InitializeObjectAttributes(&ObjectAttributes, &SymlinkFileName, OBJ_CASE_INSENSITIVE, NULL, NULL); - - Status = NtCreateFile - ( - &hSymlink, - FILE_WRITE_ATTRIBUTES | DELETE | SYNCHRONIZE, - &ObjectAttributes, - &IoStatusBlock, - NULL, - FILE_ATTRIBUTE_NORMAL, - 0, - FILE_CREATE, - FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT | dwCreateOptions, - NULL, - 0 - ); - - if(!NT_SUCCESS(Status)) - { - dwErr = RtlNtStatusToDosError(Status); - goto Cleanup; - } - - Status = NtFsControlFile - ( - hSymlink, - NULL, - NULL, - NULL, - &IoStatusBlock, - FSCTL_SET_REPARSE_POINT, - pReparseData, - cbReparseData, - NULL, - 0 - ); - - if(!NT_SUCCESS(Status)) - { - FILE_DISPOSITION_INFORMATION DispInfo; - DispInfo.DeleteFile = TRUE; - NtSetInformationFile(hSymlink, &IoStatusBlock, &DispInfo, sizeof(DispInfo), FileDispositionInformation); - - dwErr = RtlNtStatusToDosError(Status); - goto Cleanup; - } - - dwErr = NO_ERROR; - -Cleanup: - if(hSymlink) - NtClose(hSymlink); - - RtlFreeUnicodeString(&SymlinkFileName); - if (bAllocatedTarget) - { - RtlFreeHeap(RtlGetProcessHeap(), - 0, - TargetFileName.Buffer); - } - - if(lpTargetFullFileName) - RtlFreeHeap(RtlGetProcessHeap(), 0, lpTargetFullFileName); - - if(pReparseData) - RtlFreeHeap(RtlGetProcessHeap(), 0, pReparseData); - - if(dwErr) - { - SetLastError(dwErr); - return FALSE; - } - - return TRUE; -} - - -/* - * @implemented - */ -BOOLEAN -NTAPI -CreateSymbolicLinkA(IN LPCSTR lpSymlinkFileName, - IN LPCSTR lpTargetFileName, - IN DWORD dwFlags) -{ - PWCHAR SymlinkW, TargetW; - BOOLEAN Ret; - - if(!lpSymlinkFileName || !lpTargetFileName) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - if (!(SymlinkW = FilenameA2W(lpSymlinkFileName, FALSE))) - return FALSE; - - if (!(TargetW = FilenameA2W(lpTargetFileName, TRUE))) - return FALSE; - - Ret = CreateSymbolicLinkW(SymlinkW, - TargetW, - dwFlags); - - RtlFreeHeap(RtlGetProcessHeap(), 0, SymlinkW); - RtlFreeHeap(RtlGetProcessHeap(), 0, TargetW); - - return Ret; -} - - /* EOF */ diff --git a/reactos/dll/win32/kernel32/client/file/file.c b/reactos/dll/win32/kernel32/client/file/file.c index 7f0c0446441..68ed91093b0 100644 --- a/reactos/dll/win32/kernel32/client/file/file.c +++ b/reactos/dll/win32/kernel32/client/file/file.c @@ -1816,166 +1816,6 @@ CheckNameLegalDOS8Dot3A( return TRUE; } - -/* - * @implemented - */ -DWORD -WINAPI -GetFinalPathNameByHandleA(IN HANDLE hFile, - OUT LPSTR lpszFilePath, - IN DWORD cchFilePath, - IN DWORD dwFlags) -{ - WCHAR FilePathW[MAX_PATH]; - UNICODE_STRING FilePathU; - DWORD PrevLastError; - DWORD Ret = 0; - - if (cchFilePath != 0 && - cchFilePath > sizeof(FilePathW) / sizeof(FilePathW[0])) - { - FilePathU.Length = 0; - FilePathU.MaximumLength = (USHORT)cchFilePath * sizeof(WCHAR); - FilePathU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), - 0, - FilePathU.MaximumLength); - if (FilePathU.Buffer == NULL) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - } - else - { - FilePathU.Length = 0; - FilePathU.MaximumLength = sizeof(FilePathW); - FilePathU.Buffer = FilePathW; - } - - /* save the last error code */ - PrevLastError = GetLastError(); - SetLastError(ERROR_SUCCESS); - - /* call the unicode version that does all the work */ - Ret = GetFinalPathNameByHandleW(hFile, - FilePathU.Buffer, - cchFilePath, - dwFlags); - - if (GetLastError() == ERROR_SUCCESS) - { - /* no error, restore the last error code and convert the string */ - SetLastError(PrevLastError); - - Ret = FilenameU2A_FitOrFail(lpszFilePath, - cchFilePath, - &FilePathU); - } - - /* free allocated memory if necessary */ - if (FilePathU.Buffer != FilePathW) - { - RtlFreeHeap(RtlGetProcessHeap(), - 0, - FilePathU.Buffer); - } - - return Ret; -} - - -/* - * @unimplemented - */ -DWORD -WINAPI -GetFinalPathNameByHandleW(IN HANDLE hFile, - OUT LPWSTR lpszFilePath, - IN DWORD cchFilePath, - IN DWORD dwFlags) -{ - if (dwFlags & ~(VOLUME_NAME_DOS | VOLUME_NAME_GUID | VOLUME_NAME_NT | - VOLUME_NAME_NONE | FILE_NAME_NORMALIZED | FILE_NAME_OPENED)) - { - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - - UNIMPLEMENTED; - return 0; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -SetFileBandwidthReservation(IN HANDLE hFile, - IN DWORD nPeriodMilliseconds, - IN DWORD nBytesPerPeriod, - IN BOOL bDiscardable, - OUT LPDWORD lpTransferSize, - OUT LPDWORD lpNumOutstandingRequests) -{ - UNIMPLEMENTED; - return FALSE; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -GetFileBandwidthReservation(IN HANDLE hFile, - OUT LPDWORD lpPeriodMilliseconds, - OUT LPDWORD lpBytesPerPeriod, - OUT LPBOOL pDiscardable, - OUT LPDWORD lpTransferSize, - OUT LPDWORD lpNumOutstandingRequests) -{ - UNIMPLEMENTED; - return FALSE; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -SetFileCompletionNotificationModes(IN HANDLE FileHandle, - IN UCHAR Flags) -{ - if (Flags & ~(FILE_SKIP_COMPLETION_PORT_ON_SUCCESS | FILE_SKIP_SET_EVENT_ON_HANDLE)) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - UNIMPLEMENTED; - return FALSE; -} - - -/* - * @unimplemented - */ -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) -{ - UNIMPLEMENTED; - return INVALID_HANDLE_VALUE; -} - /* * @implemented */ diff --git a/reactos/dll/win32/kernel32/client/misc/comm.c b/reactos/dll/win32/kernel32/client/misc/comm.c index edb4b8753c4..5fb76ac948d 100644 --- a/reactos/dll/win32/kernel32/client/misc/comm.c +++ b/reactos/dll/win32/kernel32/client/misc/comm.c @@ -59,6 +59,9 @@ typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS; #include "wine/debug.h" +#define HeapAlloc RtlAllocateHeap +#define HeapReAlloc RtlReAllocateHeap +#define HeapFree RtlFreeHeap WINE_DEFAULT_DEBUG_CHANNEL(comm); /*********************************************************************** diff --git a/reactos/dll/win32/kernel32/client/misc/lzexpand.c b/reactos/dll/win32/kernel32/client/misc/lzexpand.c index de068ecd91b..1a2bfdc1d6e 100644 --- a/reactos/dll/win32/kernel32/client/misc/lzexpand.c +++ b/reactos/dll/win32/kernel32/client/misc/lzexpand.c @@ -52,6 +52,10 @@ #include "wine/unicode.h" #include "wine/debug.h" +#include "winternl.h" +#define HeapAlloc RtlAllocateHeap +#define HeapReAlloc RtlReAllocateHeap +#define HeapFree RtlFreeHeap WINE_DEFAULT_DEBUG_CHANNEL(file); /* The readahead length of the decompressor. Reading single bytes diff --git a/reactos/dll/win32/kernel32/client/misc/profile.c b/reactos/dll/win32/kernel32/client/misc/profile.c index 8a11132b58f..7e2981b18d2 100644 --- a/reactos/dll/win32/kernel32/client/misc/profile.c +++ b/reactos/dll/win32/kernel32/client/misc/profile.c @@ -34,6 +34,9 @@ #include "wine/library.h" #include "wine/debug.h" +#define HeapAlloc RtlAllocateHeap +#define HeapReAlloc RtlReAllocateHeap +#define HeapFree RtlFreeHeap WINE_DEFAULT_DEBUG_CHANNEL(profile); static const char bom_utf8[] = {0xEF,0xBB,0xBF}; diff --git a/reactos/dll/win32/kernel32/client/misc/res.c b/reactos/dll/win32/kernel32/client/misc/res.c index 3472d6486ea..82ed63ac9b6 100644 --- a/reactos/dll/win32/kernel32/client/misc/res.c +++ b/reactos/dll/win32/kernel32/client/misc/res.c @@ -37,6 +37,9 @@ #include "wine/unicode.h" #include "wine/list.h" +#define HeapAlloc RtlAllocateHeap +#define HeapReAlloc RtlReAllocateHeap +#define HeapFree RtlFreeHeap WINE_DEFAULT_DEBUG_CHANNEL(resource); /* we don't want to include winuser.h just for this */ diff --git a/reactos/dll/win32/kernel32/client/misc/time.c b/reactos/dll/win32/kernel32/client/misc/time.c index 5912cfc823b..c279a2fb229 100644 --- a/reactos/dll/win32/kernel32/client/misc/time.c +++ b/reactos/dll/win32/kernel32/client/misc/time.c @@ -602,40 +602,24 @@ DWORD WINAPI GetTickCount(VOID) { - /* Call the 64-bit version */ - return (DWORD)GetTickCount64(); -} + ULARGE_INTEGER TickCount; - -/* - * @implemented - */ -ULONGLONG -WINAPI -GetTickCount64(VOID) -{ - ULONG Multiplier; - LARGE_INTEGER TickCount; - - /* Loop until we get a perfect match */ - for (;;) + while (TRUE) { - /* Read the tick count value */ - TickCount.HighPart = SharedUserData->TickCount.High1Time; + TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time; TickCount.LowPart = SharedUserData->TickCount.LowPart; - if (TickCount.HighPart == SharedUserData->TickCount.High2Time) break; + + if (TickCount.HighPart == (ULONG)SharedUserData->TickCount.High2Time) + break; + YieldProcessor(); } - /* Get the multiplier */ - Multiplier = SharedUserData->TickCountMultiplier; + return (ULONG)((UInt32x32To64(TickCount.LowPart, SharedUserData->TickCountMultiplier) >> 24) + + UInt32x32To64((TickCount.HighPart << 8) & 0xFFFFFFFF, SharedUserData->TickCountMultiplier)); - /* Convert to milliseconds and return */ - return (Int64ShrlMod32(UInt32x32To64(Multiplier, TickCount.LowPart), 24) + - (Multiplier * (TickCount.HighPart << 8))); } - /* * @implemented */ diff --git a/reactos/dll/win32/kernel32/client/synch.c b/reactos/dll/win32/kernel32/client/synch.c index 891446eac92..65bd7590043 100644 --- a/reactos/dll/win32/kernel32/client/synch.c +++ b/reactos/dll/win32/kernel32/client/synch.c @@ -7,7 +7,8 @@ */ /* INCLUDES *****************************************************************/ - +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x600 #include #define NDEBUG diff --git a/reactos/dll/win32/kernel32/client/vista.c b/reactos/dll/win32/kernel32/client/vista.c index f4e5c33b805..fc5acd01c7a 100644 --- a/reactos/dll/win32/kernel32/client/vista.c +++ b/reactos/dll/win32/kernel32/client/vista.c @@ -9,6 +9,8 @@ #define NDEBUG #include +#if _WIN32_WINNT >= 0x600 + /* FIXME: Move these RTL declarations to the NDK */ NTSTATUS NTAPI @@ -307,3 +309,563 @@ RegisterApplicationRestart(IN PCWSTR pwzCommandline OPTIONAL, return E_FAIL; } +/* + * @implemented + */ +ULONGLONG +WINAPI +GetTickCount64(VOID) +{ + ULARGE_INTEGER TickCount; + + while (TRUE) + { + TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time; + TickCount.LowPart = SharedUserData->TickCount.LowPart; + + if (TickCount.HighPart == (ULONG)SharedUserData->TickCount.High2Time) break; + + YieldProcessor(); + } + + return (UInt32x32To64(TickCount.LowPart, SharedUserData->TickCountMultiplier) >> 24) + + (UInt32x32To64(TickCount.HighPart, SharedUserData->TickCountMultiplier) << 8); +} + +/*-------------------------------------------------------------- + * GetConsoleHistoryInfo + * + * @implemented + */ +BOOL +WINAPI +GetConsoleHistoryInfo(PCONSOLE_HISTORY_INFO lpConsoleHistoryInfo) +{ + CSR_API_MESSAGE Request; + ULONG CsrRequest = MAKE_CSR_API(GET_HISTORY_INFO, CSR_CONSOLE); + NTSTATUS Status; + if (lpConsoleHistoryInfo->cbSize != sizeof(CONSOLE_HISTORY_INFO)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + Status = CsrClientCallServer(&Request, NULL, CsrRequest, sizeof(CSR_API_MESSAGE)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + lpConsoleHistoryInfo->HistoryBufferSize = Request.Data.GetHistoryInfo.HistoryBufferSize; + lpConsoleHistoryInfo->NumberOfHistoryBuffers = Request.Data.GetHistoryInfo.NumberOfHistoryBuffers; + lpConsoleHistoryInfo->dwFlags = Request.Data.GetHistoryInfo.dwFlags; + return TRUE; +} + + +/*-------------------------------------------------------------- + * SetConsoleHistoryInfo + * + * @implemented + */ +BOOL +WINAPI +SetConsoleHistoryInfo(IN PCONSOLE_HISTORY_INFO lpConsoleHistoryInfo) +{ + CSR_API_MESSAGE Request; + ULONG CsrRequest = MAKE_CSR_API(GET_HISTORY_INFO, CSR_CONSOLE); + NTSTATUS Status; + if (lpConsoleHistoryInfo->cbSize != sizeof(CONSOLE_HISTORY_INFO)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + Request.Data.SetHistoryInfo.HistoryBufferSize = lpConsoleHistoryInfo->HistoryBufferSize; + Request.Data.SetHistoryInfo.NumberOfHistoryBuffers = lpConsoleHistoryInfo->NumberOfHistoryBuffers; + Request.Data.SetHistoryInfo.dwFlags = lpConsoleHistoryInfo->dwFlags; + Status = CsrClientCallServer(&Request, NULL, CsrRequest, sizeof(CSR_API_MESSAGE)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + return TRUE; +} + + +/*-------------------------------------------------------------- + * GetConsoleOriginalTitleW + * + * @unimplemented + */ +DWORD +WINAPI +GetConsoleOriginalTitleW(OUT LPWSTR lpConsoleTitle, + IN DWORD nSize) +{ + DPRINT1("GetConsoleOriginalTitleW(0x%p, 0x%x) UNIMPLEMENTED!\n", lpConsoleTitle, nSize); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} + + +/*-------------------------------------------------------------- + * GetConsoleOriginalTitleA + * + * @unimplemented + */ +DWORD +WINAPI +GetConsoleOriginalTitleA(OUT LPSTR lpConsoleTitle, + IN DWORD nSize) +{ + DPRINT1("GetConsoleOriginalTitleA(0x%p, 0x%x) UNIMPLEMENTED!\n", lpConsoleTitle, nSize); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} + + +/*-------------------------------------------------------------- + * GetConsoleScreenBufferInfoEx + * + * @unimplemented + */ +BOOL +WINAPI +GetConsoleScreenBufferInfoEx(IN HANDLE hConsoleOutput, + OUT PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx) +{ + DPRINT1("GetConsoleScreenBufferInfoEx(0x%p, 0x%p) UNIMPLEMENTED!\n", hConsoleOutput, lpConsoleScreenBufferInfoEx); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + + +/*-------------------------------------------------------------- + * SetConsoleScreenBufferInfoEx + * + * @unimplemented + */ +BOOL +WINAPI +SetConsoleScreenBufferInfoEx(IN HANDLE hConsoleOutput, + IN PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx) +{ + DPRINT1("SetConsoleScreenBufferInfoEx(0x%p, 0x%p) UNIMPLEMENTED!\n", hConsoleOutput, lpConsoleScreenBufferInfoEx); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + + +/*-------------------------------------------------------------- + * GetCurrentConsoleFontEx + * + * @unimplemented + */ +BOOL +WINAPI +GetCurrentConsoleFontEx(IN HANDLE hConsoleOutput, + IN BOOL bMaximumWindow, + OUT PCONSOLE_FONT_INFOEX lpConsoleCurrentFontEx) +{ + DPRINT1("GetCurrentConsoleFontEx(0x%p, 0x%x, 0x%p) UNIMPLEMENTED!\n", hConsoleOutput, bMaximumWindow, lpConsoleCurrentFontEx); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + + +/* + * @implemented + */ +BOOLEAN +WINAPI +CreateSymbolicLinkW(IN LPCWSTR lpSymlinkFileName, + IN LPCWSTR lpTargetFileName, + IN DWORD dwFlags) +{ + IO_STATUS_BLOCK IoStatusBlock; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE hSymlink = NULL; + UNICODE_STRING SymlinkFileName = { 0, 0, NULL }; + UNICODE_STRING TargetFileName = { 0, 0, NULL }; + BOOLEAN bAllocatedTarget = FALSE, bRelativePath = FALSE; + LPWSTR lpTargetFullFileName = NULL; + SIZE_T cbPrintName; + SIZE_T cbReparseData; + PREPARSE_DATA_BUFFER pReparseData = NULL; + PBYTE pBufTail; + NTSTATUS Status; + ULONG dwCreateOptions; + DWORD dwErr; + + if(!lpSymlinkFileName || !lpTargetFileName || (dwFlags | SYMBOLIC_LINK_FLAG_DIRECTORY) != SYMBOLIC_LINK_FLAG_DIRECTORY) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if(dwFlags & SYMBOLIC_LINK_FLAG_DIRECTORY) + dwCreateOptions = FILE_DIRECTORY_FILE; + else + dwCreateOptions = FILE_NON_DIRECTORY_FILE; + + switch(RtlDetermineDosPathNameType_U(lpTargetFileName)) + { + case RtlPathTypeUnknown: + case RtlPathTypeRooted: + case RtlPathTypeRelative: + bRelativePath = TRUE; + RtlInitUnicodeString(&TargetFileName, lpTargetFileName); + break; + + case RtlPathTypeDriveRelative: + { + LPWSTR FilePart; + SIZE_T cchTargetFullFileName; + + cchTargetFullFileName = GetFullPathNameW(lpTargetFileName, 0, NULL, &FilePart); + + if(cchTargetFullFileName == 0) + { + dwErr = GetLastError(); + goto Cleanup; + } + + lpTargetFullFileName = RtlAllocateHeap(RtlGetProcessHeap(), 0, cchTargetFullFileName * sizeof(WCHAR)); + + if(lpTargetFullFileName == NULL) + { + dwErr = ERROR_NOT_ENOUGH_MEMORY; + goto Cleanup; + } + + if(GetFullPathNameW(lpTargetFileName, cchTargetFullFileName, lpTargetFullFileName, &FilePart) == 0) + { + dwErr = GetLastError(); + goto Cleanup; + } + } + + lpTargetFileName = lpTargetFullFileName; + + // fallthrough + + case RtlPathTypeUncAbsolute: + case RtlPathTypeDriveAbsolute: + case RtlPathTypeLocalDevice: + case RtlPathTypeRootLocalDevice: + default: + if(!RtlDosPathNameToNtPathName_U(lpTargetFileName, &TargetFileName, NULL, NULL)) + { + bAllocatedTarget = TRUE; + dwErr = ERROR_INVALID_PARAMETER; + goto Cleanup; + } + } + + cbPrintName = wcslen(lpTargetFileName) * sizeof(WCHAR); + cbReparseData = FIELD_OFFSET(REPARSE_DATA_BUFFER, SymbolicLinkReparseBuffer.PathBuffer) + TargetFileName.Length + cbPrintName; + pReparseData = RtlAllocateHeap(RtlGetProcessHeap(), 0, cbReparseData); + + if(pReparseData == NULL) + { + dwErr = ERROR_NOT_ENOUGH_MEMORY; + goto Cleanup; + } + + pBufTail = (PBYTE)(pReparseData->SymbolicLinkReparseBuffer.PathBuffer); + + pReparseData->ReparseTag = (ULONG)IO_REPARSE_TAG_SYMLINK; + pReparseData->ReparseDataLength = (USHORT)cbReparseData - REPARSE_DATA_BUFFER_HEADER_SIZE; + pReparseData->Reserved = 0; + + pReparseData->SymbolicLinkReparseBuffer.SubstituteNameOffset = 0; + pReparseData->SymbolicLinkReparseBuffer.SubstituteNameLength = TargetFileName.Length; + pBufTail += pReparseData->SymbolicLinkReparseBuffer.SubstituteNameOffset; + RtlCopyMemory(pBufTail, TargetFileName.Buffer, TargetFileName.Length); + + pReparseData->SymbolicLinkReparseBuffer.PrintNameOffset = pReparseData->SymbolicLinkReparseBuffer.SubstituteNameLength; + pReparseData->SymbolicLinkReparseBuffer.PrintNameLength = (USHORT)cbPrintName; + pBufTail += pReparseData->SymbolicLinkReparseBuffer.PrintNameOffset; + RtlCopyMemory(pBufTail, lpTargetFileName, cbPrintName); + + pReparseData->SymbolicLinkReparseBuffer.Flags = 0; + + if(bRelativePath) + pReparseData->SymbolicLinkReparseBuffer.Flags |= 1; // TODO! give this lone flag a name + + if(!RtlDosPathNameToNtPathName_U(lpSymlinkFileName, &SymlinkFileName, NULL, NULL)) + { + dwErr = ERROR_PATH_NOT_FOUND; + goto Cleanup; + } + + InitializeObjectAttributes(&ObjectAttributes, &SymlinkFileName, OBJ_CASE_INSENSITIVE, NULL, NULL); + + Status = NtCreateFile + ( + &hSymlink, + FILE_WRITE_ATTRIBUTES | DELETE | SYNCHRONIZE, + &ObjectAttributes, + &IoStatusBlock, + NULL, + FILE_ATTRIBUTE_NORMAL, + 0, + FILE_CREATE, + FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT | dwCreateOptions, + NULL, + 0 + ); + + if(!NT_SUCCESS(Status)) + { + dwErr = RtlNtStatusToDosError(Status); + goto Cleanup; + } + + Status = NtFsControlFile + ( + hSymlink, + NULL, + NULL, + NULL, + &IoStatusBlock, + FSCTL_SET_REPARSE_POINT, + pReparseData, + cbReparseData, + NULL, + 0 + ); + + if(!NT_SUCCESS(Status)) + { + FILE_DISPOSITION_INFORMATION DispInfo; + DispInfo.DeleteFile = TRUE; + NtSetInformationFile(hSymlink, &IoStatusBlock, &DispInfo, sizeof(DispInfo), FileDispositionInformation); + + dwErr = RtlNtStatusToDosError(Status); + goto Cleanup; + } + + dwErr = NO_ERROR; + +Cleanup: + if(hSymlink) + NtClose(hSymlink); + + RtlFreeUnicodeString(&SymlinkFileName); + if (bAllocatedTarget) + { + RtlFreeHeap(RtlGetProcessHeap(), + 0, + TargetFileName.Buffer); + } + + if(lpTargetFullFileName) + RtlFreeHeap(RtlGetProcessHeap(), 0, lpTargetFullFileName); + + if(pReparseData) + RtlFreeHeap(RtlGetProcessHeap(), 0, pReparseData); + + if(dwErr) + { + SetLastError(dwErr); + return FALSE; + } + + return TRUE; +} + + +/* + * @implemented + */ +BOOLEAN +NTAPI +CreateSymbolicLinkA(IN LPCSTR lpSymlinkFileName, + IN LPCSTR lpTargetFileName, + IN DWORD dwFlags) +{ + PWCHAR SymlinkW, TargetW; + BOOLEAN Ret; + + if(!lpSymlinkFileName || !lpTargetFileName) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (!(SymlinkW = FilenameA2W(lpSymlinkFileName, FALSE))) + return FALSE; + + if (!(TargetW = FilenameA2W(lpTargetFileName, TRUE))) + return FALSE; + + Ret = CreateSymbolicLinkW(SymlinkW, + TargetW, + dwFlags); + + RtlFreeHeap(RtlGetProcessHeap(), 0, SymlinkW); + RtlFreeHeap(RtlGetProcessHeap(), 0, TargetW); + + return Ret; +} + +/* + * @unimplemented + */ +DWORD +WINAPI +GetFinalPathNameByHandleW(IN HANDLE hFile, + OUT LPWSTR lpszFilePath, + IN DWORD cchFilePath, + IN DWORD dwFlags) +{ + if (dwFlags & ~(VOLUME_NAME_DOS | VOLUME_NAME_GUID | VOLUME_NAME_NT | + VOLUME_NAME_NONE | FILE_NAME_NORMALIZED | FILE_NAME_OPENED)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + UNIMPLEMENTED; + return 0; +} + +/* + * @implemented + */ +DWORD +WINAPI +GetFinalPathNameByHandleA(IN HANDLE hFile, + OUT LPSTR lpszFilePath, + IN DWORD cchFilePath, + IN DWORD dwFlags) +{ + WCHAR FilePathW[MAX_PATH]; + UNICODE_STRING FilePathU; + DWORD PrevLastError; + DWORD Ret = 0; + + if (cchFilePath != 0 && + cchFilePath > sizeof(FilePathW) / sizeof(FilePathW[0])) + { + FilePathU.Length = 0; + FilePathU.MaximumLength = (USHORT)cchFilePath * sizeof(WCHAR); + FilePathU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), + 0, + FilePathU.MaximumLength); + if (FilePathU.Buffer == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } + } + else + { + FilePathU.Length = 0; + FilePathU.MaximumLength = sizeof(FilePathW); + FilePathU.Buffer = FilePathW; + } + + /* save the last error code */ + PrevLastError = GetLastError(); + SetLastError(ERROR_SUCCESS); + + /* call the unicode version that does all the work */ + Ret = GetFinalPathNameByHandleW(hFile, + FilePathU.Buffer, + cchFilePath, + dwFlags); + + if (GetLastError() == ERROR_SUCCESS) + { + /* no error, restore the last error code and convert the string */ + SetLastError(PrevLastError); + + Ret = FilenameU2A_FitOrFail(lpszFilePath, + cchFilePath, + &FilePathU); + } + + /* free allocated memory if necessary */ + if (FilePathU.Buffer != FilePathW) + { + RtlFreeHeap(RtlGetProcessHeap(), + 0, + FilePathU.Buffer); + } + + return Ret; +} + +/* + * @unimplemented + */ +BOOL +WINAPI +SetFileBandwidthReservation(IN HANDLE hFile, + IN DWORD nPeriodMilliseconds, + IN DWORD nBytesPerPeriod, + IN BOOL bDiscardable, + OUT LPDWORD lpTransferSize, + OUT LPDWORD lpNumOutstandingRequests) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +BOOL +WINAPI +GetFileBandwidthReservation(IN HANDLE hFile, + OUT LPDWORD lpPeriodMilliseconds, + OUT LPDWORD lpBytesPerPeriod, + OUT LPBOOL pDiscardable, + OUT LPDWORD lpTransferSize, + OUT LPDWORD lpNumOutstandingRequests) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +BOOL +WINAPI +SetFileCompletionNotificationModes(IN HANDLE FileHandle, + IN UCHAR Flags) +{ + if (Flags & ~(FILE_SKIP_COMPLETION_PORT_ON_SUCCESS | FILE_SKIP_SET_EVENT_ON_HANDLE)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +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) +{ + UNIMPLEMENTED; + return INVALID_HANDLE_VALUE; +} + +#endif + diff --git a/reactos/dll/win32/kernel32/kernel32.pspec b/reactos/dll/win32/kernel32/kernel32.pspec index 06c102479f5..2f8bcbce115 100644 --- a/reactos/dll/win32/kernel32/kernel32.pspec +++ b/reactos/dll/win32/kernel32/kernel32.pspec @@ -186,10 +186,8 @@ @ stdcall CreateSemaphoreExW(ptr long long wstr long long) @ stdcall CreateSemaphoreW(ptr long long wstr) @ stdcall CreateSocketHandle() -@ stdcall CreateSymbolicLinkA(str str long) ;@ stdcall CreateSymbolicLinkTransactedA ; Win 7 ;@ stdcall CreateSymbolicLinkTransactedW ; Win 7 -@ stdcall CreateSymbolicLinkW(wstr wstr long) @ stdcall CreateTapePartition(long long long long) @ stdcall CreateThread(ptr long ptr long long ptr) ;@ stdcall CreateThreadpool ; Win 7 @@ -441,7 +439,6 @@ @ stdcall GetConsoleFontInfo(long long long ptr) @ stdcall GetConsoleFontSize(long long) @ stdcall GetConsoleHardwareState(long long ptr) -@ stdcall GetConsoleHistoryInfo(ptr) @ stdcall GetConsoleInputExeNameA(long ptr) @ stdcall GetConsoleInputExeNameW(long ptr) @ stdcall GetConsoleInputWaitHandle() @@ -514,7 +511,6 @@ ;@ stdcall GetFileAttributesTransactedA ; Win 7 ;@ stdcall GetFileAttributesTransactedW ; Win 7 @ stdcall GetFileAttributesW(wstr) -@ stdcall GetFileBandwidthReservation(long ptr ptr ptr ptr ptr) @ stdcall GetFileInformationByHandle(long ptr) ;@ stdcall GetFileInformationByHandleEx ; Win 7 ;@ stdcall GetFileMUIInfo ; Win 7 @@ -523,8 +519,6 @@ @ stdcall GetFileSizeEx(long ptr) @ stdcall GetFileTime(long ptr ptr ptr) @ stdcall GetFileType(long) -@ stdcall GetFinalPathNameByHandleA(long str long long) -@ stdcall GetFinalPathNameByHandleW(long wstr long long) @ stdcall GetFirmwareEnvironmentVariableA(str str ptr long) @ stdcall GetFirmwareEnvironmentVariableW(wstr wstr ptr long) @ stdcall GetFullPathNameA(str long ptr ptr) @@ -693,7 +687,7 @@ @ stdcall GetThreadTimes(long ptr ptr ptr ptr) ;@ stdcall GetThreadUILanguage ; Win 7 @ stdcall GetTickCount() -@ stdcall -ret64 GetTickCount64() +@ stdcall GetTickCount64() ; FOR WINE @ stdcall GetTimeFormatA(long long ptr str ptr long) ;@ stdcall GetTimeFormatEx ; Win 7 @ stdcall GetTimeFormatW(long long ptr wstr ptr long) @@ -1144,7 +1138,6 @@ @ stdcall SetConsoleDisplayMode(long long ptr) @ stdcall SetConsoleFont(long long) @ stdcall SetConsoleHardwareState(long long long) -@ stdcall SetConsoleHistoryInfo(ptr) @ stdcall SetConsoleIcon(ptr) @ stdcall SetConsoleInputExeNameA(ptr) @ stdcall SetConsoleInputExeNameW(ptr) diff --git a/reactos/dll/win32/kernel32/kernel32.rbuild b/reactos/dll/win32/kernel32/kernel32.rbuild index 3fae66c18ff..aa6adec8f94 100644 --- a/reactos/dll/win32/kernel32/kernel32.rbuild +++ b/reactos/dll/win32/kernel32/kernel32.rbuild @@ -10,7 +10,6 @@ wine ntdll - 0x0600 errcodes k32.h diff --git a/reactos/dll/win32/kernel32/kernel32.spec b/reactos/dll/win32/kernel32/kernel32.spec index 18cf524c766..3df5c72b1bd 100644 --- a/reactos/dll/win32/kernel32/kernel32.spec +++ b/reactos/dll/win32/kernel32/kernel32.spec @@ -184,10 +184,8 @@ @ stdcall CreateSemaphoreExW(ptr long long wstr long long) @ stdcall CreateSemaphoreW(ptr long long wstr) @ stdcall CreateSocketHandle() -@ stdcall CreateSymbolicLinkA(str str long) ;@ stdcall CreateSymbolicLinkTransactedA ; Win 7 ;@ stdcall CreateSymbolicLinkTransactedW ; Win 7 -@ stdcall CreateSymbolicLinkW(wstr wstr long) @ stdcall CreateTapePartition(long long long long) @ stdcall CreateThread(ptr long ptr long long ptr) ;@ stdcall CreateThreadpool ; Win 7 @@ -439,7 +437,6 @@ @ stdcall GetConsoleFontInfo(long long long ptr) @ stdcall GetConsoleFontSize(long long) @ stdcall GetConsoleHardwareState(long long ptr) -@ stdcall GetConsoleHistoryInfo(ptr) @ stdcall GetConsoleInputExeNameA(long ptr) @ stdcall GetConsoleInputExeNameW(long ptr) @ stdcall GetConsoleInputWaitHandle() @@ -512,7 +509,6 @@ ;@ stdcall GetFileAttributesTransactedA ; Win 7 ;@ stdcall GetFileAttributesTransactedW ; Win 7 @ stdcall GetFileAttributesW(wstr) -@ stdcall GetFileBandwidthReservation(long ptr ptr ptr ptr ptr) @ stdcall GetFileInformationByHandle(long ptr) ;@ stdcall GetFileInformationByHandleEx ; Win 7 ;@ stdcall GetFileMUIInfo ; Win 7 @@ -521,8 +517,6 @@ @ stdcall GetFileSizeEx(long ptr) @ stdcall GetFileTime(long ptr ptr ptr) @ stdcall GetFileType(long) -@ stdcall GetFinalPathNameByHandleA(long str long long) -@ stdcall GetFinalPathNameByHandleW(long wstr long long) @ stdcall GetFirmwareEnvironmentVariableA(str str ptr long) @ stdcall GetFirmwareEnvironmentVariableW(wstr wstr ptr long) @ stdcall GetFullPathNameA(str long ptr ptr) @@ -691,7 +685,7 @@ @ stdcall GetThreadTimes(long ptr ptr ptr ptr) ;@ stdcall GetThreadUILanguage ; Win 7 @ stdcall GetTickCount() -@ stdcall -ret64 GetTickCount64() +@ stdcall GetTickCount64() ; FOR WINE @ stdcall GetTimeFormatA(long long ptr str ptr long) ;@ stdcall GetTimeFormatEx ; Win 7 @ stdcall GetTimeFormatW(long long ptr wstr ptr long) @@ -1142,7 +1136,6 @@ @ stdcall SetConsoleDisplayMode(long long ptr) @ stdcall SetConsoleFont(long long) @ stdcall SetConsoleHardwareState(long long long) -@ stdcall SetConsoleHistoryInfo(ptr) @ stdcall SetConsoleIcon(ptr) @ stdcall SetConsoleInputExeNameA(ptr) @ stdcall SetConsoleInputExeNameW(ptr) diff --git a/reactos/dll/win32/kernel32/winnls/string/format_msg.c b/reactos/dll/win32/kernel32/winnls/string/format_msg.c index 692c24780b3..a79dd5ce744 100644 --- a/reactos/dll/win32/kernel32/winnls/string/format_msg.c +++ b/reactos/dll/win32/kernel32/winnls/string/format_msg.c @@ -36,6 +36,9 @@ extern HMODULE kernel32_handle; +#define HeapAlloc RtlAllocateHeap +#define HeapReAlloc RtlReAllocateHeap +#define HeapFree RtlFreeHeap WINE_DEFAULT_DEBUG_CHANNEL(resource); struct format_args diff --git a/reactos/dll/win32/kernel32/winnls/string/lang.c b/reactos/dll/win32/kernel32/winnls/string/lang.c index 7224db0437e..198a4067e5a 100644 --- a/reactos/dll/win32/kernel32/winnls/string/lang.c +++ b/reactos/dll/win32/kernel32/winnls/string/lang.c @@ -55,6 +55,9 @@ static inline unsigned short get_char_typeW( WCHAR ch ) return wine_wctype_table[wine_wctype_table[ch >> 8] + (ch & 0xff)]; } +#define HeapAlloc RtlAllocateHeap +#define HeapReAlloc RtlReAllocateHeap +#define HeapFree RtlFreeHeap WINE_DEFAULT_DEBUG_CHANNEL(nls); extern HMODULE kernel32_handle; diff --git a/reactos/dll/win32/kernel32/winnls/string/lcformat.c b/reactos/dll/win32/kernel32/winnls/string/lcformat.c index 879dcdcb4b4..bf8b7ae93c4 100644 --- a/reactos/dll/win32/kernel32/winnls/string/lcformat.c +++ b/reactos/dll/win32/kernel32/winnls/string/lcformat.c @@ -40,6 +40,10 @@ #define CRITICAL_SECTION_DEBUG RTL_CRITICAL_SECTION_DEBUG #define CALINFO_MAX_YEAR 2029 +#define HeapAlloc RtlAllocateHeap +#define HeapReAlloc RtlReAllocateHeap +#define HeapFree RtlFreeHeap + WINE_DEFAULT_DEBUG_CHANNEL(nls); #define DATE_DATEVARSONLY 0x0100 /* only date stuff: yMdg */