Sync with trunk r63502.

svn path=/branches/shell-experiments/; revision=63503
This commit is contained in:
David Quintana 2014-05-30 17:56:10 +00:00
commit acd03fd182
159 changed files with 9454 additions and 8144 deletions

View file

@ -56,7 +56,7 @@ VOID PrintResourceString(INT resID, ...)
// FIXME: Optimize by using Win32 console functions. // FIXME: Optimize by using Win32 console functions.
if (IsConsoleHandle(OutputHandle)) if (IsConsoleHandle(OutputHandle))
{ {
_vcwprintf(tmpBuffer, arg_ptr); vfwprintf(stdout, tmpBuffer, arg_ptr);
} }
else else
{ {

View file

@ -14,6 +14,7 @@
#include <wincon.h> #include <wincon.h>
#include <tchar.h> #include <tchar.h>
#include <shlobj.h> #include <shlobj.h>
#include <strsafe.h>
#include "resource.h" #include "resource.h"

View file

@ -60,7 +60,7 @@ AddItemToTreeView(HWND hTreeView,
dwSize * sizeof(TCHAR)); dwSize * sizeof(TCHAR));
if (lpName) if (lpName)
{ {
_tcscpy_s(lpName, dwSize, lpServiceName); StringCchCopy(lpName, dwSize, lpServiceName);
tvi.lParam = (LPARAM)lpName; tvi.lParam = (LPARAM)lpName;
} }
} }

View file

@ -183,9 +183,9 @@ GetServiceDescription(LPTSTR lpServiceName)
dwSize * sizeof(TCHAR)); dwSize * sizeof(TCHAR));
if (lpDescription) if (lpDescription)
{ {
_tcscpy_s(lpDescription, StringCchCopy(lpDescription,
dwSize, dwSize,
pServiceDescription->lpDescription); pServiceDescription->lpDescription);
} }
} }
} }

View file

@ -32,9 +32,9 @@ AddServiceToList(LPWSTR *lpServiceList,
if (lpNewList) if (lpNewList)
{ {
/* Copy the service name */ /* Copy the service name */
wcscpy_s(lpNewList, StringCchCopy(lpNewList,
dwToAddSize, dwToAddSize,
lpServiceToAdd); lpServiceToAdd);
/* Add the double null char */ /* Add the double null char */
lpNewList[dwToAddSize - 1] = L'\0'; lpNewList[dwToAddSize - 1] = L'\0';
@ -68,9 +68,9 @@ AddServiceToList(LPWSTR *lpServiceList,
if (lpNewList) if (lpNewList)
{ {
/* Copy the service name */ /* Copy the service name */
wcscpy_s(&lpNewList[dwCurSize - 1], StringCchCopy(&lpNewList[dwCurSize - 1],
dwToAddSize, dwToAddSize,
lpServiceToAdd); lpServiceToAdd);
/* Add the double null char */ /* Add the double null char */
lpNewList[dwCurSize + dwToAddSize - 1] = L'\0'; lpNewList[dwCurSize + dwToAddSize - 1] = L'\0';

View file

@ -647,19 +647,11 @@ OnResolutionChanged(PINFO pInfo, INT position)
Pixel, Pixel,
sizeof(Pixel) / sizeof(WCHAR))) sizeof(Pixel) / sizeof(WCHAR)))
{ {
#ifdef _MSC_VER swprintf(Buffer,
_swprintf(Buffer, Pixel,
Pixel, pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth,
pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth, pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight,
pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight, Pixel);
Pixel);
#else
swprintf(Buffer,
Pixel,
pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth,
pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight,
Pixel);
#endif
} }
} }

View file

@ -3,6 +3,7 @@ add_definitions(-D__USE_W32_SOCKETS)
list(APPEND SOURCE list(APPEND SOURCE
main.c main.c
cmdAccounts.c
cmdStart.c cmdStart.c
cmdStop.c cmdStop.c
cmdHelpMsg.c cmdHelpMsg.c
@ -13,6 +14,6 @@ list(APPEND SOURCE
add_executable(net ${SOURCE}) add_executable(net ${SOURCE})
set_module_type(net win32cui UNICODE) set_module_type(net win32cui UNICODE)
add_importlibs(net advapi32 msvcrt kernel32) add_importlibs(net advapi32 netapi32 msvcrt kernel32 ntdll)
add_pch(net net.h SOURCE) add_pch(net net.h SOURCE)
add_cd_file(TARGET net DESTINATION reactos/system32 FOR all) add_cd_file(TARGET net DESTINATION reactos/system32 FOR all)

View file

@ -0,0 +1,192 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS net command
* FILE:
* PURPOSE:
*
* PROGRAMMERS: Eric Kohl
*/
#include "net.h"
INT
cmdAccounts(
INT argc,
WCHAR **argv)
{
PUSER_MODALS_INFO_0 Info0 = NULL;
PUSER_MODALS_INFO_1 Info1 = NULL;
PUSER_MODALS_INFO_3 Info3 = NULL;
NT_PRODUCT_TYPE ProductType;
LPWSTR p, perr;
DWORD ParamErr;
ULONG value;
INT i;
BOOL Modified = FALSE;
// BOOL Domain = FALSE;
NET_API_STATUS Status;
for (i = 3; i < argc; i++)
{
if (wcsicmp(argv[i], L"help") == 0)
{
/* Print short syntax help */
puts("NET ACCOUNTS [/FORCELOGOFF:{Minutes|NO}] [/MINPWLEN:Length]");
puts(" [/MAXPWAGE:{Days|UNLIMITED}] [/MINPWAGE:Days]");
puts(" [/UNIQUEPW:Count] [/DOMAIN]");
return 0;
}
if (wcsicmp(argv[i], L"/help") == 0)
{
/* FIXME: Print long help text*/
return 0;
}
/*
if (wcsicmp(argv[i], L"/domain") == 0)
{
Domain = TRUE;
}
*/
}
Status = NetUserModalsGet(NULL, 0, (LPBYTE*)&Info0);
if (Status != NERR_Success)
goto done;
for (i = 3; i < argc; i++)
{
if (_wcsnicmp(argv[i], L"/forcelogoff:", 13) == 0)
{
p = &argv[i][13];
if (wcsicmp(p, L"no"))
{
Info0->usrmod0_force_logoff = TIMEQ_FOREVER;
Modified = TRUE;
}
else
{
value = wcstoul(p, &perr, 10);
Info0->usrmod0_force_logoff = value * 60;
Modified = TRUE;
}
}
else if (_wcsnicmp(argv[i], L"/minpwlen:", 10) == 0)
{
p = &argv[i][10];
value = wcstoul(p, &perr, 10);
Info0->usrmod0_min_passwd_len = value;
Modified = TRUE;
}
else if (_wcsnicmp(argv[i], L"/maxpwage:", 10) == 0)
{
p = &argv[i][10];
if (wcsicmp(p, L"unlimited"))
{
Info0->usrmod0_max_passwd_age = ULONG_MAX;
Modified = TRUE;
}
else
{
value = wcstoul(p, &perr, 10);
Info0->usrmod0_max_passwd_age = value * 86400;
Modified = TRUE;
}
}
else if (_wcsnicmp(argv[i], L"/minpwage:", 10) == 0)
{
p = &argv[i][10];
value = wcstoul(p, &perr, 10);
Info0->usrmod0_min_passwd_age = value * 86400;
Modified = TRUE;
}
else if (_wcsnicmp(argv[i], L"/uniquepw:", 10) == 0)
{
p = &argv[i][10];
value = wcstoul(p, &perr, 10);
Info0->usrmod0_password_hist_len = value;
Modified = TRUE;
}
}
if (Modified == TRUE)
{
Status = NetUserModalsSet(NULL, 0, (LPBYTE)Info0, &ParamErr);
if (Status != NERR_Success)
goto done;
}
else
{
Status = NetUserModalsGet(NULL, 1, (LPBYTE*)&Info1);
if (Status != NERR_Success)
goto done;
Status = NetUserModalsGet(NULL, 3, (LPBYTE*)&Info3);
if (Status != NERR_Success)
goto done;
RtlGetNtProductType(&ProductType);
printf("Force logoff after: ");
if (Info0->usrmod0_force_logoff == TIMEQ_FOREVER)
printf("Never\n");
else
printf("%lu seconds\n", Info0->usrmod0_force_logoff);
printf("Minimum password age (in days): %lu\n", Info0->usrmod0_min_passwd_age / 86400);
printf("Maximum password age (in days): %lu\n", Info0->usrmod0_max_passwd_age / 86400);
printf("Minimum password length: %lu\n", Info0->usrmod0_min_passwd_len);
printf("Password history length: ");
if (Info0->usrmod0_password_hist_len == 0)
printf("None\n");
else
printf("%lu\n", Info0->usrmod0_password_hist_len);
printf("Lockout threshold: %lu\n", Info3->usrmod3_lockout_threshold);
printf("Lockout duration (in minutes): %lu\n", Info3->usrmod3_lockout_duration / 60);
printf("Lockout observation window (in minutes): %lu\n", Info3->usrmod3_lockout_observation_window / 60);
printf("Computer role: ");
if (Info1->usrmod1_role == UAS_ROLE_PRIMARY)
{
if (ProductType == NtProductLanManNt)
{
printf("Primary server\n");
}
else if (ProductType == NtProductServer)
{
printf("Standalone server\n");
}
else
{
printf("Workstation\n");
}
}
else
{
printf("Backup server\n");
}
}
done:
if (Info3 != NULL)
NetApiBufferFree(Info3);
if (Info1 != NULL)
NetApiBufferFree(Info1);
if (Info0 != NULL)
NetApiBufferFree(Info0);
return 0;
}
/* EOF */

View file

@ -18,7 +18,7 @@ typedef struct _COMMAND
COMMAND cmds[] = COMMAND cmds[] =
{ {
{L"accounts", unimplemented}, {L"accounts", cmdAccounts},
{L"computer", unimplemented}, {L"computer", unimplemented},
{L"config", unimplemented}, {L"config", unimplemented},
{L"continue", cmdContinue}, {L"continue", cmdContinue},

View file

@ -7,16 +7,23 @@
#ifndef _NET_PCH_ #ifndef _NET_PCH_
#define _NET_PCH_ #define _NET_PCH_
#define WIN32_NO_STATUS
#include <stdarg.h> #include <stdarg.h>
#include <windef.h> #include <windef.h>
#include <winbase.h> #include <winbase.h>
#include <winsvc.h> #include <winsvc.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <lm.h>
#include <ndk/rtlfuncs.h>
VOID help(VOID); VOID help(VOID);
INT unimplemented(INT argc, WCHAR **argv); INT unimplemented(INT argc, WCHAR **argv);
INT cmdAccounts(INT argc, WCHAR **argv);
INT cmdContinue(INT argc, WCHAR **argv); INT cmdContinue(INT argc, WCHAR **argv);
INT cmdHelp(INT argc, WCHAR **argv); INT cmdHelp(INT argc, WCHAR **argv);
INT cmdHelpMsg(INT argc, WCHAR **argv); INT cmdHelpMsg(INT argc, WCHAR **argv);

View file

@ -22,7 +22,7 @@ VOID PrintResourceString(INT resID, ...)
va_start(arg_ptr, resID); va_start(arg_ptr, resID);
LoadStringW(GetModuleHandle(NULL), resID, tmpBuffer, MAX_BUFFER_SIZE); LoadStringW(GetModuleHandle(NULL), resID, tmpBuffer, MAX_BUFFER_SIZE);
_vcwprintf(tmpBuffer, arg_ptr); vfwprintf(stdout, tmpBuffer, arg_ptr);
va_end(arg_ptr); va_end(arg_ptr);
} }

View file

@ -24,7 +24,7 @@ ReceiveIncomingPackets(SOCKET sock)
{ {
TCHAR logBuf[256]; TCHAR logBuf[256];
_swprintf(logBuf, L"Discard: Received %d bytes from client", readBytes); swprintf(logBuf, L"Discard: Received %d bytes from client", readBytes);
LogEvent(logBuf, 0, 0, LOG_FILE); LogEvent(logBuf, 0, 0, LOG_FILE);
} }
else if (readBytes == SOCKET_ERROR) else if (readBytes == SOCKET_ERROR)

View file

@ -25,7 +25,7 @@ EchoIncomingPackets(SOCKET sock)
readBytes = recv(sock, readBuffer, RECV_BUF, 0); readBytes = recv(sock, readBuffer, RECV_BUF, 0);
if (readBytes > 0) if (readBytes > 0)
{ {
_swprintf(logBuf, L"Received %d bytes from client", readBytes); swprintf(logBuf, L"Received %d bytes from client", readBytes);
LogEvent(logBuf, 0, 0, LOG_FILE); LogEvent(logBuf, 0, 0, LOG_FILE);
totalSentBytes = 0; totalSentBytes = 0;
@ -34,7 +34,7 @@ EchoIncomingPackets(SOCKET sock)
retVal = send(sock, readBuffer + totalSentBytes, readBytes - totalSentBytes, 0); retVal = send(sock, readBuffer + totalSentBytes, readBytes - totalSentBytes, 0);
if (retVal > 0) if (retVal > 0)
{ {
_swprintf(logBuf, L"Sent %d bytes back to client", retVal); swprintf(logBuf, L"Sent %d bytes back to client", retVal);
LogEvent(logBuf, 0, 0, LOG_FILE); LogEvent(logBuf, 0, 0, LOG_FILE);
totalSentBytes += retVal; totalSentBytes += retVal;
} }

View file

@ -84,14 +84,14 @@ AcceptConnections(SOCKET listeningSocket,
sock = accept(listeningSocket, (SOCKADDR*)&client, &addrSize); sock = accept(listeningSocket, (SOCKADDR*)&client, &addrSize);
if (sock != INVALID_SOCKET) if (sock != INVALID_SOCKET)
{ {
_swprintf(logBuf, swprintf(logBuf,
L"Accepted connection to %s server from %S:%d", L"Accepted connection to %s server from %S:%d",
lpName, lpName,
inet_ntoa(client.sin_addr), inet_ntoa(client.sin_addr),
ntohs(client.sin_port)); ntohs(client.sin_port));
LogEvent(logBuf, 0, 0, LOG_FILE); LogEvent(logBuf, 0, 0, LOG_FILE);
_swprintf(logBuf, L"Creating worker thread for %s", lpName); swprintf(logBuf, L"Creating worker thread for %s", lpName);
LogEvent(logBuf, 0, 0, LOG_FILE); LogEvent(logBuf, 0, 0, LOG_FILE);
if (!bShutdown) if (!bShutdown)
@ -103,8 +103,8 @@ AcceptConnections(SOCKET listeningSocket,
} }
else else
{ {
_swprintf(logBuf, L"Failed to start worker thread for the %s server", swprintf(logBuf, L"Failed to start worker thread for the %s server",
lpName); lpName);
LogEvent(logBuf, 0, 0, LOG_FILE); LogEvent(logBuf, 0, 0, LOG_FILE);
} }
} }
@ -149,7 +149,7 @@ ShutdownConnection(SOCKET sock,
ret = recv(sock, readBuffer, BUF, 0); ret = recv(sock, readBuffer, BUF, 0);
if (ret >= 0) if (ret >= 0)
{ {
_swprintf(logBuf, L"FYI, received %d unexpected bytes during shutdown", ret); swprintf(logBuf, L"FYI, received %d unexpected bytes during shutdown", ret);
LogEvent(logBuf, 0, 0, LOG_FILE); LogEvent(logBuf, 0, 0, LOG_FILE);
} }
} while (ret > 0); } while (ret > 0);
@ -170,7 +170,7 @@ StartServer(LPVOID lpParam)
pServices = (PSERVICES)lpParam; pServices = (PSERVICES)lpParam;
_swprintf(logBuf, L"Starting %s server", pServices->lpName); swprintf(logBuf, L"Starting %s server", pServices->lpName);
LogEvent(logBuf, 0, 0, LOG_FILE); LogEvent(logBuf, 0, 0, LOG_FILE);
if (!bShutdown) if (!bShutdown)
@ -178,10 +178,10 @@ StartServer(LPVOID lpParam)
listeningSocket = SetUpListener(htons(pServices->Port)); listeningSocket = SetUpListener(htons(pServices->Port));
if (!bShutdown && listeningSocket != INVALID_SOCKET) if (!bShutdown && listeningSocket != INVALID_SOCKET)
{ {
_swprintf(logBuf, swprintf(logBuf,
L"%s is waiting for connections on port %d", L"%s is waiting for connections on port %d",
pServices->lpName, pServices->lpName,
pServices->Port); pServices->Port);
LogEvent(logBuf, 0, 0, LOG_FILE); LogEvent(logBuf, 0, 0, LOG_FILE);
AcceptConnections(listeningSocket, pServices->lpService, pServices->lpName); AcceptConnections(listeningSocket, pServices->lpService, pServices->lpName);
@ -192,9 +192,7 @@ StartServer(LPVOID lpParam)
} }
} }
_swprintf(logBuf, swprintf(logBuf, L"Exiting %s thread", pServices->lpName);
L"Exiting %s thread",
pServices->lpName);
LogEvent(logBuf, 0, 0, LOG_FILE); LogEvent(logBuf, 0, 0, LOG_FILE);
ExitThread(0); ExitThread(0);
} }

View file

@ -72,7 +72,7 @@ CreateServers(PSERVICEINFO pServInfo)
if ((RetVal = WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0) if ((RetVal = WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0)
{ {
_swprintf(buf, L"WSAStartup() failed : %lu\n", RetVal); swprintf(buf, L"WSAStartup() failed : %lu\n", RetVal);
LogEvent(buf, 0, 100, LOG_ALL); LogEvent(buf, 0, 100, LOG_ALL);
return FALSE; return FALSE;
} }
@ -84,7 +84,7 @@ CreateServers(PSERVICEINFO pServInfo)
/* Create worker threads. */ /* Create worker threads. */
for (i = 0; i < NUM_SERVICES; i++) for (i = 0; i < NUM_SERVICES; i++)
{ {
_swprintf(buf, L"Creating thread for %s server", Services[i].lpName); swprintf(buf, L"Creating thread for %s server", Services[i].lpName);
LogEvent(buf, 0, 0, LOG_FILE); LogEvent(buf, 0, 0, LOG_FILE);
hThread[i] = CreateThread(NULL, hThread[i] = CreateThread(NULL,
@ -96,7 +96,7 @@ CreateServers(PSERVICEINFO pServInfo)
if (hThread[i] == NULL) if (hThread[i] == NULL)
{ {
_swprintf(buf, L"\nError creating %s server thread\n", Services[i].lpName); swprintf(buf, L"\nError creating %s server thread\n", Services[i].lpName);
LogEvent(buf, GetLastError(), 0, LOG_ALL); LogEvent(buf, GetLastError(), 0, LOG_ALL);
return FALSE; return FALSE;
} }

View file

@ -10,10 +10,6 @@
#include <winsock2.h> #include <winsock2.h>
#include <tchar.h> #include <tchar.h>
#ifndef _MSC_VER
#define _swprintf swprintf
#endif
#define LOG_FILE 1 #define LOG_FILE 1
#define LOG_EVENTLOG 2 #define LOG_EVENTLOG 2
#define LOG_ERROR 4 #define LOG_ERROR 4

View file

@ -36,112 +36,122 @@ typedef DWORD (WINAPI *PINSTALL_REACTOS)(HINSTANCE hInstance);
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
LPTSTR lstrchr(LPCTSTR s, TCHAR c) LPTSTR
lstrchr(
LPCTSTR s,
TCHAR c)
{ {
while (*s) while (*s)
{ {
if (*s == c) if (*s == c)
return (LPTSTR)s;
s++;
}
if (c == (TCHAR)0)
return (LPTSTR)s; return (LPTSTR)s;
s++;
}
if (c == (TCHAR)0) return (LPTSTR)NULL;
return (LPTSTR)s;
return (LPTSTR)NULL;
} }
static VOID
RunNewSetup (HINSTANCE hInstance) static
VOID
RunNewSetup(
HINSTANCE hInstance)
{ {
HMODULE hDll; HMODULE hDll;
PINSTALL_REACTOS InstallReactOS; PINSTALL_REACTOS InstallReactOS;
hDll = LoadLibrary (TEXT("syssetup")); hDll = LoadLibrary(TEXT("syssetup"));
if (hDll == NULL) if (hDll == NULL)
{ {
DPRINT("Failed to load 'syssetup'!\n"); DPRINT("Failed to load 'syssetup'!\n");
return; return;
} }
DPRINT("Loaded 'syssetup'!\n"); DPRINT("Loaded 'syssetup'!\n");
InstallReactOS = (PINSTALL_REACTOS)GetProcAddress (hDll, "InstallReactOS"); InstallReactOS = (PINSTALL_REACTOS)GetProcAddress(hDll, "InstallReactOS");
if (InstallReactOS == NULL)
if (InstallReactOS == NULL)
{ {
DPRINT("Failed to get address for 'InstallReactOS()'!\n"); DPRINT("Failed to get address for 'InstallReactOS()'!\n");
FreeLibrary (hDll); FreeLibrary(hDll);
return; return;
} }
InstallReactOS (hInstance); InstallReactOS(hInstance);
FreeLibrary (hDll); FreeLibrary(hDll);
} }
static VOID
RunLiveCD (HINSTANCE hInstance) static
VOID
RunLiveCD(
HINSTANCE hInstance)
{ {
HMODULE hDll; HMODULE hDll;
PINSTALL_REACTOS InstallLiveCD; PINSTALL_REACTOS InstallLiveCD;
hDll = LoadLibrary (TEXT("syssetup")); hDll = LoadLibrary(TEXT("syssetup"));
if (hDll == NULL) if (hDll == NULL)
{ {
DPRINT("Failed to load 'syssetup'!\n"); DPRINT("Failed to load 'syssetup'!\n");
return; return;
} }
DPRINT("Loaded 'syssetup'!\n"); DPRINT("Loaded 'syssetup'!\n");
InstallLiveCD = (PINSTALL_REACTOS)GetProcAddress (hDll, "InstallLiveCD"); InstallLiveCD = (PINSTALL_REACTOS)GetProcAddress(hDll, "InstallLiveCD");
if (InstallLiveCD == NULL)
if (InstallLiveCD == NULL)
{ {
DPRINT("Failed to get address for 'InstallReactOS()'!\n"); DPRINT("Failed to get address for 'InstallReactOS()'!\n");
FreeLibrary (hDll); FreeLibrary(hDll);
return; return;
} }
InstallLiveCD (hInstance); InstallLiveCD(hInstance);
FreeLibrary (hDll); FreeLibrary(hDll);
} }
int WINAPI
_tWinMain (HINSTANCE hInstance, int
HINSTANCE hPrevInstance, WINAPI
LPTSTR lpCmdLine, _tWinMain(
int nShowCmd) HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nShowCmd)
{ {
LPTSTR CmdLine; LPTSTR CmdLine;
LPTSTR p; LPTSTR p;
CmdLine = GetCommandLine (); CmdLine = GetCommandLine();
DPRINT("CmdLine: <%s>\n",CmdLine); DPRINT("CmdLine: <%s>\n",CmdLine);
p = lstrchr (CmdLine, TEXT('-')); p = lstrchr(CmdLine, TEXT('-'));
if (p == NULL) if (p == NULL)
return 0; return 0;
if (!lstrcmpi (p, TEXT("-newsetup"))) if (!lstrcmpi(p, TEXT("-newsetup")))
{ {
RunNewSetup (hInstance); RunNewSetup(hInstance);
} }
else if (!lstrcmpi (p, TEXT("-mini"))) else if (!lstrcmpi(p, TEXT("-mini")))
{ {
RunLiveCD (hInstance); RunLiveCD(hInstance);
} }
#if 0 #if 0
/* Add new setup types here */ /* Add new setup types here */
else if (...) else if (...)
{ {
} }
#endif #endif
return 0; return 0;
} }
/* EOF */ /* EOF */

View file

@ -2,5 +2,5 @@
add_executable(userinit userinit.c userinit.rc) add_executable(userinit userinit.c userinit.rc)
target_link_libraries(userinit wine) target_link_libraries(userinit wine)
set_module_type(userinit win32gui UNICODE) set_module_type(userinit win32gui UNICODE)
add_importlibs(userinit user32 gdi32 advapi32 shell32 shlwapi msvcrt kernel32 ntdll) add_importlibs(userinit user32 advapi32 shell32 msvcrt kernel32 ntdll)
add_cd_file(TARGET userinit DESTINATION reactos/system32 FOR all) add_cd_file(TARGET userinit DESTINATION reactos/system32 FOR all)

View file

@ -227,7 +227,7 @@ StartAutoApplications(
{ {
if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (findData.nFileSizeHigh || findData.nFileSizeLow)) if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (findData.nFileSizeHigh || findData.nFileSizeLow))
{ {
memset(&ExecInfo, 0x0, sizeof(SHELLEXECUTEINFOW)); ZeroMemory(&ExecInfo, sizeof(SHELLEXECUTEINFOW));
ExecInfo.cbSize = sizeof(ExecInfo); ExecInfo.cbSize = sizeof(ExecInfo);
wcscpy(&szPath[len+1], findData.cFileName); wcscpy(&szPath[len+1], findData.cFileName);
ExecInfo.lpVerb = L"open"; ExecInfo.lpVerb = L"open";
@ -430,11 +430,9 @@ COLORREF StrToColorref(
TRACE("(%s)\n", debugstr_w(lpszCol)); TRACE("(%s)\n", debugstr_w(lpszCol));
rgb[0] = StrToIntW(lpszCol); rgb[0] = (BYTE)wcstoul(lpszCol, &lpszCol, 10);
lpszCol = StrChrW(lpszCol, L' ') + 1; rgb[1] = (BYTE)wcstoul(lpszCol, &lpszCol, 10);
rgb[1] = StrToIntW(lpszCol); rgb[2] = (BYTE)wcstoul(lpszCol, &lpszCol, 10);
lpszCol = StrChrW(lpszCol, L' ') + 1;
rgb[2] = StrToIntW(lpszCol);
return RGB(rgb[0], rgb[1], rgb[2]); return RGB(rgb[0], rgb[1], rgb[2]);
} }
@ -443,7 +441,7 @@ VOID SetUserSysColors(VOID)
{ {
HKEY hKey; HKEY hKey;
INT i; INT i;
WCHAR szColor[20]; WCHAR szColor[25];
DWORD Type, Size; DWORD Type, Size;
COLORREF crColor; COLORREF crColor;
LONG rc; LONG rc;

View file

@ -2,18 +2,30 @@
add_subdirectory(packages) add_subdirectory(packages)
#common hives #common hives
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/txtsetup.sif DESTINATION reactos NO_CAB FOR bootcd regtest)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivecls.inf DESTINATION reactos NO_CAB FOR bootcd regtest)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivedef.inf DESTINATION reactos NO_CAB FOR bootcd regtest)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivesft.inf DESTINATION reactos NO_CAB FOR bootcd regtest)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivesys.inf DESTINATION reactos NO_CAB FOR bootcd regtest)
# livecd hives add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/txtsetup.sif DESTINATION reactos NO_CAB FOR bootcd regtest)
list(APPEND CD_HIVES
list(APPEND _common_hives
${CMAKE_CURRENT_SOURCE_DIR}/hivecls.inf ${CMAKE_CURRENT_SOURCE_DIR}/hivecls.inf
${CMAKE_CURRENT_SOURCE_DIR}/hivedef.inf ${CMAKE_CURRENT_SOURCE_DIR}/hivedef.inf
${CMAKE_CURRENT_SOURCE_DIR}/hivesft.inf ${CMAKE_CURRENT_SOURCE_DIR}/hivesft.inf
${CMAKE_CURRENT_SOURCE_DIR}/hivesys.inf ${CMAKE_CURRENT_SOURCE_DIR}/hivesys.inf)
foreach(_hive ${_common_hives})
get_filename_component(_hive_name ${_hive} NAME)
set(_converted_hive ${CMAKE_CURRENT_BINARY_DIR}/${_hive_name})
add_custom_command(OUTPUT ${_converted_hive}
COMMAND native-utf16le ${_hive} ${_converted_hive}
DEPENDS native-utf16le ${_hive})
list(APPEND _converted_common_hives ${_converted_hive})
add_cd_file(FILE ${_converted_hive} DESTINATION reactos NO_CAB FOR bootcd regtest)
endforeach()
add_custom_target(converted_hives DEPENDS ${_converted_common_hives})
# livecd hives
list(APPEND _livecd_hives
${_converted_common_hives}
${CMAKE_CURRENT_SOURCE_DIR}/livecd.inf ${CMAKE_CURRENT_SOURCE_DIR}/livecd.inf
${CMAKE_CURRENT_SOURCE_DIR}/hiveinst.inf) ${CMAKE_CURRENT_SOURCE_DIR}/hiveinst.inf)
@ -23,8 +35,8 @@ add_custom_command(
${CMAKE_CURRENT_BINARY_DIR}/security ${CMAKE_CURRENT_BINARY_DIR}/security
${CMAKE_CURRENT_BINARY_DIR}/software ${CMAKE_CURRENT_BINARY_DIR}/software
${CMAKE_CURRENT_BINARY_DIR}/system ${CMAKE_CURRENT_BINARY_DIR}/system
COMMAND native-mkhive ${CMAKE_CURRENT_BINARY_DIR} ${CD_HIVES} COMMAND native-mkhive ${CMAKE_CURRENT_BINARY_DIR} ${_livecd_hives}
DEPENDS native-mkhive ${CD_HIVES}) DEPENDS native-mkhive ${_livecd_hives} ${_converted_common_hives})
add_custom_target(livecd_hives add_custom_target(livecd_hives
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sam DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sam

View file

@ -1,4 +1,4 @@
[Version] [Version]
Signature="$ReactOS$" Signature="$ReactOS$"
[AddReg] [AddReg]
@ -70,10 +70,10 @@ HKCR,"comfile\shell\open\command","",0x00000000,"""%1"" %*"
; Control Panel extensions ; Control Panel extensions
HKCR,".cpl","",0x00000000,"cplfile" HKCR,".cpl","",0x00000000,"cplfile"
HKCR,"cplfile","",0x00000000,"Control Panel Extension" HKCR,"cplfile","",0x00000000,%CPLFILE%
HKCR,"cplfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-161" HKCR,"cplfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-161"
HKCR,"cplfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-154" HKCR,"cplfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-154"
HKCR,"cplfile\shell\cplopen","",0x00000000,"Open with Control Panel" HKCR,"cplfile\shell\cplopen","",0x00000000,%CPLFILE_OPENWITH%
HKCR,"cplfile\shell\cplopen\command","",0x00020000,"%SystemRoot%\system32\rundll32.exe shell32.dll,Control_RunDLL %1,%*" HKCR,"cplfile\shell\cplopen\command","",0x00020000,"%SystemRoot%\system32\rundll32.exe shell32.dll,Control_RunDLL %1,%*"
HKCR,"cplfile\shell\runas\command","",0x00020000,"%SystemRoot%\system32\rundll32.exe shell32.dll,Control_RunDLLAsUser %1,%*" HKCR,"cplfile\shell\runas\command","",0x00020000,"%SystemRoot%\system32\rundll32.exe shell32.dll,Control_RunDLLAsUser %1,%*"
@ -466,4 +466,25 @@ HKCR,"MIME\Database\Rfc1766","0434",0x00000000,"xh;Xhosa"
HKCR,"MIME\Database\Rfc1766","043D",0x00000000,"ji;Yiddish" HKCR,"MIME\Database\Rfc1766","043D",0x00000000,"ji;Yiddish"
HKCR,"MIME\Database\Rfc1766","0435",0x00000000,"zu;Zulu" HKCR,"MIME\Database\Rfc1766","0435",0x00000000,"zu;Zulu"
;-------------------------------- STRINGS -------------------------------
[Strings]
CPLFILE="Control Panel Extension"
CPLFILE_OPENWITH="Open with Control Panel"
; LANG_GERMAN SUBLANG_NEUTRAL
[Strings.0007]
CPLFILE="Systemsteuerungselement"
CPLFILE_OPENWITH="Mit der Systemsteuerung öffnen"
; LANG_POLISH SUBLANG_NEUTRAL
[Strings.0015]
CPLFILE="Aplet Panelu Sterowania"
CPLFILE_OPENWITH="Otwórz poprzez Panel Sterowania"
; LANG_FRENCH SUBLANG_NEUTRAL
[Strings.000C]
CPLFILE="Extension du Panneau de Contrôle"
CPLFILE_OPENWITH="Ouvrir avec le Panneau de Contrôle"
; EOF ; EOF

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
[Version] [Version]
Signature = "$ReactOS$" Signature = "$ReactOS$"
[AddReg] [AddReg]

View file

@ -239,7 +239,7 @@ function(add_cd_file)
endforeach() endforeach()
if(_CD_TARGET) if(_CD_TARGET)
#manage dependency #manage dependency
add_dependencies(bootcd ${_CD_TARGET}) add_dependencies(bootcd ${_CD_TARGET} converted_hives)
endif() endif()
else() else()
#add it in reactos.cab #add it in reactos.cab
@ -259,7 +259,7 @@ function(add_cd_file)
if(NOT __cd EQUAL -1) if(NOT __cd EQUAL -1)
#manage dependency #manage dependency
if(_CD_TARGET) if(_CD_TARGET)
add_dependencies(livecd ${_CD_TARGET}) add_dependencies(livecd ${_CD_TARGET} converted_hives)
endif() endif()
foreach(item ${_CD_FILE}) foreach(item ${_CD_FILE})
if(_CD_NAME_ON_CD) if(_CD_NAME_ON_CD)
@ -289,7 +289,7 @@ function(add_cd_file)
endforeach() endforeach()
if(_CD_TARGET) if(_CD_TARGET)
#manage dependency #manage dependency
add_dependencies(bootcdregtest ${_CD_TARGET}) add_dependencies(bootcdregtest ${_CD_TARGET} converted_hives)
endif() endif()
else() else()
#add it in reactos.cab #add it in reactos.cab
@ -459,7 +459,7 @@ function(set_module_type MODULE TYPE)
# Handle hotpatchable images. # Handle hotpatchable images.
# GCC has this as a function attribute so we're handling it using DECLSPEC_HOTPATCH # GCC has this as a function attribute so we're handling it using DECLSPEC_HOTPATCH
if(__module_HOTPATCHABLE AND MSVC) if(__module_HOTPATCHABLE AND MSVC AND (NOT ARCH STREQUAL "arm"))
set_property(TARGET ${MODULE} APPEND_STRING PROPERTY COMPILE_FLAGS " /hotpatch") set_property(TARGET ${MODULE} APPEND_STRING PROPERTY COMPILE_FLAGS " /hotpatch")
if(ARCH STREQUAL "i386") if(ARCH STREQUAL "i386")
set_property(TARGET ${MODULE} APPEND_STRING PROPERTY LINK_FLAGS " /FUNCTIONPADMIN:5") set_property(TARGET ${MODULE} APPEND_STRING PROPERTY LINK_FLAGS " /FUNCTIONPADMIN:5")

View file

@ -103,9 +103,15 @@ else()
set(rc_nologo_flag) set(rc_nologo_flag)
endif() endif()
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${rc_nologo_flag} <FLAGS> <DEFINES> ${I18N_DEFS} /fo<OBJECT> <SOURCE>") set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${rc_nologo_flag} <FLAGS> <DEFINES> ${I18N_DEFS} /fo<OBJECT> <SOURCE>")
set(CMAKE_ASM_COMPILE_OBJECT if(ARCH STREQUAL "arm")
"cl ${cl_includes_flag} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp" set(CMAKE_ASM_COMPILE_OBJECT
"<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <OBJECT>.tmp") "cl ${cl_includes_flag} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp"
"<CMAKE_ASM_COMPILER> -nologo -o <OBJECT> <OBJECT>.tmp")
else()
set(CMAKE_ASM_COMPILE_OBJECT
"cl ${cl_includes_flag} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp"
"<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <OBJECT>.tmp")
endif()
endif() endif()
if(_VS_ANALYZE_) if(_VS_ANALYZE_)
@ -222,7 +228,13 @@ endfunction()
# Define those for having real libraries # Define those for having real libraries
set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "LINK /LIB /NOLOGO <LINK_FLAGS> /OUT:<TARGET> <OBJECTS>") set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "LINK /LIB /NOLOGO <LINK_FLAGS> /OUT:<TARGET> <OBJECTS>")
set(CMAKE_STUB_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <SOURCE>")
if(ARCH STREQUAL "arm")
set(CMAKE_STUB_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -nologo -o <OBJECT> <SOURCE>")
else()
set(CMAKE_STUB_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <SOURCE>")
endif()
function(add_delay_importlibs _module) function(add_delay_importlibs _module)
get_target_property(_module_type ${_module} TYPE) get_target_property(_module_type ${_module} TYPE)
if(_module_type STREQUAL "STATIC_LIBRARY") if(_module_type STREQUAL "STATIC_LIBRARY")
@ -248,9 +260,14 @@ function(generate_import_lib _libname _dllname _spec_file)
if(MSVC_IDE) if(MSVC_IDE)
# Compile the generated asm stub file # Compile the generated asm stub file
if(ARCH STREQUAL "arm")
set(_asm_stub_command ${CMAKE_ASM_COMPILER} -nologo -o ${_asm_stubs_file}.obj ${_asm_stubs_file})
else()
set(_asm_stub_command ${CMAKE_ASM_COMPILER} /Cp /Fo${_asm_stubs_file}.obj /c /Ta ${_asm_stubs_file})
endif()
add_custom_command( add_custom_command(
OUTPUT ${_asm_stubs_file}.obj OUTPUT ${_asm_stubs_file}.obj
COMMAND ${CMAKE_ASM_COMPILER} /Cp /Fo${_asm_stubs_file}.obj /c /Ta ${_asm_stubs_file} COMMAND ${_asm_stub_command}
DEPENDS ${_asm_stubs_file}) DEPENDS ${_asm_stubs_file})
else() else()
# Be clear about the "language" # Be clear about the "language"
@ -274,8 +291,13 @@ function(generate_import_lib _libname _dllname _spec_file)
endfunction() endfunction()
if(ARCH STREQUAL "amd64") if(ARCH STREQUAL "amd64")
# This is NOT a typo.
# See https://software.intel.com/en-us/forums/topic/404643
add_definitions(/D__x86_64) add_definitions(/D__x86_64)
set(SPEC2DEF_ARCH x86_64) set(SPEC2DEF_ARCH x86_64)
elseif(ARCH STREQUAL "arm")
add_definitions(/D__arm__)
set(SPEC2DEF_ARCH arm)
else() else()
set(SPEC2DEF_ARCH i386) set(SPEC2DEF_ARCH i386)
endif() endif()
@ -320,6 +342,8 @@ set(PSEH_LIB "pseh")
# both the x86 and x64 versions of ml are available. # both the x86 and x64 versions of ml are available.
if((ARCH STREQUAL "amd64") AND (DEFINED ENV{VCINSTALLDIR})) if((ARCH STREQUAL "amd64") AND (DEFINED ENV{VCINSTALLDIR}))
set(CMAKE_ASM16_COMPILER $ENV{VCINSTALLDIR}/bin/ml.exe) set(CMAKE_ASM16_COMPILER $ENV{VCINSTALLDIR}/bin/ml.exe)
elseif(ARCH STREQUAL "arm")
set(CMAKE_ASM16_COMPILER armasm.exe)
else() else()
set(CMAKE_ASM16_COMPILER ml.exe) set(CMAKE_ASM16_COMPILER ml.exe)
endif() endif()
@ -333,9 +357,15 @@ function(CreateBootSectorTarget _target_name _asm_file _binary_file _base_addres
COMMAND ${CMAKE_C_COMPILER} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm /D__ASM__ /D_USE_ML /EP /c ${_asm_file} > ${_temp_file} COMMAND ${CMAKE_C_COMPILER} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm /D__ASM__ /D_USE_ML /EP /c ${_asm_file} > ${_temp_file}
DEPENDS ${_asm_file}) DEPENDS ${_asm_file})
if(ARCH STREQUAL "arm")
set(_asm16_command ${CMAKE_ASM16_COMPILER} -nologo -o ${_object_file} ${_temp_file})
else()
set(_asm16_command ${CMAKE_ASM16_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_temp_file})
endif()
add_custom_command( add_custom_command(
OUTPUT ${_object_file} OUTPUT ${_object_file}
COMMAND ${CMAKE_ASM16_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_temp_file} COMMAND ${_asm16_command}
DEPENDS ${_temp_file}) DEPENDS ${_temp_file})
add_custom_command( add_custom_command(
@ -368,9 +398,14 @@ macro(add_asm_files _target)
list(APPEND _source_file_defines -D${_define}) list(APPEND _source_file_defines -D${_define})
endif() endif()
endforeach() endforeach()
if(ARCH STREQUAL "arm")
set(_pp_asm_compile_command ${CMAKE_ASM_COMPILER} -nologo -o ${_object_file} ${_preprocessed_asm_file})
else()
set(_pp_asm_compile_command ${CMAKE_ASM_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_preprocessed_asm_file})
endif()
add_custom_command( add_custom_command(
OUTPUT ${_preprocessed_asm_file} ${_object_file} OUTPUT ${_preprocessed_asm_file} ${_object_file}
COMMAND cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm ${_directory_includes} ${_source_file_defines} ${_directory_defines} /D__ASM__ /D_USE_ML /EP /c ${_source_file_full_path} > ${_preprocessed_asm_file} && ${CMAKE_ASM_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_preprocessed_asm_file} COMMAND cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm ${_directory_includes} ${_source_file_defines} ${_directory_defines} /D__ASM__ /D_USE_ML /EP /c ${_source_file_full_path} > ${_preprocessed_asm_file} && ${_pp_asm_compile_command}
DEPENDS ${_source_file_full_path}) DEPENDS ${_source_file_full_path})
set_source_files_properties(${_object_file} PROPERTIES EXTERNAL_OBJECT 1) set_source_files_properties(${_object_file} PROPERTIES EXTERNAL_OBJECT 1)
list(APPEND ${_target} ${_object_file}) list(APPEND ${_target} ${_object_file})

View file

@ -226,11 +226,7 @@ WelcomeDlgProc(HWND hwndDlg,
LoadStringW(hApplet, IDS_ERROR_NOT_FOUND, szPath, MAX_PATH) < MAX_PATH) LoadStringW(hApplet, IDS_ERROR_NOT_FOUND, szPath, MAX_PATH) < MAX_PATH)
{ {
WCHAR szError[MAX_PATH + 100]; WCHAR szError[MAX_PATH + 100];
#ifdef _MSC_VER
_swprintf(szError, szPath, pContext->szTarget);
#else
swprintf(szError, szPath, pContext->szTarget); swprintf(szError, szPath, pContext->szTarget);
#endif
MessageBoxW(hwndDlg, szError, szDesc, MB_ICONERROR); MessageBoxW(hwndDlg, szError, szDesc, MB_ICONERROR);
} }
SendDlgItemMessage(hwndDlg, IDC_SHORTCUT_LOCATION, EM_SETSEL, 0, -1); SendDlgItemMessage(hwndDlg, IDC_SHORTCUT_LOCATION, EM_SETSEL, 0, -1);

View file

@ -1,4 +1,15 @@
;@ stdcall PropertyLengthAsVariant(ptr long long long)
;@ stdcall RtlConvertPropertyToVariant(ptr long ptr ptr)
;@ stdcall RtlConvertVariantToProperty(ptr long ptr ptr ptr long ptr)
@ fastcall RtlActivateActivationContextUnsafeFast(ptr ptr)
@ fastcall RtlDeactivateActivationContextUnsafeFast(ptr)
@ stdcall RtlInterlockedPushListSList(ptr ptr ptr long)
@ fastcall -arch=i386 RtlUlongByteSwap(long)
@ fastcall -ret64 RtlUlonglongByteSwap(double)
@ fastcall -arch=i386 RtlUshortByteSwap(long)
@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListEnd()
@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListFault()
@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListResume()
@ stdcall CsrAllocateCaptureBuffer(long long) @ stdcall CsrAllocateCaptureBuffer(long long)
@ stdcall CsrAllocateMessagePointer(ptr long ptr) @ stdcall CsrAllocateMessagePointer(ptr long ptr)
@ stdcall CsrCaptureMessageBuffer(ptr ptr long ptr) @ stdcall CsrCaptureMessageBuffer(ptr ptr long ptr)
@ -32,12 +43,42 @@
@ stdcall DbgUiStopDebugging(ptr) @ stdcall DbgUiStopDebugging(ptr)
@ stdcall DbgUiWaitStateChange(ptr ptr) @ stdcall DbgUiWaitStateChange(ptr ptr)
@ stdcall DbgUserBreakPoint() @ stdcall DbgUserBreakPoint()
# EtwControlTraceA
# EtwControlTraceW
# EtwCreateTraceInstanceId
# EtwEnableTrace
# EtwEnumerateTraceGuids
# EtwFlushTraceA
# EtwFlushTraceW
# EtwGetTraceEnableFlags
# EtwGetTraceEnableLevel
# EtwGetTraceLoggerHandle
# EtwNotificationRegistrationA
# EtwNotificationRegistrationW
# EtwQueryAllTracesA
# EtwQueryAllTracesW
# EtwQueryTraceA
# EtwQueryTraceW
# EtwReceiveNotificationsA
# EtwReceiveNotificationsW
# EtwRegisterTraceGuidsA
# EtwRegisterTraceGuidsW
# EtwStartTraceA
# EtwStartTraceW
# EtwStopTraceA
# EtwStopTraceW
# EtwTraceEvent
# EtwTraceEventInstance
# EtwTraceMessage
# EtwTraceMessageVa
# EtwUnregisterTraceGuids
# EtwUpdateTraceA
# EtwUpdateTraceW
# EtwpGetTraceBuffer
# EtwpSetHWConfigFunction
@ stdcall -arch=i386 KiFastSystemCall() @ stdcall -arch=i386 KiFastSystemCall()
@ stdcall -arch=i386 KiFastSystemCallRet() @ stdcall -arch=i386 KiFastSystemCallRet()
@ stdcall -arch=i386 KiIntSystemCall() @ stdcall -arch=i386 KiIntSystemCall()
@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListEnd()
@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListFault()
@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListResume()
@ stdcall KiRaiseUserExceptionDispatcher() @ stdcall KiRaiseUserExceptionDispatcher()
@ stdcall KiUserApcDispatcher(ptr ptr ptr ptr) @ stdcall KiUserApcDispatcher(ptr ptr ptr ptr)
@ stdcall KiUserCallbackDispatcher(ptr ptr long) ; CHECKME @ stdcall KiUserCallbackDispatcher(ptr ptr long) ; CHECKME
@ -69,6 +110,7 @@
@ stdcall LdrOpenImageFileOptionsKey(ptr long ptr) ; 5.2 SP1 and higher @ stdcall LdrOpenImageFileOptionsKey(ptr long ptr) ; 5.2 SP1 and higher
@ stdcall LdrProcessRelocationBlock(ptr long ptr long) @ stdcall LdrProcessRelocationBlock(ptr long ptr long)
@ stdcall LdrQueryImageFileExecutionOptions(ptr str long ptr long ptr) @ stdcall LdrQueryImageFileExecutionOptions(ptr str long ptr long ptr)
;@ stdcall LdrQueryImageFileExecutionOptionsEx(ptr ptr long ptr long ptr long)
@ stdcall LdrQueryImageFileKeyOption(ptr ptr long ptr long ptr) @ stdcall LdrQueryImageFileKeyOption(ptr ptr long ptr long ptr)
@ stdcall LdrQueryProcessModuleInformation(ptr long ptr) @ stdcall LdrQueryProcessModuleInformation(ptr long ptr)
;@ stdcall LdrSetAppCompatDllRedirectionCallback ;@ stdcall LdrSetAppCompatDllRedirectionCallback
@ -148,6 +190,7 @@
@ stdcall NtDelayExecution(long ptr) @ stdcall NtDelayExecution(long ptr)
@ stdcall NtDeleteAtom(long) @ stdcall NtDeleteAtom(long)
@ stdcall NtDeleteBootEntry(long) @ stdcall NtDeleteBootEntry(long)
# NtDeleteDriverEntry
@ stdcall NtDeleteFile(ptr) @ stdcall NtDeleteFile(ptr)
@ stdcall NtDeleteKey(long) @ stdcall NtDeleteKey(long)
@ stdcall NtDeleteObjectAuditAlarm(ptr ptr long) @ stdcall NtDeleteObjectAuditAlarm(ptr ptr long)
@ -157,6 +200,7 @@
@ stdcall NtDuplicateObject(long long long ptr long long long) @ stdcall NtDuplicateObject(long long long ptr long long long)
@ stdcall NtDuplicateToken(long long long long long long) @ stdcall NtDuplicateToken(long long long long long long)
@ stdcall NtEnumerateBootEntries(ptr ptr) @ stdcall NtEnumerateBootEntries(ptr ptr)
;@ stdcall NtEnumerateDriverEntries(ptr ptr)
@ stdcall NtEnumerateKey (long long long long long long) @ stdcall NtEnumerateKey (long long long long long long)
@ stdcall NtEnumerateSystemEnvironmentValuesEx(long ptr long) @ stdcall NtEnumerateSystemEnvironmentValuesEx(long ptr long)
@ stdcall NtEnumerateValueKey(long long long long long long) @ stdcall NtEnumerateValueKey(long long long long long long)
@ -188,6 +232,7 @@
@ stdcall NtLoadDriver(ptr) @ stdcall NtLoadDriver(ptr)
@ stdcall NtLoadKey2(ptr ptr long) @ stdcall NtLoadKey2(ptr ptr long)
@ stdcall NtLoadKey(ptr ptr) @ stdcall NtLoadKey(ptr ptr)
;@ stdcall NtLoadKeyEx(ptr ptr long ptr)
@ stdcall NtLockFile(long long ptr ptr ptr ptr ptr ptr long long) @ stdcall NtLockFile(long long ptr ptr ptr ptr ptr ptr long long)
@ stdcall NtLockProductActivationKeys(ptr ptr) @ stdcall NtLockProductActivationKeys(ptr ptr)
@ stdcall NtLockRegistryKey(ptr) @ stdcall NtLockRegistryKey(ptr)
@ -198,6 +243,7 @@
@ stdcall NtMapUserPhysicalPagesScatter(ptr ptr ptr) @ stdcall NtMapUserPhysicalPagesScatter(ptr ptr ptr)
@ stdcall NtMapViewOfSection(long long ptr long long ptr ptr long long long) @ stdcall NtMapViewOfSection(long long ptr long long ptr ptr long long long)
@ stdcall NtModifyBootEntry(ptr) @ stdcall NtModifyBootEntry(ptr)
# NtModifyDriverEntry
@ stdcall NtNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long) @ stdcall NtNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long)
@ stdcall NtNotifyChangeKey(long long ptr ptr ptr long long ptr long long) @ stdcall NtNotifyChangeKey(long long ptr ptr ptr long long ptr long long)
@ stdcall NtNotifyChangeMultipleKeys(ptr long ptr ptr ptr ptr ptr long long ptr long long) @ stdcall NtNotifyChangeMultipleKeys(ptr long ptr ptr ptr ptr ptr long long ptr long long)
@ -236,6 +282,7 @@
@ stdcall NtQueryDefaultUILanguage(ptr) @ stdcall NtQueryDefaultUILanguage(ptr)
@ stdcall NtQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long) @ stdcall NtQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long)
@ stdcall NtQueryDirectoryObject(long ptr long long long ptr ptr) @ stdcall NtQueryDirectoryObject(long ptr long long long ptr ptr)
;@ stdcall NtQueryDriverEntryOrder(ptr ptr)
@ stdcall NtQueryEaFile(long ptr ptr long long ptr long ptr long) @ stdcall NtQueryEaFile(long ptr ptr long long ptr long ptr long)
@ stdcall NtQueryEvent(long long ptr long ptr) @ stdcall NtQueryEvent(long long ptr long ptr)
@ stdcall NtQueryFullAttributesFile(ptr ptr) @ stdcall NtQueryFullAttributesFile(ptr ptr)
@ -254,6 +301,7 @@
@ stdcall NtQueryMutant(long long ptr long ptr) @ stdcall NtQueryMutant(long long ptr long ptr)
@ stdcall NtQueryObject(long long long long long) @ stdcall NtQueryObject(long long long long long)
@ stdcall NtQueryOpenSubKeys(ptr ptr) @ stdcall NtQueryOpenSubKeys(ptr ptr)
;@ stdcall NtQueryOpenSubKeysEx(ptr long ptr ptr)
@ stdcall NtQueryPerformanceCounter(ptr ptr) @ stdcall NtQueryPerformanceCounter(ptr ptr)
@ stdcall NtQueryPortInformationProcess() @ stdcall NtQueryPortInformationProcess()
@ stdcall NtQueryQuotaInformationFile(ptr ptr ptr long long ptr long ptr long) @ stdcall NtQueryQuotaInformationFile(ptr ptr ptr long long ptr long ptr long)
@ -309,6 +357,7 @@
@ stdcall NtSetDefaultHardErrorPort(ptr) @ stdcall NtSetDefaultHardErrorPort(ptr)
@ stdcall NtSetDefaultLocale(long long) @ stdcall NtSetDefaultLocale(long long)
@ stdcall NtSetDefaultUILanguage(long) @ stdcall NtSetDefaultUILanguage(long)
;@ stdcall NtSetDriverEntryOrder(ptr ptr)
@ stdcall NtSetEaFile(long ptr ptr long) @ stdcall NtSetEaFile(long ptr ptr long)
@ stdcall NtSetEvent(long long) @ stdcall NtSetEvent(long long)
@ stdcall NtSetEventBoostPriority(ptr) @ stdcall NtSetEventBoostPriority(ptr)
@ -354,6 +403,7 @@
@ stdcall NtTraceEvent(long long long ptr) @ stdcall NtTraceEvent(long long long ptr)
@ stdcall NtTranslateFilePath(ptr long ptr long) @ stdcall NtTranslateFilePath(ptr long ptr long)
@ stdcall NtUnloadDriver(ptr) @ stdcall NtUnloadDriver(ptr)
;@ stdcall NtUnloadKey2(ptr long)
@ stdcall NtUnloadKey(long) @ stdcall NtUnloadKey(long)
@ stdcall NtUnloadKeyEx(ptr ptr) @ stdcall NtUnloadKeyEx(ptr ptr)
@ stdcall NtUnlockFile(long ptr ptr ptr ptr) @ stdcall NtUnlockFile(long ptr ptr ptr ptr)
@ -362,6 +412,7 @@
@ stdcall NtVdmControl(long ptr) @ stdcall NtVdmControl(long ptr)
@ stdcall NtWaitForDebugEvent(ptr long ptr ptr) @ stdcall NtWaitForDebugEvent(ptr long ptr ptr)
@ stdcall NtWaitForKeyedEvent(ptr ptr long ptr) @ stdcall NtWaitForKeyedEvent(ptr ptr long ptr)
;@ stdcall NtWaitForMultipleObjects32(long ptr long long ptr)
@ stdcall NtWaitForMultipleObjects(long ptr long long ptr) @ stdcall NtWaitForMultipleObjects(long ptr long long ptr)
@ stdcall NtWaitForSingleObject(long long long) @ stdcall NtWaitForSingleObject(long long long)
@ stdcall NtWaitHighEventPair(ptr) @ stdcall NtWaitHighEventPair(ptr)
@ -375,18 +426,14 @@
;@ stdcall PfxInitialize ;@ stdcall PfxInitialize
;@ stdcall PfxInsertPrefix ;@ stdcall PfxInsertPrefix
;@ stdcall PfxRemovePrefix ;@ stdcall PfxRemovePrefix
;@ stdcall PropertyLengthAsVariant
@ stdcall RtlAbortRXact(ptr) @ stdcall RtlAbortRXact(ptr)
@ stdcall RtlAbsoluteToSelfRelativeSD(ptr ptr ptr) @ stdcall RtlAbsoluteToSelfRelativeSD(ptr ptr ptr)
@ stdcall RtlAcquirePebLock() @ stdcall RtlAcquirePebLock()
@ stdcall RtlAcquirePrivilege(ptr long long ptr) @ stdcall RtlAcquirePrivilege(ptr long long ptr)
@ stdcall RtlAcquireResourceExclusive(ptr long) @ stdcall RtlAcquireResourceExclusive(ptr long)
@ stdcall RtlAcquireResourceShared(ptr long) @ stdcall RtlAcquireResourceShared(ptr long)
@ stdcall RtlAcquireSRWLockExclusive(ptr)
@ stdcall RtlAcquireSRWLockShared(ptr)
@ stdcall RtlActivateActivationContext(long ptr ptr) @ stdcall RtlActivateActivationContext(long ptr ptr)
@ stdcall RtlActivateActivationContextEx(long ptr ptr ptr) @ stdcall RtlActivateActivationContextEx(long ptr ptr ptr)
@ fastcall RtlActivateActivationContextUnsafeFast(ptr ptr)
@ stdcall RtlAddAccessAllowedAce(ptr long long ptr) @ stdcall RtlAddAccessAllowedAce(ptr long long ptr)
@ stdcall RtlAddAccessAllowedAceEx(ptr long long long ptr) @ stdcall RtlAddAccessAllowedAceEx(ptr long long long ptr)
@ stdcall RtlAddAccessAllowedObjectAce(ptr long long long ptr ptr ptr) @ stdcall RtlAddAccessAllowedObjectAce(ptr long long long ptr ptr ptr)
@ -401,9 +448,7 @@
@ stdcall RtlAddAuditAccessAceEx(ptr long long long ptr long long) @ stdcall RtlAddAuditAccessAceEx(ptr long long long ptr long long)
@ stdcall RtlAddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long) @ stdcall RtlAddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long)
;@ stdcall RtlAddCompoundAce ;@ stdcall RtlAddCompoundAce
;@ stdcall RtlAddRange ; 5.0 and 5.1 only
@ stdcall -arch=x86_64 RtlAddFunctionTable(ptr long long) @ stdcall -arch=x86_64 RtlAddFunctionTable(ptr long long)
;@ stdcall RtlAddMandatoryAce(ptr long long long long ptr)
@ stdcall RtlAddRefActivationContext(ptr) @ stdcall RtlAddRefActivationContext(ptr)
@ stdcall RtlAddRefMemoryStream(ptr) @ stdcall RtlAddRefMemoryStream(ptr)
@ stdcall RtlAddVectoredContinueHandler(long ptr) @ stdcall RtlAddVectoredContinueHandler(long ptr)
@ -454,19 +499,16 @@
@ stdcall RtlConsoleMultiByteToUnicodeN(ptr long ptr ptr long ptr) @ stdcall RtlConsoleMultiByteToUnicodeN(ptr long ptr ptr long ptr)
@ stdcall RtlConvertExclusiveToShared(ptr) @ stdcall RtlConvertExclusiveToShared(ptr)
@ stdcall -arch=win32 -ret64 RtlConvertLongToLargeInteger(long) @ stdcall -arch=win32 -ret64 RtlConvertLongToLargeInteger(long)
;@ stdcall RtlConvertPropertyToVariant
@ stdcall RtlConvertSharedToExclusive(ptr) @ stdcall RtlConvertSharedToExclusive(ptr)
@ stdcall RtlConvertSidToUnicodeString(ptr ptr long) @ stdcall RtlConvertSidToUnicodeString(ptr ptr long)
@ stdcall RtlConvertToAutoInheritSecurityObject(ptr ptr ptr ptr long ptr) @ stdcall RtlConvertToAutoInheritSecurityObject(ptr ptr ptr ptr long ptr)
;@ stdcall RtlConvertUiListToApiList ;@ stdcall RtlConvertUiListToApiList
@ stdcall -arch=win32 -ret64 RtlConvertUlongToLargeInteger(long) @ stdcall -arch=win32 -ret64 RtlConvertUlongToLargeInteger(long)
;@ stdcall RtlConvertVariantToProperty
@ stdcall RtlCopyLuid(ptr ptr) @ stdcall RtlCopyLuid(ptr ptr)
@ stdcall RtlCopyLuidAndAttributesArray(long ptr ptr) @ stdcall RtlCopyLuidAndAttributesArray(long ptr ptr)
;@ stdcall RtlCopyMappedMemory ;@ stdcall RtlCopyMappedMemory
@ stdcall RtlCopyMemoryStreamTo(ptr ptr int64 ptr ptr) @ stdcall RtlCopyMemoryStreamTo(ptr ptr int64 ptr ptr)
@ stdcall RtlCopyOutOfProcessMemoryStreamTo(ptr ptr int64 ptr ptr) RtlCopyMemoryStreamTo @ stdcall RtlCopyOutOfProcessMemoryStreamTo(ptr ptr int64 ptr ptr) RtlCopyMemoryStreamTo
;@ stdcall RtlCopyRangeList ; 5.0 and 5.1 only
@ stdcall RtlCopySecurityDescriptor(ptr ptr) @ stdcall RtlCopySecurityDescriptor(ptr ptr)
@ stdcall RtlCopySid(long ptr ptr) @ stdcall RtlCopySid(long ptr ptr)
@ stdcall RtlCopySidAndAttributesArray(long ptr long ptr ptr ptr ptr) @ stdcall RtlCopySidAndAttributesArray(long ptr long ptr ptr ptr ptr)
@ -496,7 +538,7 @@
@ stdcall RtlCutoverTimeToSystemTime(ptr ptr ptr long) @ stdcall RtlCutoverTimeToSystemTime(ptr ptr ptr long)
@ stdcall RtlDeNormalizeProcessParams(ptr) @ stdcall RtlDeNormalizeProcessParams(ptr)
@ stdcall RtlDeactivateActivationContext(long long) @ stdcall RtlDeactivateActivationContext(long long)
@ fastcall RtlDeactivateActivationContextUnsafeFast(ptr) # RtlDebugPrintTimes
@ stdcall RtlDecodePointer(ptr) @ stdcall RtlDecodePointer(ptr)
@ stdcall RtlDecodeSystemPointer(ptr) RtlEncodeSystemPointer @ stdcall RtlDecodeSystemPointer(ptr) RtlEncodeSystemPointer
@ stdcall RtlDecompressBuffer(long ptr long ptr long ptr) @ stdcall RtlDecompressBuffer(long ptr long ptr long ptr)
@ -510,8 +552,6 @@
@ stdcall RtlDeleteElementGenericTableAvl(ptr ptr) @ stdcall RtlDeleteElementGenericTableAvl(ptr ptr)
@ cdecl -arch=x86_64 RtlDeleteFunctionTable(ptr) @ cdecl -arch=x86_64 RtlDeleteFunctionTable(ptr)
@ stdcall RtlDeleteNoSplay(ptr ptr) @ stdcall RtlDeleteNoSplay(ptr ptr)
@ stdcall RtlDeleteOwnersRanges(ptr ptr)
@ stdcall RtlDeleteRange(ptr long long long long ptr)
@ stdcall RtlDeleteRegistryValue(long ptr ptr) @ stdcall RtlDeleteRegistryValue(long ptr ptr)
@ stdcall RtlDeleteResource(ptr) @ stdcall RtlDeleteResource(ptr)
@ stdcall RtlDeleteSecurityObject(ptr) @ stdcall RtlDeleteSecurityObject(ptr)
@ -579,18 +619,13 @@
@ stdcall RtlFindClearBitsAndSet(ptr long long) @ stdcall RtlFindClearBitsAndSet(ptr long long)
@ stdcall RtlFindClearRuns(ptr ptr long long) @ stdcall RtlFindClearRuns(ptr ptr long long)
@ stdcall RtlFindLastBackwardRunClear(ptr long ptr) @ stdcall RtlFindLastBackwardRunClear(ptr long ptr)
;@ stdcall RtlFindLastBackwardRunSet(ptr long ptr)
@ stdcall RtlFindLeastSignificantBit(double) @ stdcall RtlFindLeastSignificantBit(double)
@ stdcall RtlFindLongestRunClear(ptr long) @ stdcall RtlFindLongestRunClear(ptr long)
@ stdcall RtlFindLongestRunSet(ptr long)
@ stdcall RtlFindMessage(long long long long ptr) @ stdcall RtlFindMessage(long long long long ptr)
@ stdcall RtlFindMostSignificantBit(double) @ stdcall RtlFindMostSignificantBit(double)
@ stdcall RtlFindNextForwardRunClear(ptr long ptr) @ stdcall RtlFindNextForwardRunClear(ptr long ptr)
;@ stdcall RtlFindNextForwardRunSet(ptr long ptr)
@ stdcall RtlFindRange(ptr long long long long long long long long ptr ptr ptr)
@ stdcall RtlFindSetBits(ptr long long) @ stdcall RtlFindSetBits(ptr long long)
@ stdcall RtlFindSetBitsAndClear(ptr long long) @ stdcall RtlFindSetBitsAndClear(ptr long long)
;@ stdcall RtlFindSetRuns(ptr ptr long long)
@ stdcall RtlFirstEntrySList(ptr) @ stdcall RtlFirstEntrySList(ptr)
@ stdcall RtlFirstFreeAce(ptr ptr) @ stdcall RtlFirstFreeAce(ptr ptr)
@ stdcall RtlFlushSecureMemoryCache(ptr ptr) @ stdcall RtlFlushSecureMemoryCache(ptr ptr)
@ -602,7 +637,6 @@
@ stdcall RtlFreeHandle(ptr ptr) @ stdcall RtlFreeHandle(ptr ptr)
@ stdcall RtlFreeHeap(long long long) @ stdcall RtlFreeHeap(long long long)
@ stdcall RtlFreeOemString(ptr) @ stdcall RtlFreeOemString(ptr)
@ stdcall RtlFreeRangeList(ptr)
@ stdcall RtlFreeSid(long) @ stdcall RtlFreeSid(long)
@ stdcall RtlFreeThreadActivationContextStack() @ stdcall RtlFreeThreadActivationContextStack()
@ stdcall RtlFreeUnicodeString(ptr) @ stdcall RtlFreeUnicodeString(ptr)
@ -621,7 +655,6 @@
@ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr) @ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr)
@ stdcall RtlGetElementGenericTable(ptr long) @ stdcall RtlGetElementGenericTable(ptr long)
@ stdcall RtlGetElementGenericTableAvl(ptr long) @ stdcall RtlGetElementGenericTableAvl(ptr long)
@ stdcall RtlGetFirstRange(ptr ptr ptr)
;@ stdcall RtlGetFrame ;@ stdcall RtlGetFrame
@ stdcall RtlGetFullPathName_U(wstr long ptr ptr) @ stdcall RtlGetFullPathName_U(wstr long ptr ptr)
@ stdcall RtlGetFullPathName_UstrEx(ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall RtlGetFullPathName_UstrEx(ptr ptr ptr ptr ptr ptr ptr ptr)
@ -633,12 +666,10 @@
@ stdcall RtlGetLengthWithoutTrailingPathSeperators(long ptr ptr) RtlGetLengthWithoutTrailingPathSeparators @ stdcall RtlGetLengthWithoutTrailingPathSeperators(long ptr ptr) RtlGetLengthWithoutTrailingPathSeparators
@ stdcall RtlGetLongestNtPathLength() @ stdcall RtlGetLongestNtPathLength()
@ stdcall RtlGetNativeSystemInformation(long long long long) NtQuerySystemInformation @ stdcall RtlGetNativeSystemInformation(long long long long) NtQuerySystemInformation
@ stdcall RtlGetNextRange(ptr ptr long)
@ stdcall RtlGetNtGlobalFlags() @ stdcall RtlGetNtGlobalFlags()
@ stdcall RtlGetNtProductType(ptr) @ stdcall RtlGetNtProductType(ptr)
@ stdcall RtlGetNtVersionNumbers(ptr ptr ptr) @ stdcall RtlGetNtVersionNumbers(ptr ptr ptr)
@ stdcall RtlGetOwnerSecurityDescriptor(ptr ptr ptr) @ stdcall RtlGetOwnerSecurityDescriptor(ptr ptr ptr)
;@ stdcall RtlGetProductInfo(long long long long ptr)
@ stdcall RtlGetProcessHeaps(long ptr) @ stdcall RtlGetProcessHeaps(long ptr)
@ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr) @ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr)
@ stdcall RtlGetSecurityDescriptorRMControl(ptr ptr) @ stdcall RtlGetSecurityDescriptorRMControl(ptr ptr)
@ -669,19 +700,17 @@
@ stdcall RtlInitializeContext(ptr ptr ptr ptr ptr) @ stdcall RtlInitializeContext(ptr ptr ptr ptr ptr)
@ stdcall RtlInitializeCriticalSection(ptr) @ stdcall RtlInitializeCriticalSection(ptr)
@ stdcall RtlInitializeCriticalSectionAndSpinCount(ptr long) @ stdcall RtlInitializeCriticalSectionAndSpinCount(ptr long)
;@ stdcall RtlInitializeCriticalSectionEx(ptr long long)
@ stdcall RtlInitializeGenericTable(ptr ptr ptr ptr ptr) @ stdcall RtlInitializeGenericTable(ptr ptr ptr ptr ptr)
@ stdcall RtlInitializeGenericTableAvl(ptr ptr ptr ptr ptr) @ stdcall RtlInitializeGenericTableAvl(ptr ptr ptr ptr ptr)
@ stdcall RtlInitializeHandleTable(long long ptr) @ stdcall RtlInitializeHandleTable(long long ptr)
@ stdcall RtlInitializeRXact(ptr long ptr) @ stdcall RtlInitializeRXact(ptr long ptr)
@ stdcall RtlInitializeRangeList(ptr)
@ stdcall RtlInitializeResource(ptr) @ stdcall RtlInitializeResource(ptr)
@ stdcall RtlInitializeSListHead(ptr) @ stdcall RtlInitializeSListHead(ptr)
@ stdcall RtlInitializeSid(ptr ptr long) @ stdcall RtlInitializeSid(ptr ptr long)
@ stdcall RtlInitializeSRWLock(ptr)
;@ stdcall RtlInitializeStackTraceDataBase ; 5.1 SP2 and SP3, and 5.2 only
@ stdcall RtlInsertElementGenericTable(ptr ptr long ptr) @ stdcall RtlInsertElementGenericTable(ptr ptr long ptr)
@ stdcall RtlInsertElementGenericTableAvl(ptr ptr long ptr) @ stdcall RtlInsertElementGenericTableAvl(ptr ptr long ptr)
# RtlInsertElementGenericTableFull
;@ stdcall RtlInsertElementGenericTableFullAvl(ptr ptr long ptr ptr long)
@ stdcall -arch=x86_64 RtlInstallFunctionTableCallback(double double long ptr ptr ptr) @ stdcall -arch=x86_64 RtlInstallFunctionTableCallback(double double long ptr ptr ptr)
@ stdcall RtlInt64ToUnicodeString(double long ptr) @ stdcall RtlInt64ToUnicodeString(double long ptr)
@ stdcall RtlIntegerToChar(long long long ptr) @ stdcall RtlIntegerToChar(long long long ptr)
@ -690,8 +719,6 @@
@ stdcall -arch=i386,x86_64 RtlInterlockedFlushSList(ptr) @ stdcall -arch=i386,x86_64 RtlInterlockedFlushSList(ptr)
@ stdcall -arch=i386,x86_64 RtlInterlockedPopEntrySList(ptr) @ stdcall -arch=i386,x86_64 RtlInterlockedPopEntrySList(ptr)
@ stdcall -arch=i386,x86_64 RtlInterlockedPushEntrySList(ptr ptr) @ stdcall -arch=i386,x86_64 RtlInterlockedPushEntrySList(ptr ptr)
@ stdcall RtlInterlockedPushListSList(ptr ptr ptr long)
@ stdcall RtlInvertRangeList(ptr ptr)
@ stdcall RtlIpv4AddressToStringA(ptr ptr) @ stdcall RtlIpv4AddressToStringA(ptr ptr)
@ stdcall RtlIpv4AddressToStringExA(ptr long ptr ptr) @ stdcall RtlIpv4AddressToStringExA(ptr long ptr ptr)
@ stdcall RtlIpv4AddressToStringExW(ptr long ptr ptr) @ stdcall RtlIpv4AddressToStringExW(ptr long ptr ptr)
@ -715,7 +742,6 @@
@ stdcall RtlIsGenericTableEmpty(ptr) @ stdcall RtlIsGenericTableEmpty(ptr)
@ stdcall RtlIsGenericTableEmptyAvl(ptr) @ stdcall RtlIsGenericTableEmptyAvl(ptr)
@ stdcall RtlIsNameLegalDOS8Dot3(ptr ptr ptr) @ stdcall RtlIsNameLegalDOS8Dot3(ptr ptr ptr)
@ stdcall RtlIsRangeAvailable(ptr long long long long long long ptr ptr ptr)
@ stdcall RtlIsTextUnicode(ptr long ptr) @ stdcall RtlIsTextUnicode(ptr long ptr)
@ stdcall RtlIsThreadWithinLoaderCallout() @ stdcall RtlIsThreadWithinLoaderCallout()
@ stdcall RtlIsValidHandle(ptr ptr) @ stdcall RtlIsValidHandle(ptr ptr)
@ -740,15 +766,18 @@
@ stdcall RtlLookupAtomInAtomTable(ptr wstr ptr) @ stdcall RtlLookupAtomInAtomTable(ptr wstr ptr)
@ stdcall RtlLookupElementGenericTable(ptr ptr) @ stdcall RtlLookupElementGenericTable(ptr ptr)
@ stdcall RtlLookupElementGenericTableAvl(ptr ptr) @ stdcall RtlLookupElementGenericTableAvl(ptr ptr)
# RtlLookupElementGenericTableFull
# RtlLookupElementGenericTableFullAvl
@ stdcall -arch=x86_64 RtlLookupFunctionEntry(long ptr ptr) @ stdcall -arch=x86_64 RtlLookupFunctionEntry(long ptr ptr)
@ stdcall RtlMakeSelfRelativeSD(ptr ptr ptr) @ stdcall RtlMakeSelfRelativeSD(ptr ptr ptr)
@ stdcall RtlMapGenericMask(long ptr) @ stdcall RtlMapGenericMask(long ptr)
;@ stdcall RtlMapSecurityErrorToNtStatus ;@ stdcall RtlMapSecurityErrorToNtStatus
@ stdcall RtlMergeRangeLists(ptr ptr ptr long)
@ stdcall RtlMoveMemory(ptr ptr long) @ stdcall RtlMoveMemory(ptr ptr long)
@ stdcall RtlMultiAppendUnicodeStringBuffer(ptr long ptr) @ stdcall RtlMultiAppendUnicodeStringBuffer(ptr long ptr)
@ stdcall RtlMultiByteToUnicodeN(ptr long ptr ptr long) @ stdcall RtlMultiByteToUnicodeN(ptr long ptr ptr long)
@ stdcall RtlMultiByteToUnicodeSize(ptr str long) @ stdcall RtlMultiByteToUnicodeSize(ptr str long)
# RtlMultipleAllocateHeap
# RtlMultipleFreeHeap
@ stdcall RtlNewInstanceSecurityObject(long long ptr ptr ptr ptr ptr long ptr ptr) @ stdcall RtlNewInstanceSecurityObject(long long ptr ptr ptr ptr ptr long ptr ptr)
@ stdcall RtlNewSecurityGrantedAccess(long ptr ptr ptr ptr ptr) @ stdcall RtlNewSecurityGrantedAccess(long ptr ptr ptr ptr ptr)
@ stdcall RtlNewSecurityObject(ptr ptr ptr long ptr ptr) @ stdcall RtlNewSecurityObject(ptr ptr ptr long ptr ptr)
@ -771,7 +800,6 @@
;@ stdcall RtlPopFrame ;@ stdcall RtlPopFrame
@ stdcall RtlPrefixString(ptr ptr long) @ stdcall RtlPrefixString(ptr ptr long)
@ stdcall RtlPrefixUnicodeString(ptr ptr long) @ stdcall RtlPrefixUnicodeString(ptr ptr long)
;@ stdcall RtlPropertySetNameToGuid ; 4.0 only
@ stdcall RtlProtectHeap(ptr long) @ stdcall RtlProtectHeap(ptr long)
;@ stdcall RtlPushFrame ;@ stdcall RtlPushFrame
@ stdcall RtlQueryAtomInAtomTable(ptr long ptr ptr ptr ptr) @ stdcall RtlQueryAtomInAtomTable(ptr long ptr ptr ptr ptr)
@ -786,9 +814,6 @@
@ stdcall RtlQueryProcessDebugInformation(long long ptr) @ stdcall RtlQueryProcessDebugInformation(long long ptr)
;@ stdcall RtlQueryProcessHeapInformation ;@ stdcall RtlQueryProcessHeapInformation
;@ stdcall RtlQueryProcessLockInformation ;@ stdcall RtlQueryProcessLockInformation
;@ stdcall RtlQueryProperties ; 4.0 only
;@ stdcall RtlQueryPropertyNames ; 4.0 only
;@ stdcall RtlQueryPropertySet ; 4.0 only
@ stdcall RtlQueryRegistryValues(long ptr ptr ptr ptr) @ stdcall RtlQueryRegistryValues(long ptr ptr ptr ptr)
@ stdcall RtlQuerySecurityObject(ptr long ptr long ptr) @ stdcall RtlQuerySecurityObject(ptr long ptr long ptr)
@ stdcall RtlQueryTagHeap(ptr long long long ptr) @ stdcall RtlQueryTagHeap(ptr long long long ptr)
@ -812,8 +837,6 @@
@ stdcall RtlReleasePrivilege(ptr) @ stdcall RtlReleasePrivilege(ptr)
@ stdcall RtlReleaseRelativeName(ptr) @ stdcall RtlReleaseRelativeName(ptr)
@ stdcall RtlReleaseResource(ptr) @ stdcall RtlReleaseResource(ptr)
@ stdcall RtlReleaseSRWLockExclusive(ptr)
@ stdcall RtlReleaseSRWLockShared(ptr)
@ stdcall RtlRemoteCall(ptr ptr ptr long ptr long long) @ stdcall RtlRemoteCall(ptr ptr ptr long ptr long long)
@ stdcall RtlRemoveVectoredContinueHandler(ptr) @ stdcall RtlRemoveVectoredContinueHandler(ptr)
@ stdcall RtlRemoveVectoredExceptionHandler(ptr) @ stdcall RtlRemoveVectoredExceptionHandler(ptr)
@ -847,10 +870,6 @@
@ stdcall RtlSetMemoryStreamSize(ptr int64) @ stdcall RtlSetMemoryStreamSize(ptr int64)
@ stdcall RtlSetOwnerSecurityDescriptor(ptr ptr long) @ stdcall RtlSetOwnerSecurityDescriptor(ptr ptr long)
@ cdecl RtlSetProcessIsCritical(long ptr long) @ cdecl RtlSetProcessIsCritical(long ptr long)
;@ stdcall RtlSetProperties ; RtlSetProperties
;@ stdcall RtlSetPropertyClassId ; 4.0 only
;@ stdcall RtlSetPropertyNames ; 4.0 only
;@ stdcall RtlSetPropertySetClassId ; 4.0 only
@ stdcall RtlSetSaclSecurityDescriptor(ptr long ptr long) @ stdcall RtlSetSaclSecurityDescriptor(ptr long ptr long)
@ stdcall RtlSetSecurityDescriptorRMControl(ptr ptr) @ stdcall RtlSetSecurityDescriptorRMControl(ptr ptr)
@ stdcall RtlSetSecurityObject(long ptr ptr ptr ptr) @ stdcall RtlSetSecurityObject(long ptr ptr ptr ptr)
@ -865,8 +884,6 @@
@ stdcall RtlSetUserFlagsHeap(ptr long ptr long long) @ stdcall RtlSetUserFlagsHeap(ptr long ptr long long)
@ stdcall RtlSetUserValueHeap(ptr long ptr ptr) @ stdcall RtlSetUserValueHeap(ptr long ptr ptr)
@ stdcall RtlSizeHeap(long long ptr) @ stdcall RtlSizeHeap(long long ptr)
@ stdcall RtlSleepConditionVariableCS(ptr ptr ptr)
@ stdcall RtlSleepConditionVariableSRW(ptr ptr ptr long)
@ stdcall RtlSplay(ptr) @ stdcall RtlSplay(ptr)
@ stdcall RtlStartRXact(ptr) @ stdcall RtlStartRXact(ptr)
@ stdcall RtlStatMemoryStream(ptr ptr long) @ stdcall RtlStatMemoryStream(ptr ptr long)
@ -890,8 +907,6 @@
;@ stdcall RtlTraceDatabaseUnlock ;@ stdcall RtlTraceDatabaseUnlock
;@ stdcall RtlTraceDatabaseValidate ;@ stdcall RtlTraceDatabaseValidate
@ stdcall RtlTryEnterCriticalSection(ptr) @ stdcall RtlTryEnterCriticalSection(ptr)
@ fastcall -arch=i386 RtlUlongByteSwap(long)
@ fastcall -ret64 RtlUlonglongByteSwap(double)
;@ stdcall RtlUnhandledExceptionFilter2 ;@ stdcall RtlUnhandledExceptionFilter2
@ stdcall RtlUnhandledExceptionFilter(ptr) @ stdcall RtlUnhandledExceptionFilter(ptr)
;@ stdcall RtlUnicodeStringToAnsiSize(ptr) ;@ stdcall RtlUnicodeStringToAnsiSize(ptr)
@ -922,7 +937,6 @@
@ stdcall RtlUpperChar(long) @ stdcall RtlUpperChar(long)
@ stdcall RtlUpperString(ptr ptr) @ stdcall RtlUpperString(ptr ptr)
@ stdcall RtlUsageHeap(ptr long ptr) @ stdcall RtlUsageHeap(ptr long ptr)
@ fastcall -arch=i386 RtlUshortByteSwap(long)
@ stdcall RtlValidAcl(ptr) @ stdcall RtlValidAcl(ptr)
@ stdcall RtlValidRelativeSecurityDescriptor(ptr long long) @ stdcall RtlValidRelativeSecurityDescriptor(ptr long long)
@ stdcall RtlValidSecurityDescriptor(ptr) @ stdcall RtlValidSecurityDescriptor(ptr)
@ -936,8 +950,6 @@
@ stdcall RtlWalkHeap(long ptr) @ stdcall RtlWalkHeap(long ptr)
@ stdcall RtlWow64EnableFsRedirection(long) @ stdcall RtlWow64EnableFsRedirection(long)
@ stdcall RtlWow64EnableFsRedirectionEx(long ptr) @ stdcall RtlWow64EnableFsRedirectionEx(long ptr)
@ stdcall RtlWakeAllConditionVariable(ptr)
@ stdcall RtlWakeConditionVariable(ptr)
@ stdcall RtlWriteMemoryStream(ptr ptr long ptr) @ stdcall RtlWriteMemoryStream(ptr ptr long ptr)
@ stdcall RtlWriteRegistryValue(long ptr ptr long ptr long) @ stdcall RtlWriteRegistryValue(long ptr ptr long ptr long)
@ stdcall RtlZeroHeap(ptr long) @ stdcall RtlZeroHeap(ptr long)
@ -969,6 +981,7 @@
@ stdcall ZwAccessCheckByTypeResultListAndAuditAlarmByHandle(ptr ptr ptr ptr ptr ptr ptr long long long ptr long ptr long ptr ptr ptr) NtAccessCheckByTypeResultListAndAuditAlarmByHandle @ stdcall ZwAccessCheckByTypeResultListAndAuditAlarmByHandle(ptr ptr ptr ptr ptr ptr ptr long long long ptr long ptr long ptr ptr ptr) NtAccessCheckByTypeResultListAndAuditAlarmByHandle
@ stdcall ZwAddAtom(ptr long ptr) NtAddAtom @ stdcall ZwAddAtom(ptr long ptr) NtAddAtom
@ stdcall ZwAddBootEntry(ptr long) @ stdcall ZwAddBootEntry(ptr long)
# ZwAddDriverEntry
@ stdcall ZwAdjustGroupsToken(long long long long long long) NtAdjustGroupsToken @ stdcall ZwAdjustGroupsToken(long long long long long long) NtAdjustGroupsToken
@ stdcall ZwAdjustPrivilegesToken(long long long long long long) NtAdjustPrivilegesToken @ stdcall ZwAdjustPrivilegesToken(long long long long long long) NtAdjustPrivilegesToken
@ stdcall ZwAlertResumeThread(long ptr) NtAlertResumeThread @ stdcall ZwAlertResumeThread(long ptr) NtAlertResumeThread
@ -977,12 +990,12 @@
@ stdcall ZwAllocateUserPhysicalPages(ptr ptr ptr) @ stdcall ZwAllocateUserPhysicalPages(ptr ptr ptr)
@ stdcall ZwAllocateUuids(ptr ptr ptr ptr) NtAllocateUuids @ stdcall ZwAllocateUuids(ptr ptr ptr ptr) NtAllocateUuids
@ stdcall ZwAllocateVirtualMemory(long ptr ptr ptr long long) NtAllocateVirtualMemory @ stdcall ZwAllocateVirtualMemory(long ptr ptr ptr long long) NtAllocateVirtualMemory
# ZwApphelpCacheControl
@ stdcall ZwAreMappedFilesTheSame(ptr ptr) NtAreMappedFilesTheSame @ stdcall ZwAreMappedFilesTheSame(ptr ptr) NtAreMappedFilesTheSame
@ stdcall ZwAssignProcessToJobObject(long long) NtAssignProcessToJobObject @ stdcall ZwAssignProcessToJobObject(long long) NtAssignProcessToJobObject
@ stdcall ZwCallbackReturn(ptr long long) @ stdcall ZwCallbackReturn(ptr long long)
@ stdcall ZwCancelDeviceWakeupRequest(ptr) @ stdcall ZwCancelDeviceWakeupRequest(ptr)
@ stdcall ZwCancelIoFile(long ptr) NtCancelIoFile @ stdcall ZwCancelIoFile(long ptr) NtCancelIoFile
;@ stdcall ZwCancelIoFileEx(long ptr ptr) NtCancelIoFileEx
@ stdcall ZwCancelTimer(long ptr) NtCancelTimer @ stdcall ZwCancelTimer(long ptr) NtCancelTimer
@ stdcall ZwClearEvent(long) NtClearEvent @ stdcall ZwClearEvent(long) NtClearEvent
@ stdcall ZwClose(long) NtClose @ stdcall ZwClose(long) NtClose
@ -1023,6 +1036,7 @@
@ stdcall ZwDelayExecution(long ptr) NtDelayExecution @ stdcall ZwDelayExecution(long ptr) NtDelayExecution
@ stdcall ZwDeleteAtom(long) NtDeleteAtom @ stdcall ZwDeleteAtom(long) NtDeleteAtom
@ stdcall ZwDeleteBootEntry(long) NtDeleteBootEntry @ stdcall ZwDeleteBootEntry(long) NtDeleteBootEntry
# ZwDeleteDriverEntry
@ stdcall ZwDeleteFile(ptr) NtDeleteFile @ stdcall ZwDeleteFile(ptr) NtDeleteFile
@ stdcall ZwDeleteKey(long) NtDeleteKey @ stdcall ZwDeleteKey(long) NtDeleteKey
@ stdcall ZwDeleteObjectAuditAlarm(ptr ptr long) @ stdcall ZwDeleteObjectAuditAlarm(ptr ptr long)
@ -1032,7 +1046,7 @@
@ stdcall ZwDuplicateObject(long long long ptr long long long) NtDuplicateObject @ stdcall ZwDuplicateObject(long long long ptr long long long) NtDuplicateObject
@ stdcall ZwDuplicateToken(long long long long long long) NtDuplicateToken @ stdcall ZwDuplicateToken(long long long long long long) NtDuplicateToken
@ stdcall ZwEnumerateBootEntries(ptr ptr) @ stdcall ZwEnumerateBootEntries(ptr ptr)
;@ stdcall ZwEnumerateBus ; 3.51 only # ZwEnumerateDriverEntries
@ stdcall ZwEnumerateKey(long long long ptr long ptr) NtEnumerateKey @ stdcall ZwEnumerateKey(long long long ptr long ptr) NtEnumerateKey
@ stdcall ZwEnumerateSystemEnvironmentValuesEx(long ptr long) NtEnumerateSystemEnvironmentValuesEx @ stdcall ZwEnumerateSystemEnvironmentValuesEx(long ptr long) NtEnumerateSystemEnvironmentValuesEx
@ stdcall ZwEnumerateValueKey(long long long ptr long ptr) NtEnumerateValueKey @ stdcall ZwEnumerateValueKey(long long long ptr long ptr) NtEnumerateValueKey
@ -1051,7 +1065,6 @@
@ stdcall ZwGetCurrentProcessorNumber() @ stdcall ZwGetCurrentProcessorNumber()
@ stdcall ZwGetDevicePowerState(ptr ptr) @ stdcall ZwGetDevicePowerState(ptr ptr)
@ stdcall ZwGetPlugPlayEvent(long long ptr long) @ stdcall ZwGetPlugPlayEvent(long long ptr long)
@ stdcall ZwGetTickCount() RtlGetTickCount
@ stdcall ZwGetWriteWatch(long long ptr long ptr ptr ptr) NtGetWriteWatch @ stdcall ZwGetWriteWatch(long long ptr long ptr ptr ptr) NtGetWriteWatch
@ stdcall ZwImpersonateAnonymousToken(ptr) @ stdcall ZwImpersonateAnonymousToken(ptr)
@ stdcall ZwImpersonateClientOfPort(ptr ptr) NtImpersonateClientOfPort @ stdcall ZwImpersonateClientOfPort(ptr ptr) NtImpersonateClientOfPort
@ -1064,6 +1077,7 @@
@ stdcall ZwLoadDriver(ptr) NtLoadDriver @ stdcall ZwLoadDriver(ptr) NtLoadDriver
@ stdcall ZwLoadKey2(ptr ptr long) NtLoadKey2 @ stdcall ZwLoadKey2(ptr ptr long) NtLoadKey2
@ stdcall ZwLoadKey(ptr ptr) NtLoadKey @ stdcall ZwLoadKey(ptr ptr) NtLoadKey
# ZwLoadKeyEx
@ stdcall ZwLockFile(long long ptr ptr ptr ptr ptr ptr long long) NtLockFile @ stdcall ZwLockFile(long long ptr ptr ptr ptr ptr ptr long long) NtLockFile
@ stdcall ZwLockProductActivationKeys(ptr ptr) NtLockProductActivationKeys @ stdcall ZwLockProductActivationKeys(ptr ptr) NtLockProductActivationKeys
@ stdcall ZwLockRegistryKey(ptr) NtLockRegistryKey @ stdcall ZwLockRegistryKey(ptr) NtLockRegistryKey
@ -1074,6 +1088,7 @@
@ stdcall ZwMapUserPhysicalPagesScatter(ptr ptr ptr) @ stdcall ZwMapUserPhysicalPagesScatter(ptr ptr ptr)
@ stdcall ZwMapViewOfSection(long long ptr long long ptr ptr long long long) NtMapViewOfSection @ stdcall ZwMapViewOfSection(long long ptr long long ptr ptr long long long) NtMapViewOfSection
@ stdcall ZwModifyBootEntry(ptr) NtModifyBootEntry @ stdcall ZwModifyBootEntry(ptr) NtModifyBootEntry
# ZwModifyDriverEntry
@ stdcall ZwNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long) NtNotifyChangeDirectoryFile @ stdcall ZwNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long) NtNotifyChangeDirectoryFile
@ stdcall ZwNotifyChangeKey(long long ptr ptr ptr long long ptr long long) NtNotifyChangeKey @ stdcall ZwNotifyChangeKey(long long ptr ptr ptr long long ptr long long) NtNotifyChangeKey
@ stdcall ZwNotifyChangeMultipleKeys(ptr long ptr ptr ptr ptr ptr long long ptr long long) NtNotifyChangeMultipleKeys @ stdcall ZwNotifyChangeMultipleKeys(ptr long ptr ptr ptr ptr ptr long long ptr long long) NtNotifyChangeMultipleKeys
@ -1112,6 +1127,7 @@
@ stdcall ZwQueryDefaultUILanguage(ptr) NtQueryDefaultUILanguage @ stdcall ZwQueryDefaultUILanguage(ptr) NtQueryDefaultUILanguage
@ stdcall ZwQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long) NtQueryDirectoryFile @ stdcall ZwQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long) NtQueryDirectoryFile
@ stdcall ZwQueryDirectoryObject(long ptr long long long ptr ptr) NtQueryDirectoryObject @ stdcall ZwQueryDirectoryObject(long ptr long long long ptr ptr) NtQueryDirectoryObject
# ZwQueryDriverEntryOrder
@ stdcall ZwQueryEaFile(long ptr ptr long long ptr long ptr long) NtQueryEaFile @ stdcall ZwQueryEaFile(long ptr ptr long long ptr long ptr long) NtQueryEaFile
@ stdcall ZwQueryEvent(long long ptr long ptr) NtQueryEvent @ stdcall ZwQueryEvent(long long ptr long ptr) NtQueryEvent
@ stdcall ZwQueryFullAttributesFile(ptr ptr) NtQueryFullAttributesFile @ stdcall ZwQueryFullAttributesFile(ptr ptr) NtQueryFullAttributesFile
@ -1130,6 +1146,7 @@
@ stdcall ZwQueryMutant(long long ptr long ptr) NtQueryMutant @ stdcall ZwQueryMutant(long long ptr long ptr) NtQueryMutant
@ stdcall ZwQueryObject(long long long long long) NtQueryObject @ stdcall ZwQueryObject(long long long long long) NtQueryObject
@ stdcall ZwQueryOpenSubKeys(ptr ptr) NtQueryOpenSubKeys @ stdcall ZwQueryOpenSubKeys(ptr ptr) NtQueryOpenSubKeys
# ZwQueryOpenSubKeysEx
@ stdcall ZwQueryPerformanceCounter (long long) NtQueryPerformanceCounter @ stdcall ZwQueryPerformanceCounter (long long) NtQueryPerformanceCounter
@ stdcall ZwQueryPortInformationProcess() NtQueryPortInformationProcess @ stdcall ZwQueryPortInformationProcess() NtQueryPortInformationProcess
@ stdcall ZwQueryQuotaInformationFile(ptr ptr ptr long long ptr long ptr long) NtQueryQuotaInformationFile @ stdcall ZwQueryQuotaInformationFile(ptr ptr ptr long long ptr long ptr long) NtQueryQuotaInformationFile
@ -1153,11 +1170,9 @@
@ stdcall ZwReadFileScatter(long long ptr ptr ptr ptr long ptr ptr) NtReadFileScatter @ stdcall ZwReadFileScatter(long long ptr ptr ptr ptr long ptr ptr) NtReadFileScatter
@ stdcall ZwReadRequestData(ptr ptr long ptr long ptr) NtReadRequestData @ stdcall ZwReadRequestData(ptr ptr long ptr long ptr) NtReadRequestData
@ stdcall ZwReadVirtualMemory(long ptr ptr long ptr) NtReadVirtualMemory @ stdcall ZwReadVirtualMemory(long ptr ptr long ptr) NtReadVirtualMemory
;@ stdcall ZwRegisterNewDevice ; 3.51 only
@ stdcall ZwRegisterThreadTerminatePort(ptr) NtRegisterThreadTerminatePort @ stdcall ZwRegisterThreadTerminatePort(ptr) NtRegisterThreadTerminatePort
@ stdcall ZwReleaseKeyedEvent(ptr ptr long ptr) NtReleaseKeyedEvent @ stdcall ZwReleaseKeyedEvent(ptr ptr long ptr) NtReleaseKeyedEvent
@ stdcall ZwReleaseMutant(long ptr) NtReleaseMutant @ stdcall ZwReleaseMutant(long ptr) NtReleaseMutant
;@ stdcall ZwReleaseProcessMutant ; 3.51 only
@ stdcall ZwReleaseSemaphore(long long ptr) NtReleaseSemaphore @ stdcall ZwReleaseSemaphore(long long ptr) NtReleaseSemaphore
@ stdcall ZwRemoveIoCompletion(ptr ptr ptr ptr ptr) NtRemoveIoCompletion @ stdcall ZwRemoveIoCompletion(ptr ptr ptr ptr ptr) NtRemoveIoCompletion
@ stdcall ZwRemoveProcessDebug(ptr ptr) NtRemoveProcessDebug @ stdcall ZwRemoveProcessDebug(ptr ptr) NtRemoveProcessDebug
@ -1187,12 +1202,12 @@
@ stdcall ZwSetDefaultHardErrorPort(ptr) @ stdcall ZwSetDefaultHardErrorPort(ptr)
@ stdcall ZwSetDefaultLocale(long long) @ stdcall ZwSetDefaultLocale(long long)
@ stdcall ZwSetDefaultUILanguage(long) @ stdcall ZwSetDefaultUILanguage(long)
# ZwSetDriverEntryOrder
@ stdcall ZwSetEaFile(long ptr ptr long) @ stdcall ZwSetEaFile(long ptr ptr long)
@ stdcall ZwSetEvent(long long) @ stdcall ZwSetEvent(long long)
@ stdcall ZwSetEventBoostPriority(ptr) @ stdcall ZwSetEventBoostPriority(ptr)
@ stdcall ZwSetHighEventPair(ptr) @ stdcall ZwSetHighEventPair(ptr)
@ stdcall ZwSetHighWaitLowEventPair(ptr) @ stdcall ZwSetHighWaitLowEventPair(ptr)
;@ stdcall ZwSetHighWaitLowThread ; 3.51 and 4.0 only
@ stdcall ZwSetInformationDebugObject(ptr long ptr long ptr) @ stdcall ZwSetInformationDebugObject(ptr long ptr long ptr)
@ stdcall ZwSetInformationFile(long long long long long) @ stdcall ZwSetInformationFile(long long long long long)
@ stdcall ZwSetInformationJobObject(long long ptr long) @ stdcall ZwSetInformationJobObject(long long ptr long)
@ -1206,7 +1221,6 @@
@ stdcall ZwSetLdtEntries(long double long double) ; CHECKME @ stdcall ZwSetLdtEntries(long double long double) ; CHECKME
@ stdcall ZwSetLowEventPair(ptr) @ stdcall ZwSetLowEventPair(ptr)
@ stdcall ZwSetLowWaitHighEventPair(ptr) @ stdcall ZwSetLowWaitHighEventPair(ptr)
;@ stdcall ZwSetLowWaitHighThread ; 3.51 and 4.0 only
@ stdcall ZwSetQuotaInformationFile(ptr ptr ptr long) @ stdcall ZwSetQuotaInformationFile(ptr ptr ptr long)
@ stdcall ZwSetSecurityObject(long long ptr) @ stdcall ZwSetSecurityObject(long long ptr)
@ stdcall ZwSetSystemEnvironmentValue(ptr ptr) @ stdcall ZwSetSystemEnvironmentValue(ptr ptr)
@ -1234,17 +1248,17 @@
@ stdcall ZwTraceEvent(long long long ptr) @ stdcall ZwTraceEvent(long long long ptr)
@ stdcall ZwTranslateFilePath(ptr long ptr long) @ stdcall ZwTranslateFilePath(ptr long ptr long)
@ stdcall ZwUnloadDriver(ptr) @ stdcall ZwUnloadDriver(ptr)
# ZwUnloadKey2
@ stdcall ZwUnloadKey(long) @ stdcall ZwUnloadKey(long)
@ stdcall ZwUnloadKeyEx(ptr ptr) @ stdcall ZwUnloadKeyEx(ptr ptr)
@ stdcall ZwUnlockFile(long ptr ptr ptr ptr) @ stdcall ZwUnlockFile(long ptr ptr ptr ptr)
@ stdcall ZwUnlockVirtualMemory(long ptr ptr long) @ stdcall ZwUnlockVirtualMemory(long ptr ptr long)
@ stdcall ZwUnmapViewOfSection(long ptr) @ stdcall ZwUnmapViewOfSection(long ptr)
@ stdcall ZwVdmControl(long ptr) @ stdcall ZwVdmControl(long ptr)
;@ stdcall ZwW32Call(long ptr long ptr ptr)
@ stdcall ZwWaitForDebugEvent(ptr long ptr ptr) @ stdcall ZwWaitForDebugEvent(ptr long ptr ptr)
@ stdcall ZwWaitForKeyedEvent(ptr ptr long ptr) @ stdcall ZwWaitForKeyedEvent(ptr ptr long ptr)
# ZwWaitForMultipleObjects32
@ stdcall ZwWaitForMultipleObjects(long ptr long long ptr) @ stdcall ZwWaitForMultipleObjects(long ptr long long ptr)
;@ stdcall ZwWaitForProcessMutant ; 3.51 only
@ stdcall ZwWaitForSingleObject(long long long) @ stdcall ZwWaitForSingleObject(long long long)
@ stdcall ZwWaitHighEventPair(ptr) @ stdcall ZwWaitHighEventPair(ptr)
@ stdcall ZwWaitLowEventPair(ptr) @ stdcall ZwWaitLowEventPair(ptr)
@ -1310,6 +1324,7 @@
@ cdecl _wcsicmp(wstr wstr) @ cdecl _wcsicmp(wstr wstr)
@ cdecl _wcslwr(wstr) @ cdecl _wcslwr(wstr)
@ cdecl _wcsnicmp(wstr wstr long) @ cdecl _wcsnicmp(wstr wstr long)
# _wcstoui64
@ cdecl _wcsupr(wstr) @ cdecl _wcsupr(wstr)
@ cdecl _wtoi(wstr) @ cdecl _wtoi(wstr)
@ cdecl _wtoi64(wstr) @ cdecl _wtoi64(wstr)
@ -1392,7 +1407,6 @@
@ cdecl wcsrchr(wstr long) @ cdecl wcsrchr(wstr long)
@ cdecl wcsspn(wstr wstr) @ cdecl wcsspn(wstr wstr)
@ cdecl wcsstr(wstr wstr) @ cdecl wcsstr(wstr wstr)
;@ cdecl wcstok(wstr wstr)
@ cdecl wcstol(wstr ptr long) @ cdecl wcstol(wstr ptr long)
@ cdecl wcstombs(ptr ptr long) @ cdecl wcstombs(ptr ptr long)
@ cdecl wcstoul(wstr ptr long) @ cdecl wcstoul(wstr ptr long)

View file

@ -463,7 +463,7 @@ LogonUserW(LPWSTR lpszUsername,
SE_GROUP_ENABLED_BY_DEFAULT; SE_GROUP_ENABLED_BY_DEFAULT;
/* Set the token source */ /* Set the token source */
strcpy(TokenSource.SourceName, "LogonUser"); strncpy(TokenSource.SourceName, "Advapi ", sizeof(TokenSource.SourceName));
AllocateLocallyUniqueId(&TokenSource.SourceIdentifier); AllocateLocallyUniqueId(&TokenSource.SourceIdentifier);
Status = LsaLogonUser(LsaHandle, Status = LsaLogonUser(LsaHandle,

View file

@ -29,7 +29,7 @@ toolbar, and address band for an explorer window
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
#define USE_CUSTOM_MENUBAND 1 #define USE_CUSTOM_MENUBAND 0
// navigation controls and menubar just send a message to parent window // navigation controls and menubar just send a message to parent window
/* /*

View file

@ -957,6 +957,11 @@ HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder,
// what to do with error? Do we want to halt browse because state save failed? // what to do with error? Do we want to halt browse because state save failed?
} }
if (fCurrentShellView)
{
fCurrentShellView->UIActivate(SVUIA_DEACTIVATE);
}
// create view object // create view object
hResult = newShellFolder->CreateViewObject(m_hWnd, IID_PPV_ARG(IShellView, &newShellView)); hResult = newShellFolder->CreateViewObject(m_hWnd, IID_PPV_ARG(IShellView, &newShellView));
if (FAILED(hResult)) if (FAILED(hResult))

View file

@ -351,18 +351,33 @@ CopyFileExA(IN LPCSTR lpExistingFileName,
*/ */
BOOL BOOL
WINAPI WINAPI
CopyFileA ( CopyFileA(IN LPCSTR lpExistingFileName,
LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName,
LPCSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL bFailIfExists
)
{ {
return CopyFileExA (lpExistingFileName, BOOL Result = FALSE;
lpNewFileName, UNICODE_STRING lpNewFileNameW;
NULL, PUNICODE_STRING lpExistingFileNameW;
NULL,
NULL, lpExistingFileNameW = Basep8BitStringToStaticUnicodeString(lpExistingFileName);
bFailIfExists); if (!lpExistingFileNameW)
{
return FALSE;
}
if (Basep8BitStringToDynamicUnicodeString(&lpNewFileNameW, lpNewFileName))
{
Result = CopyFileExW(lpExistingFileNameW->Buffer,
lpNewFileNameW.Buffer,
NULL,
NULL,
NULL,
(bFailIfExists ? COPY_FILE_FAIL_IF_EXISTS : 0));
RtlFreeUnicodeString(&lpNewFileNameW);
}
return Result;
} }
@ -371,18 +386,16 @@ CopyFileA (
*/ */
BOOL BOOL
WINAPI WINAPI
CopyFileW ( CopyFileW(IN LPCWSTR lpExistingFileName,
LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName,
LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL bFailIfExists
)
{ {
return CopyFileExW (lpExistingFileName, return CopyFileExW(lpExistingFileName,
lpNewFileName, lpNewFileName,
NULL, NULL,
NULL, NULL,
NULL, NULL,
bFailIfExists); (bFailIfExists ? COPY_FILE_FAIL_IF_EXISTS : 0));
} }

View file

@ -1308,23 +1308,30 @@ LsapSetPrivileges(
TokenInfo1->Groups->Groups[i].Sid, TokenInfo1->Groups->Groups[i].Sid,
ACCOUNT_VIEW, ACCOUNT_VIEW,
&AccountHandle); &AccountHandle);
if (!NT_SUCCESS(Status))
continue;
Status = LsarEnumeratePrivilegesAccount(AccountHandle,
&Privileges);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
Status = LsarEnumeratePrivilegesAccount(AccountHandle, for (j = 0; j < Privileges->PrivilegeCount; j++)
&Privileges);
if (NT_SUCCESS(Status))
{ {
for (j = 0; j < Privileges->PrivilegeCount; j++) Status = LsapAddPrivilegeToTokenPrivileges(&TokenInfo1->Privileges,
&(Privileges->Privilege[j]));
if (!NT_SUCCESS(Status))
{ {
Status = LsapAddPrivilegeToTokenPrivileges(&TokenInfo1->Privileges, /* We failed, clean everything and return */
&(Privileges->Privilege[j])); LsaIFree_LSAPR_PRIVILEGE_SET(Privileges);
if (!NT_SUCCESS(Status)) LsarClose(&AccountHandle);
return Status; LsarClose(&PolicyHandle);
}
LsaIFree_LSAPR_PRIVILEGE_SET(Privileges); return Status;
Privileges = NULL; }
} }
LsaIFree_LSAPR_PRIVILEGE_SET(Privileges);
Privileges = NULL;
} }
LsarClose(&AccountHandle); LsarClose(&AccountHandle);

View file

@ -192,7 +192,7 @@ MyLogonUser(
SE_GROUP_ENABLED_BY_DEFAULT; SE_GROUP_ENABLED_BY_DEFAULT;
/* Set the token source */ /* Set the token source */
strcpy(TokenSource.SourceName, "LogonUser"); strncpy(TokenSource.SourceName, "User32 ", sizeof(TokenSource.SourceName));
AllocateLocallyUniqueId(&TokenSource.SourceIdentifier); AllocateLocallyUniqueId(&TokenSource.SourceIdentifier);
Status = LsaLogonUser(LsaHandle, Status = LsaLogonUser(LsaHandle,

File diff suppressed because it is too large Load diff

View file

@ -64,7 +64,7 @@ CallNtPowerInformation(POWER_INFORMATION_LEVEL InformationLevel,
{ {
BOOLEAN old; BOOLEAN old;
//Lohnegrim: In order to get the right results, we have to ajust our Privilegs //Lohnegrim: In order to get the right results, we have to adjust our Privileges
RtlAdjustPrivilege(SE_SHUTDOWN_PRIVILEGE, TRUE, FALSE, &old); RtlAdjustPrivilege(SE_SHUTDOWN_PRIVILEGE, TRUE, FALSE, &old);
RtlAdjustPrivilege(SE_CREATE_PAGEFILE_PRIVILEGE, TRUE, FALSE, &old); RtlAdjustPrivilege(SE_CREATE_PAGEFILE_PRIVILEGE, TRUE, FALSE, &old);
@ -332,7 +332,7 @@ GetCurrentPowerPolicies(PGLOBAL_POWER_POLICY pGlobalPowerPolicy,
return FALSE; return FALSE;
*/ */
/* /*
Lohnegrim: I dont know why this Function shoud call NtPowerInformation, becouse as far as i know, Lohnegrim: I don't know why this Function should call NtPowerInformation, because as far as I know,
it simply returns the GlobalPowerPolicy and the AktivPowerScheme! it simply returns the GlobalPowerPolicy and the AktivPowerScheme!
*/ */
UINT uiID; UINT uiID;
@ -793,8 +793,8 @@ static BOOLEAN
CheckPowerActionPolicy(PPOWER_ACTION_POLICY pPAP, SYSTEM_POWER_CAPABILITIES PowerCaps) CheckPowerActionPolicy(PPOWER_ACTION_POLICY pPAP, SYSTEM_POWER_CAPABILITIES PowerCaps)
{ {
/* /*
Lohnegrim: this is an Helperfunction, it checks if the POWERACTIONPOLICY is valid Lohnegrim: this is an Helper function, it checks if the POWERACTIONPOLICY is valid
Also, if the System dosn't support Hipernation, then change the PowerAction Also, if the System doesn't support Hibernation, then change the PowerAction
*/ */
switch (pPAP->Action) switch (pPAP->Action)
{ {
@ -829,7 +829,7 @@ CheckPowerActionPolicy(PPOWER_ACTION_POLICY pPAP, SYSTEM_POWER_CAPABILITIES Powe
static VOID static VOID
FixSystemPowerState(PSYSTEM_POWER_STATE Psps, SYSTEM_POWER_CAPABILITIES PowerCaps) FixSystemPowerState(PSYSTEM_POWER_STATE Psps, SYSTEM_POWER_CAPABILITIES PowerCaps)
{ {
//Lohnegrim: If the System dosn't support the Powerstates, then we have to change them //Lohnegrim: If the System doesn't support the Powerstates, then we have to change them
if (!PowerCaps.SystemS1 && *Psps == PowerSystemSleeping1) if (!PowerCaps.SystemS1 && *Psps == PowerSystemSleeping1)
*Psps = PowerSystemSleeping2; *Psps = PowerSystemSleeping2;
if (!PowerCaps.SystemS2 && *Psps == PowerSystemSleeping2) if (!PowerCaps.SystemS2 && *Psps == PowerSystemSleeping2)
@ -923,7 +923,7 @@ ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP)
if (pGPP->mach.BroadcastCapacityResolution > 100) if (pGPP->mach.BroadcastCapacityResolution > 100)
pGPP->mach.BroadcastCapacityResolution = 100; pGPP->mach.BroadcastCapacityResolution = 100;
//Lohnegrim: I have no idear, if they are realy needed, or if they are spezific for my System, or what they mean, so i removed them //Lohnegrim: I have no idea, if they are really needed, or if they are specific for my System, or what they mean, so I removed them
//pGPP->user.DischargePolicy[1].PowerPolicy.EventCode = pGPP->user.DischargePolicy[1].PowerPolicy.EventCode | 0x010000; //pGPP->user.DischargePolicy[1].PowerPolicy.EventCode = pGPP->user.DischargePolicy[1].PowerPolicy.EventCode | 0x010000;
//pGPP->user.DischargePolicy[2].PowerPolicy.EventCode = pGPP->user.DischargePolicy[2].PowerPolicy.EventCode | 0x020000; //pGPP->user.DischargePolicy[2].PowerPolicy.EventCode = pGPP->user.DischargePolicy[2].PowerPolicy.EventCode | 0x020000;
//pGPP->user.DischargePolicy[3].PowerPolicy.EventCode = pGPP->user.DischargePolicy[3].PowerPolicy.EventCode | 0x030000; //pGPP->user.DischargePolicy[3].PowerPolicy.EventCode = pGPP->user.DischargePolicy[3].PowerPolicy.EventCode | 0x030000;
@ -1053,7 +1053,7 @@ ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP)
pPP->user.MaxSleepAc=PowerSystemSleeping1; pPP->user.MaxSleepAc=PowerSystemSleeping1;
pPP->user.MaxSleepDc=PowerSystemSleeping1; pPP->user.MaxSleepDc=PowerSystemSleeping1;
} }
//Lohnegrim: I dont know where to get this info from, so i removed it //Lohnegrim: I don't know where to get this info from, so I removed it
//pPP->user.OptimizeForPowerAc=TRUE; //pPP->user.OptimizeForPowerAc=TRUE;
//pPP->user.OptimizeForPowerDc=TRUE; //pPP->user.OptimizeForPowerDc=TRUE;

View file

@ -40,7 +40,7 @@ add_library(setupapi SHARED
set_module_type(setupapi win32dll UNICODE) set_module_type(setupapi win32dll UNICODE)
target_link_libraries(setupapi uuid wine ${PSEH_LIB}) target_link_libraries(setupapi uuid wine ${PSEH_LIB})
add_delay_importlibs(setupapi shell32 wintrust) add_delay_importlibs(setupapi shell32 winspool wintrust)
add_importlibs(setupapi add_importlibs(setupapi
msvcrt msvcrt

View file

@ -70,6 +70,7 @@ static const WCHAR *create_system_dirid( int dirid )
WCHAR buffer[MAX_PATH+32], *str; WCHAR buffer[MAX_PATH+32], *str;
int len; int len;
DWORD needed;
switch(dirid) switch(dirid)
{ {
@ -122,8 +123,14 @@ static const WCHAR *create_system_dirid( int dirid )
return get_csidl_dir(CSIDL_PROFILE); return get_csidl_dir(CSIDL_PROFILE);
case DIRID_LOADER: case DIRID_LOADER:
return C_Root; /* FIXME */ return C_Root; /* FIXME */
case DIRID_PRINTPROCESSOR:
if (!GetPrintProcessorDirectoryW(NULL, NULL, 1, (LPBYTE)buffer, sizeof(buffer), &needed))
{
WARN( "cannot retrieve print processor directory\n" );
return get_unknown_dirid();
}
break;
case DIRID_COLOR: /* FIXME */ case DIRID_COLOR: /* FIXME */
case DIRID_PRINTPROCESSOR: /* FIXME */
default: default:
FIXME( "unknown dirid %d\n", dirid ); FIXME( "unknown dirid %d\n", dirid );
return get_unknown_dirid(); return get_unknown_dirid();

View file

@ -31,6 +31,8 @@
#include <windef.h> #include <windef.h>
#include <winbase.h> #include <winbase.h>
#include <winreg.h> #include <winreg.h>
#include <wingdi.h>
#include <winspool.h>
#include <wincon.h> #include <wincon.h>
#include <objbase.h> #include <objbase.h>
#include <cfgmgr32.h> #include <cfgmgr32.h>

View file

@ -11,17 +11,19 @@ else()
endif() endif()
if(ARCH STREQUAL "i386") if(ARCH STREQUAL "i386")
set(_filename ks386) set(_filename ks386.inc)
elseif(ARCH STREQUAL "amd64") elseif(ARCH STREQUAL "amd64")
set(_filename ksamd64) set(_filename ksamd64.inc)
elseif(ARCH STREQUAL "arm")
set(_filename ksarm.h)
endif() endif()
get_target_property(genincdata_dll genincdata LOCATION) get_target_property(genincdata_dll genincdata LOCATION)
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_filename}
COMMAND native-geninc ${genincdata_dll} ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc ${OPT_MS} COMMAND native-geninc ${genincdata_dll} ${CMAKE_CURRENT_BINARY_DIR}/${_filename} ${OPT_MS}
DEPENDS genincdata native-geninc) DEPENDS genincdata native-geninc)
add_custom_target(asm add_custom_target(asm
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc) DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_filename})

View file

@ -74,15 +74,18 @@ __attribute__ ((section(".asmdef")))
ASMGENDATA Table[] = ASMGENDATA Table[] =
{ {
#if defined (_M_IX86) || defined (M_AMD64)
/* PORTABLE CONSTANTS ********************************************************/ /* PORTABLE CONSTANTS ********************************************************/
#include "ksx.template.h" #include "ksx.template.h"
#endif
/* ARCHITECTURE SPECIFIC CONTSTANTS ******************************************/ /* ARCHITECTURE SPECIFIC CONTSTANTS ******************************************/
#ifdef _M_IX86 #ifdef _M_IX86
#include "ks386.template.h" #include "ks386.template.h"
#elif defined(_M_AMD64) #elif defined(_M_AMD64)
#include "ksamd64.template.h" #include "ksamd64.template.h"
#elif defined(_M_ARM)
#include "ksarm.template.h"
#endif #endif
/* End of list */ /* End of list */

View file

@ -0,0 +1,105 @@
RAW(""),
RAW("#include <kxarm.h>"),
RAW(""),
HEADER("CPSR Values"),
CONSTANT(CPSR_THUMB_ENABLE),
CONSTANT(CPSR_FIQ_DISABLE),
CONSTANT(CPSR_IRQ_DISABLE),
CONSTANT(CPSR_USER_MODE),
CONSTANT(CPSR_FIQ_MODE),
CONSTANT(CPSR_IRQ_MODE),
CONSTANT(CPSR_SVC_MODE),
CONSTANT(CPSR_ABORT_MODE),
CONSTANT(CPSR_UND_MODE),
CONSTANT(CPSR_MODES),
HEADER("C1 Register Values"),
CONSTANT(C1_MMU_CONTROL),
CONSTANT(C1_ALIGNMENT_CONTROL),
CONSTANT(C1_DCACHE_CONTROL),
CONSTANT(C1_ICACHE_CONTROL),
CONSTANT(C1_VECTOR_CONTROL),
HEADER("Loader Parameter Block Offsets"),
OFFSET(LpbKernelStack, LOADER_PARAMETER_BLOCK, KernelStack),
OFFSET(LpbPanicStack, LOADER_PARAMETER_BLOCK, u.Arm.PanicStack),
OFFSET(LpbInterruptStack, LOADER_PARAMETER_BLOCK, u.Arm.InterruptStack),
HEADER("Trap Frame offsets"),
OFFSET(TrDbgArgMark, KTRAP_FRAME, DbgArgMark),
OFFSET(TrR0, KTRAP_FRAME, R0),
OFFSET(TrR1, KTRAP_FRAME, R1),
OFFSET(TrR2, KTRAP_FRAME, R2),
OFFSET(TrR3, KTRAP_FRAME, R3),
OFFSET(TrR4, KTRAP_FRAME, R4),
OFFSET(TrR5, KTRAP_FRAME, R5),
OFFSET(TrR6, KTRAP_FRAME, R6),
OFFSET(TrR7, KTRAP_FRAME, R7),
OFFSET(TrR8, KTRAP_FRAME, R8),
OFFSET(TrR9, KTRAP_FRAME, R9),
OFFSET(TrR10, KTRAP_FRAME, R10),
OFFSET(TrR11, KTRAP_FRAME, R11),
OFFSET(TrR12, KTRAP_FRAME, R12),
OFFSET(TrUserSp, KTRAP_FRAME, UserSp),
OFFSET(TrUserLr, KTRAP_FRAME, UserLr),
OFFSET(TrSvcSp, KTRAP_FRAME, SvcSp),
OFFSET(TrSvcLr, KTRAP_FRAME, SvcLr),
OFFSET(TrPc, KTRAP_FRAME, Pc),
OFFSET(TrSpsr, KTRAP_FRAME, Spsr),
SIZE(TrapFrameLength, KTRAP_FRAME),
HEADER("Exception Frame offsets"),
OFFSET(ExR4, KEXCEPTION_FRAME, R4),
OFFSET(ExR5, KEXCEPTION_FRAME, R5),
OFFSET(ExR6, KEXCEPTION_FRAME, R6),
OFFSET(ExR7, KEXCEPTION_FRAME, R7),
OFFSET(ExR8, KEXCEPTION_FRAME, R8),
OFFSET(ExR9, KEXCEPTION_FRAME, R9),
OFFSET(ExR10, KEXCEPTION_FRAME, R10),
OFFSET(ExR11, KEXCEPTION_FRAME, R11),
OFFSET(ExLr, KEXCEPTION_FRAME, Lr),
OFFSET(ExSpsr, KEXCEPTION_FRAME, Psr), // name?
SIZE(ExceptionFrameLength, KEXCEPTION_FRAME),
HEADER("PCR"),
CONSTANTX(KiPcr, 0xFFFFF000),
HEADER("PCR Offsets"),
//OFFSET(PcCurrentIrql, KPCR, CurrentIrql),
HEADER("KTHREAD Offsets"),
OFFSET(ThKernelStack, KTHREAD, KernelStack),
HEADER("CONTEXT Offsets"),
OFFSET(CsContextFlags, CONTEXT, ContextFlags),
OFFSET(CsR0, CONTEXT, R0),
OFFSET(CsR1, CONTEXT, R1),
OFFSET(CsR2, CONTEXT, R2),
OFFSET(CsR3, CONTEXT, R3),
OFFSET(CsR4, CONTEXT, R4),
OFFSET(CsR5, CONTEXT, R5),
OFFSET(CsR6, CONTEXT, R6),
OFFSET(CsR7, CONTEXT, R7),
OFFSET(CsR8, CONTEXT, R8),
OFFSET(CsR9, CONTEXT, R9),
OFFSET(CsR10, CONTEXT, R10),
OFFSET(CsR11, CONTEXT, R11),
OFFSET(CsR12, CONTEXT, R12),
OFFSET(CsSp, CONTEXT, Sp),
OFFSET(CsLr, CONTEXT, Lr),
OFFSET(CsPc, CONTEXT, Pc),
OFFSET(CsPsr, CONTEXT, Psr),
CONSTANT(CONTEXT_FULL),
HEADER("DebugService Control Types"),
CONSTANT(BREAKPOINT_BREAK),
CONSTANT(BREAKPOINT_PRINT),
CONSTANT(BREAKPOINT_PROMPT),
CONSTANT(BREAKPOINT_LOAD_SYMBOLS),
CONSTANT(BREAKPOINT_UNLOAD_SYMBOLS),
CONSTANT(BREAKPOINT_COMMAND_STRING),

View file

@ -1,22 +1,103 @@
#ifdef _MSC_VER
/* Globals */
GBLS AreaName
GBLS FuncName
GBLS PrologName
GBLS FuncEndName
AreaName SETS "|.text|"
MACRO
TEXTAREA
AREA |.text|,ALIGN=2,CODE,READONLY
AreaName SETS "|.text|"
MEND
MACRO
NESTED_ENTRY $Name
FuncName SETS "$Name"
PrologName SETS "$Name":CC:"_Prolog"
FuncEndName SETS "$Name":CC:"_end"
AREA |.pdata|,ALIGN=2,PDATA
ALIGN 2
EXPORT $FuncName [FUNC]
$FuncName
ROUT
MEND
MACRO
PROLOG_END
$PrologName
MEND
MACRO
ENTRY_END $Name
$FuncEndName
MEND
MACRO
LEAF_ENTRY $Name
FuncName SETS "$Name"
PrologName SETS "Invalid Prolog"
FuncEndName SETS "$Name":CC:"_end"
ALIGN 2
EXPORT $FuncName [FUNC]
$FuncName
ROUT
MEND
MACRO
LEAF_END $Name
$FuncEndName
MEND
MACRO
TRAP_PROLOG $Abort
fixme
MEND
MACRO
SYSCALL_PROLOG $Abort
fixme
MEND
MACRO
TRAP_EPILOG $SystemCall
fixme
MEND
#else
/* Compatibility define */
#define EQU .equ
.macro IMPORT Name
/* Ignore */
.endm
.macro TEXTAREA .macro TEXTAREA
.section .text, "rx" .section .text, "rx"
.align 2 .align 2
.endm .endm
.macro NESTED_ENTRY Name .macro NESTED_ENTRY Name
.global &Name FuncName .equ &Name
PrologName .equ &Name&_Prolog
FuncEndName .equ &Name&_end
.global &FuncName
.align 2 .align 2
.func &Name .func &FuncName
&Name: &FuncName:
.endm .endm
.macro PROLOG_END Name .macro PROLOG_END
prolog_&Name: \PrologName:
.endm .endm
.macro ENTRY_END Name .macro ENTRY_END Name
end_&Name: &FuncEndName:
.endfunc .endfunc
.endm .endm
@ -30,57 +111,39 @@
sub lr, lr, #4 sub lr, lr, #4
.endif .endif
//
// Save the bottom 4 registers // Save the bottom 4 registers
//
stmdb sp, {r0-r3} stmdb sp, {r0-r3}
//
// Save the abort lr, sp, spsr, cpsr // Save the abort lr, sp, spsr, cpsr
//
mov r0, lr mov r0, lr
mov r1, sp mov r1, sp
mrs r2, cpsr mrs r2, cpsr
mrs r3, spsr mrs r3, spsr
//
// Switch to SVC mode // Switch to SVC mode
//
bic r2, r2, #CPSR_MODES bic r2, r2, #CPSR_MODES
orr r2, r2, #CPSR_SVC_MODE orr r2, r2, #CPSR_SVC_MODE
msr cpsr_c, r2 msr cpsr_c, r2
//
// Save the SVC sp before we modify it // Save the SVC sp before we modify it
//
mov r2, sp mov r2, sp
//
// Make space for the trap frame // Make space for the trap frame
//
sub sp, sp, #TrapFrameLength sub sp, sp, #TrapFrameLength
//
// Save abt32 state // Save abt32 state
//
str r0, [sp, #TrPc] str r0, [sp, #TrPc]
str lr, [sp, #TrSvcLr] str lr, [sp, #TrSvcLr]
str r2, [sp, #TrSvcSp] str r2, [sp, #TrSvcSp]
//
// Restore the saved SPSR // Restore the saved SPSR
//
msr spsr_all, r3 msr spsr_all, r3
//
// Restore our 4 registers // Restore our 4 registers
//
ldmdb r1, {r0-r3} ldmdb r1, {r0-r3}
//
// Build trap frame // Build trap frame
// FIXME: Change to stmdb later // FIXME: Change to stmdb later
//
str r0, [sp, #TrR0] str r0, [sp, #TrR0]
str r1, [sp, #TrR1] str r1, [sp, #TrR1]
str r2, [sp, #TrR2] str r2, [sp, #TrR2]
@ -102,17 +165,13 @@
ldr r0, =0xBADB0D00 ldr r0, =0xBADB0D00
str r0, [sp, #TrDbgArgMark] str r0, [sp, #TrDbgArgMark]
.endm .endm
.macro SYSCALL_PROLOG .macro SYSCALL_PROLOG
//
// Make space for the trap frame // Make space for the trap frame
//
sub sp, sp, #TrapFrameLength sub sp, sp, #TrapFrameLength
//
// Build trap frame // Build trap frame
// FIXME: Change to stmdb later // FIXME: Change to stmdb later
//
str r0, [sp, #TrR0] str r0, [sp, #TrR0]
str r1, [sp, #TrR1] str r1, [sp, #TrR1]
str r2, [sp, #TrR2] str r2, [sp, #TrR2]
@ -136,26 +195,20 @@
ldr r0, =0xBADB0D00 ldr r0, =0xBADB0D00
str r0, [sp, #TrDbgArgMark] str r0, [sp, #TrDbgArgMark]
.endm .endm
.macro TRAP_EPILOG SystemCall .macro TRAP_EPILOG SystemCall
//
// ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00) // ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00)
//
ldr r0, [sp, #TrDbgArgMark] ldr r0, [sp, #TrDbgArgMark]
ldr r1, =0xBADB0D00 ldr r1, =0xBADB0D00
cmp r0, r1 cmp r0, r1
bne 1f bne 1f
//
// Get the SPSR and restore it // Get the SPSR and restore it
//
ldr r0, [sp, #TrSpsr] ldr r0, [sp, #TrSpsr]
msr spsr_all, r0 msr spsr_all, r0
//
// Restore the registers // Restore the registers
// FIXME: Use LDMIA later // FIXME: Use LDMIA later
//
mov r0, sp mov r0, sp
add r0, r0, #TrUserSp add r0, r0, #TrUserSp
ldm r0, {sp, lr}^ ldm r0, {sp, lr}^
@ -172,10 +225,8 @@
ldr r10, [sp, #TrR10] ldr r10, [sp, #TrR10]
ldr r11, [sp, #TrR11] ldr r11, [sp, #TrR11]
ldr r12, [sp, #TrR12] ldr r12, [sp, #TrR12]
//
// Restore program execution state // Restore program execution state
//
.if \SystemCall .if \SystemCall
ldr lr, [sp, #TrPc] ldr lr, [sp, #TrPc]
add sp, sp, #TrapFrameLength add sp, sp, #TrapFrameLength
@ -187,3 +238,7 @@
1: 1:
b . b .
.endm .endm
#endif

View file

@ -416,10 +416,10 @@ extern "C" {
int _Ch); int _Ch);
#if (defined(_X86_) && !defined(__x86_64)) #if (defined(_X86_) && !defined(__x86_64))
_CRT_NONSTDC_DEPRECATE(_inp) _CRTIMP int __cdecl inp(unsigned short); _CRT_NONSTDC_DEPRECATE(_inp) int __cdecl inp(unsigned short);
_CRT_NONSTDC_DEPRECATE(_inpw) _CRTIMP unsigned short __cdecl inpw(unsigned short); _CRT_NONSTDC_DEPRECATE(_inpw) unsigned short __cdecl inpw(unsigned short);
_CRT_NONSTDC_DEPRECATE(_outp) _CRTIMP int __cdecl outp(unsigned short,int); _CRT_NONSTDC_DEPRECATE(_outp) int __cdecl outp(unsigned short,int);
_CRT_NONSTDC_DEPRECATE(_outpw) _CRTIMP unsigned short __cdecl outpw(unsigned short,unsigned short); _CRT_NONSTDC_DEPRECATE(_outpw) unsigned short __cdecl outpw(unsigned short,unsigned short);
#endif #endif
#endif /* !NO_OLDNAMES */ #endif /* !NO_OLDNAMES */

View file

@ -237,9 +237,11 @@
#define _TRUNCATE ((size_t)-1) #define _TRUNCATE ((size_t)-1)
#endif #endif
#ifndef __REACTOS__
#define __STDC_SECURE_LIB__ 200411L #define __STDC_SECURE_LIB__ 200411L
#define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__ #define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
#define _SECURECRT_FILL_BUFFER_PATTERN 0xFD #define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
#endif
/** Type definitions *********************************************************/ /** Type definitions *********************************************************/

View file

@ -29,52 +29,84 @@ void _mm_lfence(void);
#pragma intrinsic(_mm_lfence) #pragma intrinsic(_mm_lfence)
void _mm_sfence(void); void _mm_sfence(void);
#pragma intrinsic(_mm_sfence) #pragma intrinsic(_mm_sfence)
void __nvreg_restore_fence(void);
void __nvreg_save_fence(void);
#endif #endif
#ifdef _M_AMD64 #if defined(_M_AMD64)
void __faststorefence(void); void __faststorefence(void);
#pragma intrinsic(__faststorefence) #pragma intrinsic(__faststorefence)
#elif defined(_M_ARM)
__int16 __iso_volatile_load16(const volatile __int16 *);
#pragma intrinsic(__iso_volatile_load16)
__int32 __iso_volatile_load32(const volatile __int32 *);
#pragma intrinsic(__iso_volatile_load32)
__int64 __iso_volatile_load64(const volatile __int64 *);
#pragma intrinsic(__iso_volatile_load64)
__int8 __iso_volatile_load8(const volatile __int8 *);
#pragma intrinsic(__iso_volatile_load8)
void __iso_volatile_store16(volatile __int16 *, __int16);
#pragma intrinsic(__iso_volatile_store16)
void __iso_volatile_store32(volatile __int32 *, __int32);
#pragma intrinsic(__iso_volatile_store32)
void __iso_volatile_store64(volatile __int64 *, __int64);
#pragma intrinsic(__iso_volatile_store64)
void __iso_volatile_store8(volatile __int8 *, __int8);
#pragma intrinsic(__iso_volatile_store8)
#endif #endif
/*** Atomic operations ***/ /*** Atomic operations ***/
long _InterlockedCompareExchange(volatile long * Destination, long Exchange, long Comperand); long _InterlockedCompareExchange(_Interlocked_operand_ volatile long * Destination, long Exchange, long Comperand);
#pragma intrinsic(_InterlockedCompareExchange) #pragma intrinsic(_InterlockedCompareExchange)
long _InterlockedExchange(volatile long * Target, long Value); char _InterlockedCompareExchange8(_Interlocked_operand_ char volatile * Destination, char Exchange, char Comparand);
#pragma intrinsic(_InterlockedCompareExchange8)
short _InterlockedCompareExchange16(_Interlocked_operand_ short volatile * Destination, short Exchange, short Comparand);
#pragma intrinsic(_InterlockedCompareExchange16)
__int64 _InterlockedCompareExchange64(_Interlocked_operand_ volatile __int64 * Destination, __int64 Exchange, __int64 Comperand);
#pragma intrinsic(_InterlockedCompareExchange64)
long _InterlockedExchange(_Interlocked_operand_ volatile long * Target, long Value);
#pragma intrinsic(_InterlockedExchange) #pragma intrinsic(_InterlockedExchange)
long _InterlockedExchangeAdd(volatile long * Addend, long Value); char _InterlockedExchange8(_Interlocked_operand_ char volatile * Target, char Value);
#pragma intrinsic(_InterlockedExchange8)
short _InterlockedExchange16(_Interlocked_operand_ short volatile * Target, short Value);
#pragma intrinsic(_InterlockedExchange16)
long _InterlockedExchangeAdd(_Interlocked_operand_ volatile long * Addend, long Value);
#pragma intrinsic(_InterlockedExchangeAdd) #pragma intrinsic(_InterlockedExchangeAdd)
char _InterlockedAnd8(volatile char * value, char mask); char _InterlockedExchangeAdd8(_Interlocked_operand_ char volatile * Addend, char Value);
#pragma intrinsic(_InterlockedExchangeAdd8)
short _InterlockedExchangeAdd16(_Interlocked_operand_ short volatile * Addend, short Value);
#pragma intrinsic(_InterlockedExchangeAdd16)
char _InterlockedAnd8(_Interlocked_operand_ volatile char * value, char mask);
#pragma intrinsic(_InterlockedAnd8) #pragma intrinsic(_InterlockedAnd8)
short _InterlockedAnd16(volatile short * value, short mask); short _InterlockedAnd16(_Interlocked_operand_ volatile short * value, short mask);
#pragma intrinsic(_InterlockedAnd16) #pragma intrinsic(_InterlockedAnd16)
long _InterlockedAnd(volatile long * value, long mask); long _InterlockedAnd(_Interlocked_operand_ volatile long * value, long mask);
#pragma intrinsic(_InterlockedAnd) #pragma intrinsic(_InterlockedAnd)
char _InterlockedOr8(volatile char * value, char mask); char _InterlockedOr8(_Interlocked_operand_ volatile char * value, char mask);
#pragma intrinsic(_InterlockedOr8) #pragma intrinsic(_InterlockedOr8)
short _InterlockedOr16(volatile short * value, short mask); short _InterlockedOr16(_Interlocked_operand_ volatile short * value, short mask);
#pragma intrinsic(_InterlockedOr16) #pragma intrinsic(_InterlockedOr16)
long _InterlockedOr(volatile long * value, long mask); long _InterlockedOr(_Interlocked_operand_ volatile long * value, long mask);
#pragma intrinsic(_InterlockedOr) #pragma intrinsic(_InterlockedOr)
char _InterlockedXor8(volatile char * value, char mask); char _InterlockedXor8(_Interlocked_operand_ volatile char * value, char mask);
#pragma intrinsic(_InterlockedXor8) #pragma intrinsic(_InterlockedXor8)
short _InterlockedXor16(volatile short * value, short mask); short _InterlockedXor16(_Interlocked_operand_ volatile short * value, short mask);
#pragma intrinsic(_InterlockedXor16) #pragma intrinsic(_InterlockedXor16)
long _InterlockedXor(volatile long * value, long mask); long _InterlockedXor(_Interlocked_operand_ volatile long * value, long mask);
#pragma intrinsic(_InterlockedXor) #pragma intrinsic(_InterlockedXor)
long _InterlockedDecrement(volatile long * lpAddend); long _InterlockedDecrement(_Interlocked_operand_ volatile long * lpAddend);
#pragma intrinsic(_InterlockedDecrement) #pragma intrinsic(_InterlockedDecrement)
long _InterlockedIncrement(volatile long * lpAddend); long _InterlockedIncrement(_Interlocked_operand_ volatile long * lpAddend);
#pragma intrinsic(_InterlockedIncrement) #pragma intrinsic(_InterlockedIncrement)
short _InterlockedDecrement16(volatile short * lpAddend); short _InterlockedDecrement16(_Interlocked_operand_ volatile short * lpAddend);
#pragma intrinsic(_InterlockedDecrement16) #pragma intrinsic(_InterlockedDecrement16)
short _InterlockedIncrement16(volatile short * lpAddend); short _InterlockedIncrement16(_Interlocked_operand_ volatile short * lpAddend);
#pragma intrinsic(_InterlockedIncrement16) #pragma intrinsic(_InterlockedIncrement16)
unsigned char _interlockedbittestandreset(volatile long * a, long b); unsigned char _interlockedbittestandreset(volatile long * a, long b);
#pragma intrinsic(_interlockedbittestandreset) #pragma intrinsic(_interlockedbittestandreset)
unsigned char _interlockedbittestandset(volatile long * a, long b); unsigned char _interlockedbittestandset(volatile long * a, long b);
#pragma intrinsic(_interlockedbittestandset) #pragma intrinsic(_interlockedbittestandset)
#if defined(_M_IX86) #if defined(_M_IX86)
long _InterlockedAddLargeStatistic(volatile __int64 * Addend, long Value); long _InterlockedAddLargeStatistic(_Interlocked_operand_ volatile __int64 * Addend, long Value);
#pragma intrinsic(_InterlockedAddLargeStatistic) #pragma intrinsic(_InterlockedAddLargeStatistic)
#elif defined(_M_AMD64) #elif defined(_M_AMD64)
__int64 _InterlockedExchange64(volatile __int64 * Target, __int64 Value); __int64 _InterlockedExchange64(volatile __int64 * Target, __int64 Value);
@ -85,12 +117,12 @@ void * _InterlockedCompareExchangePointer(void * volatile * Destination, void *
#pragma intrinsic(_InterlockedCompareExchangePointer) #pragma intrinsic(_InterlockedCompareExchangePointer)
void * _InterlockedExchangePointer(void * volatile * Target, void * Value); void * _InterlockedExchangePointer(void * volatile * Target, void * Value);
#pragma intrinsic(_InterlockedExchangePointer) #pragma intrinsic(_InterlockedExchangePointer)
unsigned char _InterlockedCompareExchange128(_Interlocked_operand_ volatile __int64 * Destination, __int64 ExchangeHigh, __int64 ExchangeLow, __int64 * ComparandResult);
#pragma intrinsic(_InterlockedCompareExchange128)
__int64 _InterlockedAnd64(volatile __int64 * value, __int64 mask); __int64 _InterlockedAnd64(volatile __int64 * value, __int64 mask);
#pragma intrinsic(_InterlockedAnd64) #pragma intrinsic(_InterlockedAnd64)
__int64 _InterlockedOr64(volatile __int64 * value, __int64 mask); __int64 _InterlockedOr64(volatile __int64 * value, __int64 mask);
#pragma intrinsic(_InterlockedOr64) #pragma intrinsic(_InterlockedOr64)
__int64 _InterlockedCompareExchange64(volatile __int64 * Destination, __int64 Exchange, __int64 Comperand);
#pragma intrinsic(_InterlockedCompareExchange64)
__int64 _InterlockedDecrement64(volatile __int64 * lpAddend); __int64 _InterlockedDecrement64(volatile __int64 * lpAddend);
#pragma intrinsic(_InterlockedDecrement64) #pragma intrinsic(_InterlockedDecrement64)
__int64 _InterlockedIncrement64(volatile __int64 * lpAddend); __int64 _InterlockedIncrement64(volatile __int64 * lpAddend);
@ -99,10 +131,161 @@ unsigned char _interlockedbittestandreset64(volatile __int64 * a, __int64 b);
#pragma intrinsic(_interlockedbittestandreset64) #pragma intrinsic(_interlockedbittestandreset64)
unsigned char _interlockedbittestandset64(volatile __int64 * a, __int64 b); unsigned char _interlockedbittestandset64(volatile __int64 * a, __int64 b);
#pragma intrinsic(_interlockedbittestandset64) #pragma intrinsic(_interlockedbittestandset64)
long _InterlockedAnd_np(volatile long * Value, long Mask);
#pragma intrinsic(_InterlockedAnd_np)
char _InterlockedAnd8_np(volatile char * Value, char Mask);
#pragma intrinsic(_InterlockedAnd8_np)
short _InterlockedAnd16_np(volatile short * Value, short Mask);
#pragma intrinsic(_InterlockedAnd16_np)
__int64 _InterlockedAnd64_np(volatile __int64 * Value, __int64 Mask);
#pragma intrinsic(_InterlockedAnd64_np)
short _InterlockedCompareExchange16_np(volatile short * Destination, short Exchange, short Comparand);
#pragma intrinsic(_InterlockedCompareExchange16_np)
__int64 _InterlockedCompareExchange64_np(volatile __int64 * Destination, __int64 Exchange, __int64 Comparand);
#pragma intrinsic(_InterlockedCompareExchange64_np)
unsigned char _InterlockedCompareExchange128_np(volatile __int64 * Destination, __int64 ExchangeHigh, __int64 ExchangeLow, __int64 * ComparandResult);
#pragma intrinsic(_InterlockedCompareExchange128_np)
void * _InterlockedCompareExchangePointer_np(void * volatile * Destination, void * Exchange, void * Comparand);
#pragma intrinsic(_InterlockedCompareExchangePointer_np)
long _InterlockedCompareExchange_np(volatile long * Destination, long Exchange, long Comparand);
#pragma intrinsic(_InterlockedCompareExchange_np)
short _InterlockedOr16_np(volatile short * Value, short Mask);
#pragma intrinsic(_InterlockedOr16_np)
char _InterlockedOr8_np(volatile char * Value, char Mask);
#pragma intrinsic(_InterlockedOr8_np)
long _InterlockedOr_np(volatile long * Value, long Mask);
#pragma intrinsic(_InterlockedOr_np)
short _InterlockedXor16_np(volatile short * Value, short Mask);
#pragma intrinsic(_InterlockedXor16_np)
__int64 _InterlockedXor64_np(volatile __int64 * Value, __int64 Mask);
#pragma intrinsic(_InterlockedXor64_np)
char _InterlockedXor8_np(volatile char * Value, char Mask);
#pragma intrinsic(_InterlockedXor8_np)
long _InterlockedXor_np(volatile long * Value, long Mask);
#pragma intrinsic(_InterlockedXor_np)
__int64 _InterlockedOr64_np(volatile __int64 * Value, __int64 Mask);
#pragma intrinsic(_InterlockedOr64_np)
#elif defined(_M_ARM)
long _InterlockedAdd(_Interlocked_operand_ long volatile * Addend, long Value);
__int64 _InterlockedAdd64(_Interlocked_operand_ __int64 volatile * Addend, __int64 Value);
__int64 _InterlockedAdd64_acq(__int64 volatile * Addend, __int64 Value);
__int64 _InterlockedAdd64_nf(__int64 volatile * Addend, __int64 Value);
__int64 _InterlockedAdd64_rel(__int64 volatile * Addend, __int64 Value);
long _InterlockedAdd_acq(long volatile * Addend, long Value);
long _InterlockedAdd_nf(long volatile * Addend, long Value);
long _InterlockedAdd_rel(long volatile * Addend, long Value);
short _InterlockedAnd16_acq(short volatile * Value, short Mask);
short _InterlockedAnd16_nf(short volatile * Value, short Mask);
short _InterlockedAnd16_rel(short volatile * Value, short Mask);
__int64 _InterlockedAnd64_acq(__int64 volatile * Value, __int64 Mask);
__int64 _InterlockedAnd64_nf(__int64 volatile * Value, __int64 Mask);
__int64 _InterlockedAnd64_rel(__int64 volatile * Value, __int64 Mask);
char _InterlockedAnd8_acq(char volatile * Value, char Mask);
char _InterlockedAnd8_nf(char volatile * Value, char Mask);
char _InterlockedAnd8_rel(char volatile * Value, char Mask);
long _InterlockedAnd_acq(long volatile * Value, long Mask);
long _InterlockedAnd_nf(long volatile * Value, long Mask);
long _InterlockedAnd_rel(long volatile * Value, long Mask);
short _InterlockedCompareExchange16_acq(short volatile * Destination, short Exchange, short Comparand);
short _InterlockedCompareExchange16_nf(short volatile * Destination, short Exchange, short Comparand);
short _InterlockedCompareExchange16_rel(short volatile * Destination, short Exchange, short Comparand);
__int64 _InterlockedCompareExchange64_acq(__int64 volatile * Destination, __int64 Exchange, __int64 Comparand);
__int64 _InterlockedCompareExchange64_nf(__int64 volatile * Destination, __int64 Exchange, __int64 Comparand);
__int64 _InterlockedCompareExchange64_rel(__int64 volatile * Destination, __int64 Exchange, __int64 Comparand);
char _InterlockedCompareExchange8_acq(char volatile * Destination, char Exchange, char Comparand);
char _InterlockedCompareExchange8_nf(char volatile * Destination, char Exchange, char Comparand);
char _InterlockedCompareExchange8_rel(char volatile * Destination, char Exchange, char Comparand);
void * _InterlockedCompareExchangePointer_acq(void * volatile * Destination, void * Exchange, void * Comparand);
void * _InterlockedCompareExchangePointer_nf(void * volatile * Destination, void * Exchange, void * Comparand);
void * _InterlockedCompareExchangePointer_rel(void * volatile * Destination, void * Exchange, void * Comparand);
long _InterlockedCompareExchange_acq(long volatile * Destination, long Exchange, long Comparand);
long _InterlockedCompareExchange_nf(long volatile * Destination, long Exchange, long Comparand);
long _InterlockedCompareExchange_rel(long volatile * Destination, long Exchange, long Comparand);
short _InterlockedDecrement16_acq(short volatile * Addend);
short _InterlockedDecrement16_nf(short volatile * Addend);
short _InterlockedDecrement16_rel(short volatile * Addend);
__int64 _InterlockedDecrement64_acq(__int64 volatile * Addend);
__int64 _InterlockedDecrement64_nf(__int64 volatile * Addend);
__int64 _InterlockedDecrement64_rel(__int64 volatile * Addend);
long _InterlockedDecrement_acq(long volatile * Addend);
long _InterlockedDecrement_nf(long volatile * Addend);
long _InterlockedDecrement_rel(long volatile * Addend);
short _InterlockedExchange16_acq(short volatile * Target, short Value);
short _InterlockedExchange16_nf(short volatile * Target, short Value);
__int64 _InterlockedExchange64_acq(__int64 volatile * Target, __int64 Value);
__int64 _InterlockedExchange64_nf(__int64 volatile * Target, __int64 Value);
char _InterlockedExchange8_acq(char volatile * Target, char Value);
char _InterlockedExchange8_nf(char volatile * Target, char Value);
short _InterlockedExchangeAdd16_acq(short volatile * Addend, short Value);
short _InterlockedExchangeAdd16_nf(short volatile * Addend, short Value);
short _InterlockedExchangeAdd16_rel(short volatile * Addend, short Value);
__int64 _InterlockedExchangeAdd64_acq(__int64 volatile * Addend, __int64 Value);
__int64 _InterlockedExchangeAdd64_nf(__int64 volatile * Addend, __int64 Value);
__int64 _InterlockedExchangeAdd64_rel(__int64 volatile * Addend, __int64 Value);
char _InterlockedExchangeAdd8_acq(char volatile * Addend, char Value);
char _InterlockedExchangeAdd8_nf(char volatile * Addend, char Value);
char _InterlockedExchangeAdd8_rel(char volatile * Addend, char Value);
long _InterlockedExchangeAdd_acq(long volatile * Addend, long Value);
long _InterlockedExchangeAdd_nf(long volatile * Addend, long Value);
long _InterlockedExchangeAdd_rel(long volatile * Addend, long Value);
void * _InterlockedExchangePointer_acq(void * volatile * Target, void * Value);
void * _InterlockedExchangePointer_nf(void * volatile * Target, void * Value);
long _InterlockedExchange_acq(long volatile * Target, long Value);
long _InterlockedExchange_nf(long volatile * Target, long Value);
short _InterlockedIncrement16_acq(short volatile * Addend);
short _InterlockedIncrement16_nf(short volatile * Addend);
short _InterlockedIncrement16_rel(short volatile * Addend);
__int64 _InterlockedIncrement64_acq(__int64 volatile * Addend);
__int64 _InterlockedIncrement64_nf(__int64 volatile * Addend);
__int64 _InterlockedIncrement64_rel(__int64 volatile * Addend);
long _InterlockedIncrement_acq(long volatile * Addend);
long _InterlockedIncrement_nf(long volatile * Addend);
long _InterlockedIncrement_rel(long volatile * Addend);
short _InterlockedOr16_acq(short volatile * Value, short Mask);
short _InterlockedOr16_nf(short volatile * Value, short Mask);
short _InterlockedOr16_rel(short volatile * Value, short Mask);
__int64 _InterlockedOr64_acq(__int64 volatile * Value, __int64 Mask);
__int64 _InterlockedOr64_nf(__int64 volatile * Value, __int64 Mask);
__int64 _InterlockedOr64_rel(__int64 volatile * Value, __int64 Mask);
char _InterlockedOr8_acq(char volatile * Value, char Mask);
char _InterlockedOr8_nf(char volatile * Value, char Mask);
char _InterlockedOr8_rel(char volatile * Value, char Mask);
long _InterlockedOr_acq(long volatile * Value, long Mask);
long _InterlockedOr_nf(long volatile * Value, long Mask);
long _InterlockedOr_rel(long volatile * Value, long Mask);
short _InterlockedXor16_acq(short volatile * Value, short Mask);
short _InterlockedXor16_nf(short volatile * Value, short Mask);
short _InterlockedXor16_rel(short volatile * Value, short Mask);
__int64 _InterlockedXor64_acq(__int64 volatile * Value, __int64 Mask);
__int64 _InterlockedXor64_nf(__int64 volatile * Value, __int64 Mask);
__int64 _InterlockedXor64_rel(_Interlocked_operand_ __int64 volatile * Value, __int64 Mask);
char _InterlockedXor8_acq(char volatile * Value, char Mask);
char _InterlockedXor8_nf(char volatile * Value, char Mask);
char _InterlockedXor8_rel(char volatile * Value, char Mask);
long _InterlockedXor_acq(long volatile * Value, long Mask);
long _InterlockedXor_nf(long volatile * Value, long Mask);
long _InterlockedXor_rel(long volatile * Value, long Mask);
unsigned char _interlockedbittestandreset_acq(long volatile *, long);
unsigned char _interlockedbittestandreset_nf(long volatile *, long);
unsigned char _interlockedbittestandreset_rel(long volatile *, long);
unsigned char _interlockedbittestandset_acq(long volatile *, long);
unsigned char _interlockedbittestandset_nf(long volatile *, long);
unsigned char _interlockedbittestandset_rel(long volatile *, long);
#endif
#if defined(_M_AMD64) || defined(_M_ARM)
__int64 _InterlockedAnd64(_Interlocked_operand_ __int64 volatile * Value, __int64 Mask);
void * _InterlockedCompareExchangePointer(_Interlocked_operand_ void * volatile * Destination, void * Exchange, void * Comparand);
__int64 _InterlockedDecrement64(_Interlocked_operand_ __int64 volatile * Addend);
__int64 _InterlockedExchange64(_Interlocked_operand_ __int64 volatile * Target, __int64 Value);
__int64 _InterlockedExchangeAdd64(_Interlocked_operand_ __int64 volatile * Addend, __int64 Value);
void * _InterlockedExchangePointer(_Interlocked_operand_ void * volatile * Target, void * Value);
__int64 _InterlockedIncrement64(_Interlocked_operand_ __int64 volatile * Addend);
__int64 _InterlockedOr64(_Interlocked_operand_ __int64 volatile * Value, __int64 Mask);
__int64 _InterlockedXor64(_Interlocked_operand_ __int64 volatile * Value, __int64 Mask);
#endif #endif
#if defined(_M_IX86) || defined(_M_AMD64)
/*** String operations ***/ /*** String operations ***/
#if defined(_M_IX86) || defined(_M_AMD64)
void __stosb(unsigned char * Dest, unsigned char Data, size_t Count); void __stosb(unsigned char * Dest, unsigned char Data, size_t Count);
#pragma intrinsic(__stosb) #pragma intrinsic(__stosb)
void __stosw(unsigned short * Dest, unsigned short Data, size_t Count); void __stosw(unsigned short * Dest, unsigned short Data, size_t Count);
@ -123,8 +306,8 @@ void __movsq(unsigned __int64 * Destination, unsigned __int64 const * Source, si
#pragma intrinsic(__movsq) #pragma intrinsic(__movsq)
#endif #endif
#if defined(_M_AMD64)
/*** GS segment addressing ***/ /*** GS segment addressing ***/
#if defined(_M_AMD64)
void __writegsbyte(unsigned long Offset, unsigned char Data); void __writegsbyte(unsigned long Offset, unsigned char Data);
#pragma intrinsic(__writegsbyte) #pragma intrinsic(__writegsbyte)
void __writegsword(unsigned long Offset, unsigned short Data); void __writegsword(unsigned long Offset, unsigned short Data);
@ -147,24 +330,28 @@ void __incgsword(unsigned long Offset);
#pragma intrinsic(__incgsword) #pragma intrinsic(__incgsword)
void __incgsdword(unsigned long Offset); void __incgsdword(unsigned long Offset);
#pragma intrinsic(__incgsdword) #pragma intrinsic(__incgsdword)
void __incgsqword(unsigned long);
#pragma intrinsic(__incgsqword)
void __addgsbyte(unsigned long Offset, unsigned char Data); void __addgsbyte(unsigned long Offset, unsigned char Data);
#pragma intrinsic(__addgsbyte) #pragma intrinsic(__addgsbyte)
void __addgsword(unsigned long Offset, unsigned short Data); void __addgsword(unsigned long Offset, unsigned short Data);
#pragma intrinsic(__addgsword) #pragma intrinsic(__addgsword)
void __addgsdword(unsigned long Offset, unsigned int Data); void __addgsdword(unsigned long Offset, unsigned long Data);
#pragma intrinsic(__addgsdword) #pragma intrinsic(__addgsdword)
void __addgsqword(unsigned long Offset, unsigned __int64 Data); void __addgsqword(unsigned long Offset, unsigned __int64 Data);
#pragma intrinsic(__addgsqword) #pragma intrinsic(__addgsqword)
#endif #endif
#if defined(_M_IX86)
/*** FS segment addressing ***/ /*** FS segment addressing ***/
#if defined(_M_IX86)
void __writefsbyte(unsigned long Offset, unsigned char Data); void __writefsbyte(unsigned long Offset, unsigned char Data);
#pragma intrinsic(__writefsbyte) #pragma intrinsic(__writefsbyte)
void __writefsword(unsigned long Offset, unsigned short Data); void __writefsword(unsigned long Offset, unsigned short Data);
#pragma intrinsic(__writefsword) #pragma intrinsic(__writefsword)
void __writefsdword(unsigned long Offset, unsigned long Data); void __writefsdword(unsigned long Offset, unsigned long Data);
#pragma intrinsic(__writefsdword) #pragma intrinsic(__writefsdword)
void __writefsqword(unsigned long Offset, unsigned __int64 Data);
#pragma intrinsic(__writefsdword)
unsigned char __readfsbyte(unsigned long Offset); unsigned char __readfsbyte(unsigned long Offset);
#pragma intrinsic(__readfsbyte) #pragma intrinsic(__readfsbyte)
unsigned short __readfsword(unsigned long Offset); unsigned short __readfsword(unsigned long Offset);
@ -181,11 +368,10 @@ void __addfsbyte(unsigned long Offset, unsigned char Data);
#pragma intrinsic(__addfsbyte) #pragma intrinsic(__addfsbyte)
void __addfsword(unsigned long Offset, unsigned short Data); void __addfsword(unsigned long Offset, unsigned short Data);
#pragma intrinsic(__addfsword) #pragma intrinsic(__addfsword)
void __addfsdword(unsigned long Offset, unsigned int Data); void __addfsdword(unsigned long Offset, unsigned long Data);
#pragma intrinsic(__addfsdword) #pragma intrinsic(__addfsdword)
#endif #endif
/*** Bit manipulation ***/ /*** Bit manipulation ***/
unsigned char _BitScanForward(unsigned long * Index, unsigned long Mask); unsigned char _BitScanForward(unsigned long * Index, unsigned long Mask);
#pragma intrinsic(_BitScanForward) #pragma intrinsic(_BitScanForward)
@ -209,14 +395,22 @@ unsigned char _rotl8(unsigned char value, unsigned char shift);
#pragma intrinsic(_rotl8) #pragma intrinsic(_rotl8)
unsigned short _rotl16(unsigned short value, unsigned char shift); unsigned short _rotl16(unsigned short value, unsigned char shift);
#pragma intrinsic(_rotl16) #pragma intrinsic(_rotl16)
unsigned int _rotl(unsigned int value, int shift); _Check_return_ unsigned int _rotl(unsigned int value, int shift);
#pragma intrinsic(_rotl) #pragma intrinsic(_rotl)
unsigned int _rotr(unsigned int value, int shift); _Check_return_ unsigned __int64 __cdecl _rotl64(_In_ unsigned __int64 Value, _In_ int Shift);
#pragma intrinsic(_rotr) #pragma intrinsic(_rotl64)
_Check_return_ unsigned long __cdecl _lrotl(_In_ unsigned long, _In_ int);
#pragma intrinsic(_lrotl)
unsigned char _rotr8(unsigned char value, unsigned char shift); unsigned char _rotr8(unsigned char value, unsigned char shift);
#pragma intrinsic(_rotr8) #pragma intrinsic(_rotr8)
unsigned short _rotr16(unsigned short value, unsigned char shift); unsigned short _rotr16(unsigned short value, unsigned char shift);
#pragma intrinsic(_rotr16) #pragma intrinsic(_rotr16)
_Check_return_ unsigned int _rotr(unsigned int value, int shift);
#pragma intrinsic(_rotr)
_Check_return_ unsigned __int64 __cdecl _rotr64(_In_ unsigned __int64 Value, _In_ int Shift);
#pragma intrinsic(_rotr64)
_Check_return_ unsigned long __cdecl _lrotr(_In_ unsigned long, _In_ int);
#pragma intrinsic(_lrotr)
unsigned short _byteswap_ushort(unsigned short value); unsigned short _byteswap_ushort(unsigned short value);
#pragma intrinsic(_byteswap_ushort) #pragma intrinsic(_byteswap_ushort)
unsigned long _byteswap_ulong(unsigned long value); unsigned long _byteswap_ulong(unsigned long value);
@ -230,26 +424,86 @@ __int64 __ll_rshift(__int64 Mask, int Bit);
#pragma intrinsic(__ll_rshift) #pragma intrinsic(__ll_rshift)
unsigned __int64 __ull_rshift(unsigned __int64 Mask, int Bit); unsigned __int64 __ull_rshift(unsigned __int64 Mask, int Bit);
#pragma intrinsic(__ull_rshift) #pragma intrinsic(__ull_rshift)
unsigned int __lzcnt(unsigned int Value);
#pragma intrinsic(__lzcnt)
unsigned short __lzcnt16(unsigned short Value);
#pragma intrinsic(__lzcnt16)
unsigned int __popcnt(unsigned int Value);
#pragma intrinsic(__popcnt)
unsigned short __popcnt16(unsigned short Value);
#pragma intrinsic(__popcnt16)
#endif #endif
#ifdef _M_AMD64 #ifdef _M_AMD64
unsigned __int64 __shiftleft128(unsigned __int64 LowPart, unsigned __int64 HighPart, unsigned char Shift);
#pragma intrinsic(__shiftleft128)
unsigned __int64 __shiftright128(unsigned __int64 LowPart, unsigned __int64 HighPart, unsigned char Shift);
#pragma intrinsic(__shiftright128)
unsigned char _bittest64(__int64 const *a, __int64 b); unsigned char _bittest64(__int64 const *a, __int64 b);
#pragma intrinsic(_bittest64) #pragma intrinsic(_bittest64)
unsigned char _bittestandcomplement64(__int64 *a, __int64 b);
#pragma intrinsic(_bittestandcomplement64)
unsigned char _bittestandreset64(__int64 *a, __int64 b);
#pragma intrinsic(_bittestandreset64)
unsigned char _bittestandset64(__int64 *a, __int64 b);
#pragma intrinsic(_bittestandset64)
unsigned __int64 __lzcnt64(unsigned __int64 Value);
#pragma intrinsic(__lzcnt64)
unsigned __int64 __popcnt64(unsigned __int64 Value);
#pragma intrinsic(__popcnt64)
#elif defined(_M_ARM)
unsigned int _CountLeadingOnes(unsigned long Value);
unsigned int _CountLeadingOnes64(unsigned __int64 Value);
unsigned int _CountLeadingSigns(long Value);
unsigned int _CountLeadingSigns64(__int64 Value);
unsigned int _CountLeadingZeros(unsigned long Value);
unsigned int _CountLeadingZeros64(unsigned __int64 Value);
unsigned int _CountOneBits(unsigned long Value);
unsigned int _CountOneBits64(unsigned __int64 Value);
#endif #endif
/*** 64/128-bit math ***/
__int64 __cdecl _abs64(__int64);
#pragma intrinsic(_abs64)
#if defined(_M_IX86) || defined(_M_AMD64) #if defined(_M_IX86) || defined(_M_AMD64)
/*** 64-bit math ***/
__int64 __emul(int a, int b); __int64 __emul(int a, int b);
#pragma intrinsic(__emul) #pragma intrinsic(__emul)
unsigned __int64 __emulu(unsigned int a, unsigned int b); unsigned __int64 __emulu(unsigned int a, unsigned int b);
#pragma intrinsic(__emulu) #pragma intrinsic(__emulu)
#endif #endif
#ifdef _M_AMD64 #ifdef _M_AMD64
__int64 __mulh(__int64 a, __int64 b);
#pragma intrinsic(__mulh)
unsigned __int64 __umulh(unsigned __int64 a, unsigned __int64 b); unsigned __int64 __umulh(unsigned __int64 a, unsigned __int64 b);
#pragma intrinsic(__umulh) #pragma intrinsic(__umulh)
__int64 _mul128(__int64 Multiplier, __int64 Multiplicand, __int64 * HighProduct);
#pragma intrinsic(_mul128)
unsigned __int64 _umul128(unsigned __int64 Multiplier, unsigned __int64 Multiplicand, unsigned __int64 * HighProduct);
#pragma intrinsic(_umul128)
#elif defined(_M_ARM)
long _MulHigh(long Multiplier, long Multiplicand);
#pragma intrinsic(_MulHigh)
unsigned long _MulUnsignedHigh(unsigned long Multiplier, unsigned long Multiplicand);
#pragma intrinsic(_MulUnsignedHigh)
#endif
/** Floating point stuff **/
#if defined(_M_ARM)
int _isunordered(double arg1, double arg2);
#pragma intrinsic(_isunordered)
int _isunorderedf(float arg1, float arg2);
#pragma intrinsic(_isunorderedf)
double _CopyDoubleFromInt64(__int64);
#pragma intrinsic(_CopyDoubleFromInt64)
float _CopyFloatFromInt32(__int32);
#pragma intrinsic(_CopyFloatFromInt32)
__int32 _CopyInt32FromFloat(float);
#pragma intrinsic(_CopyInt32FromFloat)
__int64 _CopyInt64FromDouble(double);
#pragma intrinsic(_CopyInt64FromDouble)
#endif #endif
#if defined(_M_IX86) || defined(_M_AMD64)
/*** Port I/O ***/ /*** Port I/O ***/
#if defined(_M_IX86) || defined(_M_AMD64)
unsigned char __inbyte(unsigned short Port); unsigned char __inbyte(unsigned short Port);
#pragma intrinsic(__inbyte) #pragma intrinsic(__inbyte)
unsigned short __inword(unsigned short Port); unsigned short __inword(unsigned short Port);
@ -274,21 +528,49 @@ void __outwordstring(unsigned short Port, unsigned short * Buffer, unsigned long
#pragma intrinsic(__outwordstring) #pragma intrinsic(__outwordstring)
void __outdwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count); void __outdwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count);
#pragma intrinsic(__outdwordstring) #pragma intrinsic(__outdwordstring)
int __cdecl _inp(unsigned short Port);
#pragma intrinsic(_inp)
unsigned long __cdecl _inpd(unsigned short Port);
#pragma intrinsic(_inpd)
unsigned short __cdecl _inpw(unsigned short Port);
#pragma intrinsic(_inpw)
int __cdecl inp(unsigned short Port);
#pragma intrinsic(inp)
unsigned long __cdecl inpd(unsigned short Port);
#pragma intrinsic(inpd)
unsigned short __cdecl inpw(unsigned short Port);
#pragma intrinsic(inpw)
int __cdecl _outp(unsigned short Port, int Value);
#pragma intrinsic(_outp)
unsigned long __cdecl _outpd(unsigned short Port, unsigned long Value);
#pragma intrinsic(_outpd)
unsigned short __cdecl _outpw(unsigned short Port, unsigned short Value);
#pragma intrinsic(_outpw)
int __cdecl outp(unsigned short Port, int Value);
#pragma intrinsic(outp)
unsigned long __cdecl outpd(unsigned short Port, unsigned long Value);
#pragma intrinsic(outpd)
unsigned short __cdecl outpw(unsigned short Port, unsigned short Value);
#pragma intrinsic(outpw)
#endif #endif
#if defined(_M_IX86) || defined(_M_AMD64)
/*** System information ***/ /*** System information ***/
void __cpuid(int CPUInfo[], int InfoType); #if defined(_M_IX86) || defined(_M_AMD64)
void __cpuid(int CPUInfo[4], int InfoType);
#pragma intrinsic(__cpuid) #pragma intrinsic(__cpuid)
void __cpuidex(int CPUInfo[4], int InfoType, int ECXValue);
#pragma intrinsic(__cpuidex)
unsigned __int64 __rdtsc(void); unsigned __int64 __rdtsc(void);
#pragma intrinsic(__rdtsc) #pragma intrinsic(__rdtsc)
unsigned __int64 __rdtscp(unsigned int *);
#pragma intrinsic(__rdtscp)
void __writeeflags(uintptr_t Value); void __writeeflags(uintptr_t Value);
#pragma intrinsic(__writeeflags) #pragma intrinsic(__writeeflags)
uintptr_t __readeflags(void); uintptr_t __readeflags(void);
#pragma intrinsic(__readeflags) #pragma intrinsic(__readeflags)
#endif #endif
/*** Interrupts ***/ /*** Interrupts and traps ***/
void __debugbreak(void); void __debugbreak(void);
#pragma intrinsic(__debugbreak) #pragma intrinsic(__debugbreak)
void _disable(void); void _disable(void);
@ -300,49 +582,46 @@ void __int2c(void);
#pragma intrinsic(__int2c) #pragma intrinsic(__int2c)
void __halt(void); void __halt(void);
#pragma intrinsic(__halt) #pragma intrinsic(__halt)
void __ud2(void);
#pragma intrinsic(__ud2)
#if (_MSC_VER >= 1700)
__declspec(noreturn) void __fastfail(unsigned int Code);
#pragma intrinsic(__fastfail)
#endif
#endif
#if defined(_M_ARM)
int __trap(int Arg1, ...);
#endif #endif
/*** Protected memory management ***/ /*** Protected memory management ***/
#if defined(_M_IX86) || defined(_M_AMD64) #if defined(_M_IX86) || defined(_M_AMD64)
void __writecr0(unsigned __int64 Data); void __writecr0(uintptr_t Data);
#pragma intrinsic(__writecr0) #pragma intrinsic(__writecr0)
void __writecr3(unsigned __int64 Data); void __writecr3(uintptr_t Data);
#pragma intrinsic(__writecr3) #pragma intrinsic(__writecr3)
void __writecr4(unsigned __int64 Data); void __writecr4(uintptr_t Data);
#pragma intrinsic(__writecr4) #pragma intrinsic(__writecr4)
#endif void __writecr8(uintptr_t Data);
#ifdef _M_AMD64
void __writecr8(unsigned __int64 Data);
#pragma intrinsic(__writecr8) #pragma intrinsic(__writecr8)
unsigned __int64 __readcr0(void); #endif
#pragma intrinsic(__readcr0) #if defined(_M_IX86)
unsigned __int64 __readcr2(void);
#pragma intrinsic(__readcr2)
unsigned __int64 __readcr3(void);
#pragma intrinsic(__readcr3)
unsigned __int64 __readcr4(void);
#pragma intrinsic(__readcr4)
unsigned __int64 __readcr8(void);
#pragma intrinsic(__readcr8)
unsigned __int64 __readdr(unsigned int reg);
#pragma intrinsic(__readdr)
void __writedr(unsigned reg, unsigned __int64 value);
#pragma intrinsic(__writedr)
#elif defined(_M_IX86)
unsigned long __readcr0(void); unsigned long __readcr0(void);
#pragma intrinsic(__readcr0)
unsigned long __readcr2(void); unsigned long __readcr2(void);
#pragma intrinsic(__readcr2)
unsigned long __readcr3(void); unsigned long __readcr3(void);
#pragma intrinsic(__readcr3)
//unsigned long __readcr4(void); //unsigned long __readcr4(void);
//#pragma intrinsic(__readcr4) //#pragma intrinsic(__readcr4)
// HACK: MSVC is broken // HACK: MSVC is broken
unsigned long ___readcr4(void); unsigned long ___readcr4(void);
#define __readcr4 ___readcr4 #define __readcr4 ___readcr4
unsigned long __readcr8(void);
#pragma intrinsic(__readcr8)
unsigned int __readdr(unsigned int reg); unsigned int __readdr(unsigned int reg);
#pragma intrinsic(__readdr)
void __writedr(unsigned reg, unsigned int value); void __writedr(unsigned reg, unsigned int value);
#endif #pragma intrinsic(__writedr)
#ifdef _M_IX86
// This intrinsic is broken and generates wrong opcodes, // This intrinsic is broken and generates wrong opcodes,
// when optimization is enabled! // when optimization is enabled!
#pragma warning(push) #pragma warning(push)
@ -362,15 +641,33 @@ void __forceinline __invlpg_fixed(void * Address)
#elif defined(_M_AMD64) #elif defined(_M_AMD64)
void __invlpg(void * Address); void __invlpg(void * Address);
#pragma intrinsic(__invlpg) #pragma intrinsic(__invlpg)
#elif defined(_M_AMD64)
unsigned __int64 __readcr0(void);
#pragma intrinsic(__readcr0)
unsigned __int64 __readcr2(void);
#pragma intrinsic(__readcr2)
unsigned __int64 __readcr3(void);
#pragma intrinsic(__readcr3)
unsigned __int64 __readcr4(void);
#pragma intrinsic(__readcr4)
unsigned __int64 __readcr8(void);
#pragma intrinsic(__readcr8)
unsigned __int64 __readdr(unsigned int reg);
#pragma intrinsic(__readdr)
void __writedr(unsigned reg, unsigned __int64 value);
#pragma intrinsic(__writedr)
#elif defined(_M_ARM)
void __cdecl __prefetch(const void *);
#pragma intrinsic(__prefetch)
#endif #endif
/*** System operations ***/ /*** System operations ***/
#if defined(_M_IX86) || defined(_M_AMD64) #if defined(_M_IX86) || defined(_M_AMD64)
unsigned __int64 __readmsr(int reg); unsigned __int64 __readmsr(unsigned long reg);
#pragma intrinsic(__readmsr) #pragma intrinsic(__readmsr)
void __writemsr(unsigned long Register, unsigned __int64 Value); void __writemsr(unsigned long Register, unsigned __int64 Value);
#pragma intrinsic(__writemsr) #pragma intrinsic(__writemsr)
unsigned __int64 __readpmc(int counter); unsigned __int64 __readpmc(unsigned long counter);
#pragma intrinsic(__readpmc) #pragma intrinsic(__readpmc)
unsigned long __segmentlimit(unsigned long a); unsigned long __segmentlimit(unsigned long a);
#pragma intrinsic(__segmentlimit) #pragma intrinsic(__segmentlimit)
@ -383,6 +680,95 @@ void __sidt(void *Destination);
void _mm_pause(void); void _mm_pause(void);
#pragma intrinsic(_mm_pause) #pragma intrinsic(_mm_pause)
#endif #endif
#if defined(_M_ARM)
unsigned int _MoveFromCoprocessor(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
#pragma intrinsic(_MoveFromCoprocessor)
unsigned int _MoveFromCoprocessor2(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
#pragma intrinsic(_MoveFromCoprocessor2)
unsigned __int64 _MoveFromCoprocessor64(unsigned int, unsigned int, unsigned int);
#pragma intrinsic(_MoveFromCoprocessor64)
void _MoveToCoprocessor(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
#pragma intrinsic(_MoveToCoprocessor)
void _MoveToCoprocessor2(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
#pragma intrinsic(_MoveToCoprocessor2)
void _MoveToCoprocessor64(unsigned __int64, unsigned int, unsigned int, unsigned int);
#pragma intrinsic(_MoveToCoprocessor64)
int _ReadStatusReg(int);
#pragma intrinsic(_ReadStatusReg)
void _WriteStatusReg(int, int, int);
#pragma intrinsic(_WriteStatusReg)
void __yield(void);
#pragma intrinsic(__yield)
void __wfe(void);
#pragma intrinsic(__wfe)
void __wfi(void);
#pragma intrinsic(__wfi)
unsigned int __swi(unsigned int, ...);
#pragma intrinsic(__swi)
unsigned int __hvc(unsigned int, ...);
#pragma intrinsic(__hvc)
__int64 __ldrexd(__int64 volatile *);
#pragma intrinsic(__ldrexd)
unsigned __int64 __rdpmccntr64(void);
#pragma intrinsic(__rdpmccntr64)
void __sev(void);
#pragma intrinsic(__sev)
#endif
/** Secure virtual machine **/
#if defined(_M_IX86) || defined(_M_AMD64)
void __svm_clgi(void);
#pragma intrinsic(__svm_clgi)
void __svm_invlpga(void * Va, int Asid);
#pragma intrinsic(__svm_invlpga)
void __svm_skinit(int Slb);
#pragma intrinsic(__svm_skinit)
void __svm_stgi(void);
#pragma intrinsic(__svm_stgi)
void __svm_vmload(uintptr_t VmcbPhysicalAddress);
#pragma intrinsic(__svm_vmload)
void __svm_vmrun(uintptr_t VmcbPhysicalAddress);
#pragma intrinsic(__svm_vmrun)
void __svm_vmsave(uintptr_t VmcbPhysicalAddress);
#pragma intrinsic(__svm_vmsave)
#endif
/** Virtual machine extension **/
#if defined(_M_IX86) || defined(_M_AMD64)
void __vmx_off(void);
void __vmx_vmptrst(unsigned __int64 * VmcsPhysicalAddress );
#endif
#if defined(_M_AMD64)
unsigned char __vmx_on(unsigned __int64 * VmsSupportPhysicalAddress);
unsigned char __vmx_vmclear(unsigned __int64 * VmcsPhysicalAddress);
unsigned char __vmx_vmlaunch(void);
unsigned char __vmx_vmptrld(unsigned __int64 *VmcsPhysicalAddress );
unsigned char __vmx_vmread(size_t Field, size_t *FieldValue);
unsigned char __vmx_vmresume(void);
unsigned char __vmx_vmwrite(size_t Field, size_t FieldValue);
#endif
/** Misc **/
void __nop(void);
#pragma intrinsic(__nop)
#if (_MSC_VER >= 1700)
void __code_seg(const char *);
#pragma intrinsic(__code_seg)
#endif
#ifdef _M_ARM
int _AddSatInt(int, int);
#pragma intrinsic(_AddSatInt)
int _DAddSatInt(int, int);
#pragma intrinsic(_DAddSatInt)
int _DSubSatInt(int, int);
#pragma intrinsic(_DSubSatInt)
int _SubSatInt(int, int);
#pragma intrinsic(_SubSatInt)
void __emit(unsigned __int32);
#pragma intrinsic(__emit)
void __static_assert(int, const char *);
#pragma intrinsic(__static_assert)
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -27,6 +27,29 @@ extern "C" {
// Dependencies // Dependencies
// //
//
// CPSR Values
//
#define CPSR_THUMB_ENABLE 0x20
#define CPSR_FIQ_DISABLE 0x40
#define CPSR_IRQ_DISABLE 0x80
#define CPSR_USER_MODE 0x10
#define CPSR_FIQ_MODE 0x11
#define CPSR_IRQ_MODE 0x12
#define CPSR_SVC_MODE 0x13
#define CPSR_ABORT_MODE 0x17
#define CPSR_UND_MODE 0x1B
#define CPSR_MODES 0x1F
//
// C1 Register Values
//
#define C1_MMU_CONTROL 0x01
#define C1_ALIGNMENT_CONTROL 0x02
#define C1_DCACHE_CONTROL 0x04
#define C1_ICACHE_CONTROL 0x1000
#define C1_VECTOR_CONTROL 0x2000
// //
// IPI Types // IPI Types
// //

View file

@ -1,5 +1,8 @@
#ifndef _BASETSD_H #ifndef _BASETSD_H_
#define _BASETSD_H #define _BASETSD_H_
#pragma once
#include <msvctarget.h>
#ifndef _M_AMD64 #ifndef _M_AMD64
#if !defined(__ROS_LONG64__) #if !defined(__ROS_LONG64__)
@ -23,30 +26,7 @@
#error Not supported. #error Not supported.
#endif #endif
#if !defined(_X86_) && !defined(_AMD64_) && !defined(_IA64_) && !defined(_ALPHA_) && \ #if defined(_MSC_VER) && !defined(MIDL_PASS) && !defined(RC_INVOKED)
!defined(_ARM_) && !defined(_PPC_) && !defined(_MIPS_) && !defined(_68K_)
#if defined(_M_AMD64) || defined(__x86_64__)
#define _AMD64_
#elif defined(_M_IX86) || defined(__i386__)
#define _X86_
#elif defined(_M_IA64) || defined(__ia64__)
#define _IA64_
#elif defined(_M_ALPHA) || defined(__alpha__)
#define _ALPHA_
#elif defined(_M_ARM) || defined(__arm__)
#define _ARM_
#elif defined(_M_PPC) || defined(__powerpc__)
#define _PPC_
#elif defined(_M_MRX000) || defined(__mips__)
#define _MIPS_
#elif defined(_M_M68K) || defined(__68k__)
#define _68K_
#endif
#endif
#if !defined(MIDL_PASS) && !defined(RC_INVOKED)
#define POINTER_64 __ptr64 #define POINTER_64 __ptr64
#if defined(_WIN64) #if defined(_WIN64)
#define POINTER_32 __ptr32 #define POINTER_32 __ptr32
@ -56,7 +36,7 @@
#else #else
#define POINTER_64 #define POINTER_64
#define POINTER_32 #define POINTER_32
#endif /* !defined(MIDL_PASS) && !defined(RC_INVOKED) */ #endif /* defined(_MSC_VER) && !defined(MIDL_PASS) && !defined(RC_INVOKED) */
#if defined(_M_MRX000) || defined(_M_AMD64) || defined(_M_IA64) #if defined(_M_MRX000) || defined(_M_AMD64) || defined(_M_IA64)
typedef unsigned __int64 POINTER_64_INT; typedef unsigned __int64 POINTER_64_INT;
@ -64,6 +44,12 @@
typedef unsigned long POINTER_64_INT; typedef unsigned long POINTER_64_INT;
#endif #endif
#if defined(_IA64_) || defined(_AMD64_)
#define FIRMWARE_PTR
#else
#define FIRMWARE_PTR POINTER_32
#endif
#if 0 /* Not supported yet */ #if 0 /* Not supported yet */
#define POINTER_SIGNED __sptr #define POINTER_SIGNED __sptr
#define POINTER_UNSIGNED __uptr #define POINTER_UNSIGNED __uptr
@ -214,4 +200,4 @@ typedef KAFFINITY *PKAFFINITY;
#endif #endif
#endif /* !RC_INVOKED */ #endif /* !RC_INVOKED */
#endif /* _BASETSD_H */ #endif /* _BASETSD_H_ */

View file

@ -20,25 +20,23 @@
#ifndef _NTDEF_ #ifndef _NTDEF_
#define _NTDEF_ #define _NTDEF_
#pragma once
/* Dependencies */ /* Dependencies */
#include <ctype.h> #include <ctype.h>
#include <basetsd.h> #include <basetsd.h>
#include <guiddef.h>
#include <excpt.h> #include <excpt.h>
#include <sdkddkver.h> #include <sdkddkver.h>
#include <specstrings.h> #include <specstrings.h>
#include <kernelspecs.h>
// FIXME: Shouldn't be included! // FIXME: Shouldn't be included!
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
/* Helper macro to enable gcc's extension. */ #ifdef __cplusplus
#ifndef __GNU_EXTENSION extern "C" {
#ifdef __GNUC__
#define __GNU_EXTENSION __extension__
#else
#define __GNU_EXTENSION
#endif
#endif #endif
/* Pseudo Modifiers for Input Parameters */ /* Pseudo Modifiers for Input Parameters */
@ -63,16 +61,11 @@
#define CRITICAL #define CRITICAL
#endif #endif
// FIXME: deprecated
#ifndef FAR #ifndef FAR
#define FAR #define FAR
#endif #endif
/* Defines the "size" of an any-size array */
#ifndef ANYSIZE_ARRAY
#define ANYSIZE_ARRAY 1
#endif
/* Constant modifier */ /* Constant modifier */
#ifndef CONST #ifndef CONST
#define CONST const #define CONST const
@ -93,26 +86,22 @@
#endif #endif
#endif /* NULL */ #endif /* NULL */
/* Defines the "size" of an any-size array */
#ifndef ANYSIZE_ARRAY
#define ANYSIZE_ARRAY 1
#endif
// /* Helper macro to enable gcc's extension. */
// FIXME #ifndef __GNU_EXTENSION
// We should use the -fms-extensions compiler flag for gcc,
// and clean up the mess.
//
#ifndef __ANONYMOUS_DEFINED
#define __ANONYMOUS_DEFINED
#ifndef NONAMELESSUNION
#ifdef __GNUC__ #ifdef __GNUC__
#define _ANONYMOUS_UNION __GNU_EXTENSION #define __GNU_EXTENSION __extension__
#define _ANONYMOUS_STRUCT __GNU_EXTENSION #else
#elif defined(__WATCOMC__) || defined(_MSC_VER) #define __GNU_EXTENSION
#define _ANONYMOUS_UNION #endif
#define _ANONYMOUS_STRUCT #endif
#endif /* __GNUC__/__WATCOMC__ */
#endif /* NONAMELESSUNION */
#ifndef _ANONYMOUS_UNION #ifndef DUMMYUNIONNAME
#if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS)
#define _ANONYMOUS_UNION #define _ANONYMOUS_UNION
#define _UNION_NAME(x) x #define _UNION_NAME(x) x
#define DUMMYUNIONNAME u #define DUMMYUNIONNAME u
@ -124,7 +113,9 @@
#define DUMMYUNIONNAME6 u6 #define DUMMYUNIONNAME6 u6
#define DUMMYUNIONNAME7 u7 #define DUMMYUNIONNAME7 u7
#define DUMMYUNIONNAME8 u8 #define DUMMYUNIONNAME8 u8
#define DUMMYUNIONNAME9 u9
#else #else
#define _ANONYMOUS_UNION __GNU_EXTENSION
#define _UNION_NAME(x) #define _UNION_NAME(x)
#define DUMMYUNIONNAME #define DUMMYUNIONNAME
#define DUMMYUNIONNAME1 #define DUMMYUNIONNAME1
@ -135,9 +126,12 @@
#define DUMMYUNIONNAME6 #define DUMMYUNIONNAME6
#define DUMMYUNIONNAME7 #define DUMMYUNIONNAME7
#define DUMMYUNIONNAME8 #define DUMMYUNIONNAME8
#endif #define DUMMYUNIONNAME9
#endif /* NONAMELESSUNION */
#endif /* !DUMMYUNIONNAME */
#ifndef _ANONYMOUS_STRUCT #ifndef DUMMYSTRUCTNAME
#if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS)
#define _ANONYMOUS_STRUCT #define _ANONYMOUS_STRUCT
#define _STRUCT_NAME(x) x #define _STRUCT_NAME(x) x
#define DUMMYSTRUCTNAME s #define DUMMYSTRUCTNAME s
@ -147,6 +141,7 @@
#define DUMMYSTRUCTNAME4 s4 #define DUMMYSTRUCTNAME4 s4
#define DUMMYSTRUCTNAME5 s5 #define DUMMYSTRUCTNAME5 s5
#else #else
#define _ANONYMOUS_STRUCT __GNU_EXTENSION
#define _STRUCT_NAME(x) #define _STRUCT_NAME(x)
#define DUMMYSTRUCTNAME #define DUMMYSTRUCTNAME
#define DUMMYSTRUCTNAME1 #define DUMMYSTRUCTNAME1
@ -154,11 +149,14 @@
#define DUMMYSTRUCTNAME3 #define DUMMYSTRUCTNAME3
#define DUMMYSTRUCTNAME4 #define DUMMYSTRUCTNAME4
#define DUMMYSTRUCTNAME5 #define DUMMYSTRUCTNAME5
#endif /* NONAMELESSUNION */
#endif /* DUMMYSTRUCTNAME */
#if defined(STRICT_GS_ENABLED)
#pragma strict_gs_check(push, on)
#endif #endif
#endif /* __ANONYMOUS_DEFINED */ #if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) || defined(_M_ARM)
#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64)
#define ALIGNMENT_MACHINE #define ALIGNMENT_MACHINE
#define UNALIGNED __unaligned #define UNALIGNED __unaligned
#if defined(_WIN64) #if defined(_WIN64)
@ -203,7 +201,7 @@
#endif #endif
/* Returns the type's alignment */ /* Returns the type's alignment */
#if defined(_MSC_VER) && (_MSC_VER >= 1300) #if defined(_MSC_VER)
#define TYPE_ALIGNMENT(t) __alignof(t) #define TYPE_ALIGNMENT(t) __alignof(t)
#else #else
#define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test) #define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test)
@ -217,8 +215,14 @@
#error "unknown architecture" #error "unknown architecture"
#endif #endif
#if defined(_WIN64)
#define PROBE_ALIGNMENT32(_s) TYPE_ALIGNMENT(ULONG)
#endif
/* Calling Conventions */ /* Calling Conventions */
#if defined(_M_IX86) #if defined(_MANAGED)
#define FASTCALL __stdcall
#elif defined(_M_IX86)
#define FASTCALL __fastcall #define FASTCALL __fastcall
#else #else
#define FASTCALL #define FASTCALL
@ -234,15 +238,23 @@
#define DECLSPEC_NORETURN __declspec(noreturn) #define DECLSPEC_NORETURN __declspec(noreturn)
#ifndef DECLSPEC_ADDRSAFE #ifndef DECLSPEC_ADDRSAFE
#if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) #if defined(_MSC_VER) && (defined(_M_ALPHA) || defined(_M_AXP64))
#define DECLSPEC_ADDRSAFE __declspec(address_safe) #define DECLSPEC_ADDRSAFE __declspec(address_safe)
#else #else
#define DECLSPEC_ADDRSAFE #define DECLSPEC_ADDRSAFE
#endif #endif
#endif /* DECLSPEC_ADDRSAFE */ #endif /* DECLSPEC_ADDRSAFE */
#ifndef DECLSPEC_NOTHROW
#if !defined(MIDL_PASS)
#define DECLSPEC_NOTHROW __declspec(nothrow)
#else
#define DECLSPEC_NOTHROW
#endif
#endif
#ifndef NOP_FUNCTION #ifndef NOP_FUNCTION
#if (_MSC_VER >= 1210) #if defined(_MSC_VER)
#define NOP_FUNCTION __noop #define NOP_FUNCTION __noop
#else #else
#define NOP_FUNCTION (void)0 #define NOP_FUNCTION (void)0
@ -263,16 +275,12 @@
/* Inlines */ /* Inlines */
#ifndef FORCEINLINE #ifndef FORCEINLINE
#if defined(_MSC_VER) && (_MSC_VER >= 1200) #if defined(_MSC_VER)
#define FORCEINLINE __forceinline #define FORCEINLINE __forceinline
#elif defined(_MSC_VER) #elif ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
#define FORCEINLINE __inline # define FORCEINLINE extern inline __attribute__((__always_inline__,__gnu_inline__))
#else /* __GNUC__ */ #else
# if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) # define FORCEINLINE extern __inline__ __attribute__((__always_inline__))
# define FORCEINLINE extern inline __attribute__((__always_inline__,__gnu_inline__))
# else
# define FORCEINLINE extern __inline__ __attribute__((__always_inline__))
# endif
#endif #endif
#endif /* FORCEINLINE */ #endif /* FORCEINLINE */
@ -294,10 +302,10 @@
/* Use to specify structure alignment */ /* Use to specify structure alignment */
#ifndef DECLSPEC_ALIGN #ifndef DECLSPEC_ALIGN
#if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) #if defined(_MSC_VER) && !defined(MIDL_PASS)
#define DECLSPEC_ALIGN(x) __declspec(align(x)) #define DECLSPEC_ALIGN(x) __declspec(align(x))
#elif defined(__GNUC__) #elif defined(__GNUC__)
#define DECLSPEC_ALIGN(x) __attribute__ ((__aligned__ (x))) #define DECLSPEC_ALIGN(x) __attribute__ ((__aligned__(x)))
#else #else
#define DECLSPEC_ALIGN(x) #define DECLSPEC_ALIGN(x)
#endif #endif
@ -315,14 +323,55 @@
#define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE) #define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE)
#endif #endif
#ifndef DECLSPEC_UUID
#if defined(_MSC_VER) && defined(__cplusplus)
#define DECLSPEC_UUID(x) __declspec(uuid(x))
#else
#define DECLSPEC_UUID(x)
#endif
#endif
#ifndef DECLSPEC_NOVTABLE
#if defined(_MSC_VER) && defined(__cplusplus)
#define DECLSPEC_NOVTABLE __declspec(novtable)
#else
#define DECLSPEC_NOVTABLE
#endif
#endif
#ifndef DECLSPEC_SELECTANY #ifndef DECLSPEC_SELECTANY
#if (_MSC_VER >= 1100) || defined(__GNUC__) #if defined(_MSC_VER) || defined(__GNUC__)
#define DECLSPEC_SELECTANY __declspec(selectany) #define DECLSPEC_SELECTANY __declspec(selectany)
#else #else
#define DECLSPEC_SELECTANY #define DECLSPEC_SELECTANY
#endif #endif
#endif #endif
#ifndef DECLSPEC_DEPRECATED
#if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(MIDL_PASS)
#define DECLSPEC_DEPRECATED __declspec(deprecated)
#define DEPRECATE_SUPPORTED
#else
#define DECLSPEC_DEPRECATED
#undef DEPRECATE_SUPPORTED
#endif
#endif
#ifdef DEPRECATE_DDK_FUNCTIONS
#ifdef _NTDDK_
#define DECLSPEC_DEPRECATED_DDK DECLSPEC_DEPRECATED
#ifdef DEPRECATE_SUPPORTED
#define PRAGMA_DEPRECATED_DDK 1
#endif
#else
#define DECLSPEC_DEPRECATED_DDK
#define PRAGMA_DEPRECATED_DDK 1
#endif
#else
#define DECLSPEC_DEPRECATED_DDK
#define PRAGMA_DEPRECATED_DDK 0
#endif
/* Use to silence unused variable warnings when it is intentional */ /* Use to silence unused variable warnings when it is intentional */
#define UNREFERENCED_PARAMETER(P) {(P)=(P);} #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
#define UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L)) #define UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L))
@ -347,18 +396,15 @@
/* Void Pointers */ /* Void Pointers */
typedef void *PVOID; typedef void *PVOID;
//typedef void * POINTER_64 PVOID64; typedef void * POINTER_64 PVOID64;
typedef PVOID PVOID64; // FIXME!
/* Handle Type */ /* Handle Type */
typedef void *HANDLE, **PHANDLE;;
#ifdef STRICT #ifdef STRICT
typedef void *HANDLE; #define DECLARE_HANDLE(n) typedef struct n##__{int unused;} *n
#define DECLARE_HANDLE(n) typedef struct n##__{int i;}*n
#else #else
typedef PVOID HANDLE;
#define DECLARE_HANDLE(n) typedef HANDLE n #define DECLARE_HANDLE(n) typedef HANDLE n
#endif #endif
typedef HANDLE *PHANDLE;
/* Upper-Case Versions of Some Standard C Types */ /* Upper-Case Versions of Some Standard C Types */
#ifndef VOID #ifndef VOID
@ -891,4 +937,8 @@ typedef struct _GROUP_AFFINITY {
#define LANG_YORUBA 0x6a #define LANG_YORUBA 0x6a
#define LANG_ZULU 0x35 #define LANG_ZULU 0x35
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* _NTDEF_ */ #endif /* _NTDEF_ */

View file

@ -13,7 +13,7 @@ extern "C"
/* TODO /* TODO
include <basetsd.h> from winnt.h so that this typedef is not necessary include <basetsd.h> from winnt.h so that this typedef is not necessary
*/ */
#ifndef _BASETSD_H #ifndef _BASETSD_H_
typedef unsigned long ULONG_PTR, *PULONG_PTR; typedef unsigned long ULONG_PTR, *PULONG_PTR;
#endif #endif
@ -787,7 +787,7 @@ typedef struct tagRASCOMMSETTINGS
typedef DWORD (WINAPI *PFNRASSETCOMMSETTINGS) (HANDLE hPort,RASCOMMSETTINGS *pRasCommSettings,PVOID pvReserved); typedef DWORD (WINAPI *PFNRASSETCOMMSETTINGS) (HANDLE hPort,RASCOMMSETTINGS *pRasCommSettings,PVOID pvReserved);
typedef struct tagRASCUSTOMSCRIPTEXTENSIONS typedef struct tagRASCUSTOMSCRIPTEXTENSIONS
{ {
DWORD dwSize; DWORD dwSize;
PFNRASSETCOMMSETTINGS pfnRasSetCommSettings; PFNRASSETCOMMSETTINGS pfnRasSetCommSettings;
} RASCUSTOMSCRIPTEXTENSIONS; } RASCUSTOMSCRIPTEXTENSIONS;
#endif /*(WINVER >= 0x501)*/ #endif /*(WINVER >= 0x501)*/

View file

@ -2894,11 +2894,17 @@ typedef UINT (CALLBACK *LPFNDEVMODE)(HWND,HMODULE,LPDEVMODEA,LPSTR,LPSTR,LPDEVMO
typedef DWORD (CALLBACK *LPFNDEVCAPS)(LPSTR,LPSTR,UINT,LPSTR,LPDEVMODEA); typedef DWORD (CALLBACK *LPFNDEVCAPS)(LPSTR,LPSTR,UINT,LPSTR,LPDEVMODEA);
#define RGB(r,g,b) ((DWORD)(((BYTE)(r)|((WORD)(g)<<8))|(((DWORD)(BYTE)(b))<<16))) #define GetRValue(rgb) ((BYTE)(rgb))
#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
#define GetBValue(rgb) ((BYTE)((rgb)>>16))
#define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)))
#define PALETTERGB(r,g,b) (0x02000000 | RGB(r,g,b))
#define PALETTEINDEX(i) ((COLORREF)(0x01000000 | (DWORD)(WORD)(i)))
#define MAKEPOINTS(l) (*((POINTS*)&(l))) #define MAKEPOINTS(l) (*((POINTS*)&(l)))
#define MAKEROP4(f,b) (DWORD)((((b)<<8)&0xFF000000)|(f)) #define MAKEROP4(f,b) (DWORD)((((b)<<8)&0xFF000000)|(f))
#define PALETTEINDEX(i) ((0x01000000|(COLORREF)(WORD)(i)))
#define PALETTERGB(r,g,b) (0x02000000|RGB(r,g,b))
int WINAPI AbortDoc(_In_ HDC); int WINAPI AbortDoc(_In_ HDC);
BOOL WINAPI AbortPath(_In_ HDC); BOOL WINAPI AbortPath(_In_ HDC);
int WINAPI AddFontResourceA(LPCSTR); int WINAPI AddFontResourceA(LPCSTR);
@ -3197,14 +3203,13 @@ GdiGradientFill(
BOOL WINAPI GdiTransparentBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT); BOOL WINAPI GdiTransparentBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT);
BOOL WINAPI GdiIsMetaFileDC(HDC); BOOL WINAPI GdiIsMetaFileDC(HDC);
#define GetCValue(cmyk) ((BYTE)(cmyk))
#define GetMValue(cmyk) ((BYTE)((cmyk)>> 8)) #define GetKValue(cmyk) ((BYTE)(cmyk))
#define GetYValue(cmyk) ((BYTE)((cmyk)>>16)) #define GetYValue(cmyk) ((BYTE)((cmyk)>> 8))
#define GetKValue(cmyk) ((BYTE)((cmyk)>>24)) #define GetMValue(cmyk) ((BYTE)((cmyk)>>16))
#define CMYK(c,m,y,k) ((COLORREF)((((BYTE)(c)|((WORD)((BYTE)(m))<<8))|(((DWORD)(BYTE)(y))<<16))|(((DWORD)(BYTE)(k))<<24))) #define GetCValue(cmyk) ((BYTE)((cmyk)>>24))
#define GetRValue(c) ((BYTE)(c)) #define CMYK(c,m,y,k) ((COLORREF)((((BYTE)(k)|((WORD)((BYTE)(y))<<8))|(((DWORD)(BYTE)(m))<<16))|(((DWORD)(BYTE)(c))<<24)))
#define GetGValue(c) ((BYTE)(((WORD)(c))>>8))
#define GetBValue(c) ((BYTE)((c)>>16))
int WINAPI GetArcDirection(_In_ HDC); int WINAPI GetArcDirection(_In_ HDC);
BOOL WINAPI GetAspectRatioFilterEx(_In_ HDC, _Out_ LPSIZE); BOOL WINAPI GetAspectRatioFilterEx(_In_ HDC, _Out_ LPSIZE);

View file

@ -473,7 +473,7 @@ static const WCHAR LOCALE_NAME_SYSTEM_DEFAULT[] = {'!','s','y','s','-','d','e','
#define VS_ALLOW_LATIN 0x1 #define VS_ALLOW_LATIN 0x1
#define GSS_ALLOW_INHERITED_COMMON 0x1 #define GSS_ALLOW_INHERITED_COMMON 0x1
#endif #endif
#ifndef _BASETSD_H #ifndef _BASETSD_H_
typedef long LONG_PTR; typedef long LONG_PTR;
#endif #endif

View file

@ -3310,7 +3310,7 @@ typedef struct _CONTEXT {
DWORD Fill[2]; DWORD Fill[2];
} CONTEXT; } CONTEXT;
#elif defined(ARM) #elif defined(_ARM_)
#ifndef PAGE_SIZE #ifndef PAGE_SIZE
#define PAGE_SIZE 0x1000 // FIXME: This should probably go elsewhere #define PAGE_SIZE 0x1000 // FIXME: This should probably go elsewhere

View file

@ -228,6 +228,7 @@ extern volatile struct _KSYSTEM_TIME KeTickCount;
#define RESULT_NEGATIVE 1 #define RESULT_NEGATIVE 1
#define RESULT_POSITIVE 2 #define RESULT_POSITIVE 2
#if 0
DECLSPEC_IMPORT DECLSPEC_IMPORT
VOID VOID
__fastcall __fastcall
@ -240,6 +241,7 @@ KIRQL
__fastcall __fastcall
KfAcquireSpinLock( KfAcquireSpinLock(
IN OUT ULONG_PTR* SpinLock); IN OUT ULONG_PTR* SpinLock);
#endif
#ifndef _WINNT_ #ifndef _WINNT_
// //

View file

@ -7,7 +7,7 @@ typedef int BOOL, *PBOOL, *LPBOOL;
typedef unsigned char BYTE, *PBYTE, *LPBYTE; typedef unsigned char BYTE, *PBYTE, *LPBYTE;
typedef unsigned long DWORD, *PDWORD, *LPDWORD; typedef unsigned long DWORD, *PDWORD, *LPDWORD;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
typedef unsigned int DWORD32; typedef unsigned int DWORD32;
typedef unsigned __int64 DWORD64; typedef unsigned __int64 DWORD64;
cpp_quote("#endif") cpp_quote("#endif")
@ -15,13 +15,13 @@ cpp_quote("#endif")
cpp_quote("#ifndef _WINDEF_H") cpp_quote("#ifndef _WINDEF_H")
typedef int INT, *LPINT; typedef int INT, *LPINT;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
typedef signed char INT8; typedef signed char INT8;
typedef signed short INT16; typedef signed short INT16;
typedef signed int INT32; typedef signed int INT32;
typedef signed __int64 INT64; typedef signed __int64 INT64;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
typedef signed int LONG32; typedef signed int LONG32;
typedef signed __int64 LONG64; typedef signed __int64 LONG64;
cpp_quote("#endif") cpp_quote("#endif")
@ -37,7 +37,7 @@ cpp_quote("#endif")
cpp_quote("#ifndef _WINDEF_H") cpp_quote("#ifndef _WINDEF_H")
typedef unsigned int UINT; typedef unsigned int UINT;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
typedef unsigned char UINT8; typedef unsigned char UINT8;
typedef unsigned short UINT16; typedef unsigned short UINT16;
typedef unsigned int UINT32; typedef unsigned int UINT32;
@ -46,7 +46,7 @@ cpp_quote("#endif")
cpp_quote("#ifndef _WINNT_") cpp_quote("#ifndef _WINNT_")
typedef unsigned long ULONG, *PULONG; typedef unsigned long ULONG, *PULONG;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
typedef unsigned int ULONG32; typedef unsigned int ULONG32;
typedef unsigned __int64 ULONG64; typedef unsigned __int64 ULONG64;
cpp_quote("#endif") cpp_quote("#endif")
@ -77,7 +77,7 @@ cpp_quote("#endif")
cpp_quote("#ifndef _WINNT_") cpp_quote("#ifndef _WINNT_")
typedef BYTE BOOLEAN, *PBOOLEAN; typedef BYTE BOOLEAN, *PBOOLEAN;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
#ifdef _WIN64 #ifdef _WIN64
typedef __int64 LONG_PTR; typedef __int64 LONG_PTR;
typedef unsigned __int64 ULONG_PTR; typedef unsigned __int64 ULONG_PTR;

View file

@ -251,6 +251,7 @@ typedef struct _FAST486_SEG_REG
ULONG DirConf : 1; ULONG DirConf : 1;
ULONG Executable : 1; ULONG Executable : 1;
ULONG SystemType : 1; ULONG SystemType : 1;
ULONG Rpl : 2;
ULONG Dpl : 2; ULONG Dpl : 2;
ULONG Present : 1; ULONG Present : 1;
ULONG Size : 1; ULONG Size : 1;

View file

@ -1,19 +1,52 @@
#ifndef _MSC_VER
#ifndef __GNUC__ #pragma once
#error Unsupported compiler
#endif
/* translate GCC target defines to MS equivalents. */ /* translate GCC target defines to MS equivalents. */
#if defined(__i686__) && !defined(_M_IX86) #if defined(__i386__)
#define _M_IX86 600 #if !defined(_X86_)
#undef __i686__ #define _X86_ 1
#elif defined(__i586__) && !defined(_M_IX86) #endif
#define _M_IX86 500 #if !defined(_M_IX86)
#undef __i586__ #define _M_IX86 1
#elif defined(__i486__) && !defined(_M_IX86) #endif
#define _M_IX86 400 #elif defined(__x86_64__) || defined(__x86_64)
#undef __i486__ #if !defined(_AMD64_)
#elif defined(__i386__) && !defined(_M_IX86) #define _AMD64_ 1
#define _M_IX86 300 #endif
#endif #if !defined(_M_AMD64)
#define _M_AMD64 1
#endif
#if !defined(_M_X64)
#define _M_X64 1
#endif
#elif defined(__arm__)
#if !defined(_ARM_)
#define _ARM_ 1
#endif
#if !defined(_M_ARM)
#define _M_ARM 1
#endif
#elif defined(__ia64__)
#if !defined(_IA64_)
#define _IA64_ 1
#endif
#if !defined(_M_IA64)
#define _M_IA64 1
#endif
#elif defined(__alpha__)
#if !defined(_ALPHA_)
#define _ALPHA_ 1
#endif
#if !defined(_M_ALPHA)
#define _M_ALPHA 1
#endif
#elif defined(__powerpc__)
#if !defined(_PPC_)
#define _PPC_ 1
#endif
#if !defined(_M_PPC)
#define _M_PPC 1
#endif
#else
#error Unknown architecture
#endif #endif

View file

@ -34,7 +34,7 @@ _STLP_MOVE_TO_PRIV_NAMESPACE
#if defined (_STLP_USE_DEFAULT_FILE_OFFSET) || \ #if defined (_STLP_USE_DEFAULT_FILE_OFFSET) || \
(!defined(_LARGEFILE_SOURCE) && !defined(_LARGEFILE64_SOURCE)) (!defined(_LARGEFILE_SOURCE) && !defined(_LARGEFILE64_SOURCE))
# if !defined (_STLP_MSVC) || (_STLP_MSVC < 1400) || defined(_STLP_WCE) # if !defined (_STLP_MSVC) || (_STLP_MSVC < 1400) || defined(_STLP_WCE) || defined(__REACTOS__)
# define FSEEK fseek # define FSEEK fseek
# else # else
# define FSEEK _fseeki64 # define FSEEK _fseeki64

View file

@ -272,7 +272,7 @@ private:
{ {
len = MultiByteToWideChar(CP_ACP, 0, regstra, filelen, NULL, 0) + 1; len = MultiByteToWideChar(CP_ACP, 0, regstra, filelen, NULL, 0) + 1;
regstrw = reinterpret_cast<LPWSTR>(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR))); regstrw = reinterpret_cast<LPWSTR>(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR)));
if (regstra == NULL) if (regstrw == NULL)
{ {
HeapFree(GetProcessHeap(), 0, regstra); HeapFree(GetProcessHeap(), 0, regstra);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;

View file

@ -65,7 +65,7 @@ Fast486ReadMemory(PFAST486_STATE State,
return FALSE; return FALSE;
} }
if ((!InstFetch && (GET_SEGMENT_RPL(CachedDescriptor->Selector) > CachedDescriptor->Dpl)) if ((!InstFetch && (CachedDescriptor->Rpl > CachedDescriptor->Dpl))
|| (Fast486GetCurrentPrivLevel(State) > CachedDescriptor->Dpl)) || (Fast486GetCurrentPrivLevel(State) > CachedDescriptor->Dpl))
{ {
Fast486Exception(State, FAST486_EXCEPTION_GP); Fast486Exception(State, FAST486_EXCEPTION_GP);
@ -132,7 +132,7 @@ Fast486WriteMemory(PFAST486_STATE State,
return FALSE; return FALSE;
} }
if ((GET_SEGMENT_RPL(CachedDescriptor->Selector) > CachedDescriptor->Dpl) if ((CachedDescriptor->Rpl > CachedDescriptor->Dpl)
|| (Fast486GetCurrentPrivLevel(State) > CachedDescriptor->Dpl)) || (Fast486GetCurrentPrivLevel(State) > CachedDescriptor->Dpl))
{ {
Fast486Exception(State, FAST486_EXCEPTION_GP); Fast486Exception(State, FAST486_EXCEPTION_GP);
@ -164,14 +164,26 @@ BOOLEAN
Fast486InterruptInternal(PFAST486_STATE State, Fast486InterruptInternal(PFAST486_STATE State,
USHORT SegmentSelector, USHORT SegmentSelector,
ULONG Offset, ULONG Offset,
BOOLEAN InterruptGate) ULONG GateType)
{ {
BOOLEAN GateSize = (GateType == FAST486_IDT_INT_GATE_32)
|| (GateType == FAST486_IDT_TRAP_GATE_32);
/* Check for protected mode */ /* Check for protected mode */
if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE) if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
{ {
FAST486_TSS Tss; FAST486_TSS Tss;
USHORT OldSs = State->SegmentRegs[FAST486_REG_SS].Selector; USHORT OldSs = State->SegmentRegs[FAST486_REG_SS].Selector;
ULONG OldEsp = State->GeneralRegs[FAST486_REG_ESP].Long; ULONG OldEsp = State->GeneralRegs[FAST486_REG_ESP].Long;
if (GateSize != (State->SegmentRegs[FAST486_REG_CS].Size))
{
/*
* The gate size doesn't match the current operand size, so toggle
* the OPSIZE flag.
*/
State->PrefixFlags ^= FAST486_PREFIX_OPSIZE;
}
/* Check if the interrupt handler is more privileged */ /* Check if the interrupt handler is more privileged */
if (Fast486GetCurrentPrivLevel(State) > GET_SEGMENT_RPL(SegmentSelector)) if (Fast486GetCurrentPrivLevel(State) > GET_SEGMENT_RPL(SegmentSelector))
@ -257,7 +269,7 @@ Fast486InterruptInternal(PFAST486_STATE State,
/* Push the instruction pointer */ /* Push the instruction pointer */
if (!Fast486StackPush(State, State->InstPtr.Long)) return FALSE; if (!Fast486StackPush(State, State->InstPtr.Long)) return FALSE;
if (InterruptGate) if ((GateType == FAST486_IDT_INT_GATE) || (GateType == FAST486_IDT_INT_GATE_32))
{ {
/* Disable interrupts after a jump to an interrupt gate handler */ /* Disable interrupts after a jump to an interrupt gate handler */
State->Flags.If = FALSE; State->Flags.If = FALSE;
@ -270,7 +282,7 @@ Fast486InterruptInternal(PFAST486_STATE State,
return FALSE; return FALSE;
} }
if (State->SegmentRegs[FAST486_REG_CS].Size) if (GateSize)
{ {
/* 32-bit code segment, use EIP */ /* 32-bit code segment, use EIP */
State->InstPtr.Long = Offset; State->InstPtr.Long = Offset;

View file

@ -159,7 +159,7 @@ Fast486InterruptInternal
PFAST486_STATE State, PFAST486_STATE State,
USHORT SegmentSelector, USHORT SegmentSelector,
ULONG Offset, ULONG Offset,
BOOLEAN InterruptGate ULONG GateType
); );
VOID VOID

View file

@ -542,24 +542,32 @@ Fast486LoadSegment(PFAST486_STATE State,
{ {
/* Loading a data segment */ /* Loading a data segment */
if (!GdtEntry.SystemType) if (GET_SEGMENT_INDEX(Selector) != 0)
{ {
/* This is a special descriptor */ if (!GdtEntry.SystemType)
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector); {
return FALSE; /* This is a special descriptor */
} Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector);
return FALSE;
}
if ((GET_SEGMENT_RPL(Selector) > GdtEntry.Dpl) if ((GET_SEGMENT_RPL(Selector) > GdtEntry.Dpl)
|| (Fast486GetCurrentPrivLevel(State) > GdtEntry.Dpl)) || (Fast486GetCurrentPrivLevel(State) > GdtEntry.Dpl))
{ {
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector); Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector);
return FALSE; return FALSE;
} }
if (!GdtEntry.Present) if (!GdtEntry.Present)
{
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_NP, Selector);
return FALSE;
}
}
else
{ {
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_NP, Selector); /* This is a NULL selector */
return FALSE; RtlZeroMemory(&GdtEntry, sizeof(GdtEntry));
} }
} }
@ -572,6 +580,7 @@ Fast486LoadSegment(PFAST486_STATE State,
CachedDescriptor->DirConf = GdtEntry.DirConf; CachedDescriptor->DirConf = GdtEntry.DirConf;
CachedDescriptor->Executable = GdtEntry.Executable; CachedDescriptor->Executable = GdtEntry.Executable;
CachedDescriptor->SystemType = GdtEntry.SystemType; CachedDescriptor->SystemType = GdtEntry.SystemType;
CachedDescriptor->Rpl = GET_SEGMENT_RPL(Selector);
CachedDescriptor->Dpl = GdtEntry.Dpl; CachedDescriptor->Dpl = GdtEntry.Dpl;
CachedDescriptor->Present = GdtEntry.Present; CachedDescriptor->Present = GdtEntry.Present;
CachedDescriptor->Size = GdtEntry.Size; CachedDescriptor->Size = GdtEntry.Size;

View file

@ -3702,9 +3702,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodePushImm)
} }
else else
{ {
USHORT Data; SHORT Data;
if (!Fast486FetchWord(State, &Data)) if (!Fast486FetchWord(State, (PUSHORT)&Data))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -3837,12 +3837,12 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeImulModrmImm)
FAST486_OPCODE_HANDLER(Fast486OpcodePushByteImm) FAST486_OPCODE_HANDLER(Fast486OpcodePushByteImm)
{ {
UCHAR Data; CHAR Data;
/* Make sure this is the right instruction */ /* Make sure this is the right instruction */
ASSERT(Opcode == 0x6A); ASSERT(Opcode == 0x6A);
if (!Fast486FetchByte(State, &Data)) if (!Fast486FetchByte(State, (PUCHAR)&Data))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;

View file

@ -2018,10 +2018,13 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0F01)
{ {
UCHAR TableReg[6]; UCHAR TableReg[6];
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; BOOLEAN OperandSize, AddressSize;
FAST486_SEG_REGS Segment = FAST486_REG_DS; FAST486_SEG_REGS Segment = FAST486_REG_DS;
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
NO_LOCK_PREFIX(); NO_LOCK_PREFIX();
TOGGLE_OPSIZE(OperandSize);
TOGGLE_ADSIZE(AddressSize); TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
@ -2117,6 +2120,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0F01)
State->Gdtr.Size = *((PUSHORT)TableReg); State->Gdtr.Size = *((PUSHORT)TableReg);
State->Gdtr.Address = *((PULONG)&TableReg[sizeof(USHORT)]); State->Gdtr.Address = *((PULONG)&TableReg[sizeof(USHORT)]);
/* In 16-bit mode the highest byte is masked out */
if (!OperandSize) State->Gdtr.Address &= 0x00FFFFFF;
return TRUE; return TRUE;
} }
@ -2153,6 +2159,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0F01)
State->Idtr.Size = *((PUSHORT)TableReg); State->Idtr.Size = *((PUSHORT)TableReg);
State->Idtr.Address = *((PULONG)&TableReg[sizeof(USHORT)]); State->Idtr.Address = *((PULONG)&TableReg[sizeof(USHORT)]);
/* In 16-bit mode the highest byte is masked out */
if (!OperandSize) State->Idtr.Address &= 0x00FFFFFF;
return TRUE; return TRUE;
} }

View file

@ -29,14 +29,13 @@ else()
list(APPEND ASM_SOURCE list(APPEND ASM_SOURCE
i386/seh.s i386/seh.s
i386/seh_prolog.s) i386/seh_prolog.s)
list(APPEND SOURCE dummy.c)
elseif(ARCH STREQUAL "amd64") elseif(ARCH STREQUAL "amd64")
list(APPEND ASM_SOURCE list(APPEND ASM_SOURCE
amd64/seh.s amd64/seh.s
amd64/seh_prolog.s) amd64/seh_prolog.s)
list(APPEND SOURCE dummy.c)
endif() endif()
list(APPEND SOURCE dummy.c)
add_asm_files(pseh_asm ${ASM_SOURCE}) add_asm_files(pseh_asm ${ASM_SOURCE})
add_library(pseh ${SOURCE} ${pseh_asm}) add_library(pseh ${SOURCE} ${pseh_asm})
add_dependencies(pseh asm) add_dependencies(pseh asm)

View file

@ -30,6 +30,9 @@ typedef ULONG64 BITMAP_BUFFER, *PBITMAP_BUFFER;
#undef BitScanForward #undef BitScanForward
#define BitScanForward(Index, Mask) \ #define BitScanForward(Index, Mask) \
do { unsigned long tmp; BitScanForward64(&tmp, Mask); *Index = tmp; } while (0) do { unsigned long tmp; BitScanForward64(&tmp, Mask); *Index = tmp; } while (0)
#undef BitScanReverse
#define BitScanReverse(Index, Mask) \
do { unsigned long tmp; BitScanReverse64(&tmp, Mask); *Index = tmp; } while (0)
#define RtlFillMemoryUlong RtlFillMemoryUlonglong #define RtlFillMemoryUlong RtlFillMemoryUlonglong
#define RtlInitializeBitMap RtlInitializeBitMap64 #define RtlInitializeBitMap RtlInitializeBitMap64
@ -734,7 +737,7 @@ RtlFindFirstRunClear(
return RtlFindNextForwardRunClear(BitMapHeader, 0, StartingIndex); return RtlFindNextForwardRunClear(BitMapHeader, 0, StartingIndex);
} }
ULONG BITMAP_INDEX
NTAPI NTAPI
RtlFindLastBackwardRunClear( RtlFindLastBackwardRunClear(
_In_ PRTL_BITMAP BitMapHeader, _In_ PRTL_BITMAP BitMapHeader,
@ -771,7 +774,7 @@ RtlFindLastBackwardRunClear(
BitScanReverse(&BitPos, InvValue); BitScanReverse(&BitPos, InvValue);
/* Calculate last bit position */ /* Calculate last bit position */
FromIndex = (Buffer + 1 - BitMapHeader->Buffer) * _BITCOUNT + BitPos; FromIndex = (BITMAP_INDEX)((Buffer + 1 - BitMapHeader->Buffer) * _BITCOUNT + BitPos);
Value = ~InvValue << ((_BITCOUNT - 1) - BitPos) >> ((_BITCOUNT - 1) - BitPos); Value = ~InvValue << ((_BITCOUNT - 1) - BitPos) >> ((_BITCOUNT - 1) - BitPos);
@ -787,7 +790,7 @@ RtlFindLastBackwardRunClear(
BitScanReverse(&BitPos, Value); BitScanReverse(&BitPos, Value);
/* Calculate Starting Index */ /* Calculate Starting Index */
*StartingRunIndex = (Buffer + 1 - BitMapHeader->Buffer) * _BITCOUNT + BitPos + 1; *StartingRunIndex = (BITMAP_INDEX)((Buffer + 1 - BitMapHeader->Buffer) * _BITCOUNT + BitPos + 1);
} }
else else
{ {
@ -796,7 +799,7 @@ RtlFindLastBackwardRunClear(
} }
/* Return length of the run */ /* Return length of the run */
return FromIndex - *StartingRunIndex; return (FromIndex - *StartingRunIndex);
} }

View file

@ -306,6 +306,7 @@ list(APPEND CRT_SOURCE
string/wtoi.c string/wtoi.c
string/wtoi64.c string/wtoi64.c
string/wtol.c string/wtol.c
string/winesup.c
sys_stat/systime.c sys_stat/systime.c
time/asctime.c time/asctime.c
time/clock.c time/clock.c

View file

@ -18,7 +18,7 @@ typedef struct MSVCRT_threadlocaleinfostruct {
int *lconv_intl_refcount; int *lconv_intl_refcount;
int *lconv_num_refcount; int *lconv_num_refcount;
int *lconv_mon_refcount; int *lconv_mon_refcount;
struct MSVCRT_lconv *lconv; struct lconv *lconv;
int *ctype1_refcount; int *ctype1_refcount;
unsigned short *ctype1; unsigned short *ctype1;
const unsigned short *pctype; const unsigned short *pctype;
@ -37,26 +37,7 @@ typedef struct MSVCRT_threadmbcinfostruct {
char mbcasemap[256]; char mbcasemap[256];
} MSVCRT_threadmbcinfo; } MSVCRT_threadmbcinfo;
struct MSVCRT_lconv { #define MSVCRT_lconv lconv
char* decimal_point;
char* thousands_sep;
char* grouping;
char* int_curr_symbol;
char* currency_symbol;
char* mon_decimal_point;
char* mon_thousands_sep;
char* mon_grouping;
char* positive_sign;
char* negative_sign;
char int_frac_digits;
char frac_digits;
char p_cs_precedes;
char p_sep_by_space;
char n_cs_precedes;
char n_sep_by_space;
char p_sign_posn;
char n_sign_posn;
};
typedef struct MSVCRT_threadlocaleinfostruct *MSVCRT_pthreadlocinfo; typedef struct MSVCRT_threadlocaleinfostruct *MSVCRT_pthreadlocinfo;
typedef struct MSVCRT_threadmbcinfostruct *MSVCRT_pthreadmbcinfo; typedef struct MSVCRT_threadmbcinfostruct *MSVCRT_pthreadmbcinfo;

View file

@ -59,6 +59,7 @@ list(APPEND LIBCNTPR_SOURCE
string/wtoi64.c string/wtoi64.c
string/wtoi.c string/wtoi.c
string/wtol.c string/wtol.c
string/winesup.c
wstring/wcsicmp.c wstring/wcsicmp.c
wstring/wcslwr.c wstring/wcslwr.c
wstring/wcsnicmp.c wstring/wcsnicmp.c

View file

@ -23,13 +23,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <precomp.h> #include <stdarg.h>
#include <ctype.h> #include <limits.h>
// HACK for LIBCNT #include <winternl.h>
#ifndef debugstr_a #include <wine/debug.h>
#define debugstr_a
#endif #include "winesup.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
//extern FILE _iob[]; //extern FILE _iob[];
@ -56,78 +58,83 @@ static int wchar2digit(wchar_t c, int base) {
} }
#ifndef _LIBCNT_ #ifndef _LIBCNT_
/* vfscanf */ /* vfscanf_l */
#undef WIDE_SCANF #undef WIDE_SCANF
#undef CONSOLE #undef CONSOLE
#undef STRING #undef STRING
#undef SECURE
#include "scanf.h" #include "scanf.h"
/* vfwscanf */ /* vfwscanf_l */
#define WIDE_SCANF 1 #define WIDE_SCANF 1
#undef CONSOLE #undef CONSOLE
#undef STRING #undef STRING
#undef SECURE
#include "scanf.h" #include "scanf.h"
#endif #endif /* !_LIBCNT_ */
/* vsscanf */ /* vsscanf_l */
#undef WIDE_SCANF #undef WIDE_SCANF
#undef CONSOLE #undef CONSOLE
#define STRING 1 #define STRING 1
#undef SECURE
#include "scanf.h" #include "scanf.h"
/* vswscanf */ /* vswscanf_l */
#define WIDE_SCANF 1 #define WIDE_SCANF 1
#undef CONSOLE #undef CONSOLE
#define STRING 1 #define STRING 1
#undef SECURE
#include "scanf.h" #include "scanf.h"
#ifndef _LIBCNT_ #ifndef _LIBCNT_
/* vcscanf */ /* vcscanf_l */
#undef WIDE_SCANF #undef WIDE_SCANF
#define CONSOLE 1 #define CONSOLE 1
#undef STRING #undef STRING
#undef SECURE
#include "scanf.h" #include "scanf.h"
/********************************************************************* /*********************************************************************
* fscanf (MSVCRT.@) * fscanf (MSVCRT.@)
*/ */
int fscanf(FILE *file, const char *format, ...) int CDECL fscanf(FILE *file, const char *format, ...)
{ {
va_list valist; __ms_va_list valist;
int res; int res;
va_start(valist, format); __ms_va_start(valist, format);
res = vfscanf(file, format, valist); res = vfscanf_l(file, format, NULL, valist);
va_end(valist); __ms_va_end(valist);
return res; return res;
} }
/********************************************************************* /*********************************************************************
* scanf (MSVCRT.@) * scanf (MSVCRT.@)
*/ */
int scanf(const char *format, ...) int CDECL scanf(const char *format, ...)
{ {
va_list valist; __ms_va_list valist;
int res; int res;
va_start(valist, format); __ms_va_start(valist, format);
res = vfscanf(stdin, format, valist); res = vfscanf_l(stdin, format, NULL, valist);
va_end(valist); __ms_va_end(valist);
return res; return res;
} }
/********************************************************************* /*********************************************************************
* fwscanf (MSVCRT.@) * fwscanf (MSVCRT.@)
*/ */
int fwscanf(FILE *file, const wchar_t *format, ...) int CDECL fwscanf(FILE *file, const wchar_t *format, ...)
{ {
va_list valist; __ms_va_list valist;
int res; int res;
va_start(valist, format); __ms_va_start(valist, format);
res = vfwscanf(file, format, valist); res = vfwscanf_l(file, format, NULL, valist);
va_end(valist); __ms_va_end(valist);
return res; return res;
} }
@ -135,30 +142,30 @@ int fwscanf(FILE *file, const wchar_t *format, ...)
/********************************************************************* /*********************************************************************
* wscanf (MSVCRT.@) * wscanf (MSVCRT.@)
*/ */
int wscanf(const wchar_t *format, ...) int CDECL wscanf(const wchar_t *format, ...)
{ {
va_list valist; __ms_va_list valist;
int res; int res;
va_start(valist, format); __ms_va_start(valist, format);
res = vfwscanf(stdin, format, valist); res = vfwscanf_l(stdin, format, NULL, valist);
va_end(valist); __ms_va_end(valist);
return res; return res;
} }
#endif #endif /* !_LIBCNT_ */
/********************************************************************* /*********************************************************************
* sscanf (MSVCRT.@) * sscanf (MSVCRT.@)
*/ */
int sscanf(const char *str, const char *format, ...) int CDECL sscanf(const char *str, const char *format, ...)
{ {
va_list valist; __ms_va_list valist;
int res; int res;
va_start(valist, format); __ms_va_start(valist, format);
res = vsscanf(str, format, valist); res = vsscanf_l(str, format, NULL, valist);
va_end(valist); __ms_va_end(valist);
return res; return res;
} }
@ -168,12 +175,12 @@ int sscanf(const char *str, const char *format, ...)
*/ */
int CDECL swscanf(const wchar_t *str, const wchar_t *format, ...) int CDECL swscanf(const wchar_t *str, const wchar_t *format, ...)
{ {
va_list valist; __ms_va_list valist;
int res; int res;
va_start(valist, format); __ms_va_start(valist, format);
res = vswscanf(str, format, valist); res = vswscanf_l(str, format, NULL, valist);
va_end(valist); __ms_va_end(valist);
return res; return res;
} }
@ -183,12 +190,12 @@ int CDECL swscanf(const wchar_t *str, const wchar_t *format, ...)
*/ */
int CDECL _cscanf(const char *format, ...) int CDECL _cscanf(const char *format, ...)
{ {
va_list valist; __ms_va_list valist;
int res; int res;
va_start(valist, format); __ms_va_start(valist, format);
res = vcscanf(format, valist); res = vcscanf_l(format, NULL, valist);
va_end(valist); __ms_va_end(valist);
return res; return res;
} }
#endif #endif

View file

@ -48,7 +48,11 @@
#ifdef CONSOLE #ifdef CONSOLE
#define _GETC_(file) (consumed++, _getch()) #define _GETC_(file) (consumed++, _getch())
#define _UNGETC_(nch, file) do { _ungetch(nch); consumed--; } while(0) #define _UNGETC_(nch, file) do { _ungetch(nch); consumed--; } while(0)
#define _FUNCTION_ int vcscanf(const char *format, va_list ap) #ifdef SECURE
#define _FUNCTION_ static int vcscanf_s_l(const char *format, _locale_t locale, __ms_va_list ap)
#else /* SECURE */
#define _FUNCTION_ static int vcscanf_l(const char *format, _locale_t locale, __ms_va_list ap)
#endif /* SECURE */
#else #else
#ifdef STRING #ifdef STRING
#undef _EOF_ #undef _EOF_
@ -56,24 +60,41 @@
#define _GETC_(file) (consumed++, *file++) #define _GETC_(file) (consumed++, *file++)
#define _UNGETC_(nch, file) do { file--; consumed--; } while(0) #define _UNGETC_(nch, file) do { file--; consumed--; } while(0)
#ifdef WIDE_SCANF #ifdef WIDE_SCANF
#define _FUNCTION_ int vswscanf(const wchar_t *file, const wchar_t *format, va_list ap) #ifdef SECURE
#define _FUNCTION_ static int vswscanf_s_l(const wchar_t *file, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#else /* SECURE */
#define _FUNCTION_ static int vswscanf_l(const wchar_t *file, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#endif /* SECURE */
#else /* WIDE_SCANF */ #else /* WIDE_SCANF */
#define _FUNCTION_ int vsscanf(const char *file, const char *format, va_list ap) #ifdef SECURE
#define _FUNCTION_ static int vsscanf_s_l(const char *file, const char *format, _locale_t locale, __ms_va_list ap)
#else /* SECURE */
#define _FUNCTION_ static int vsscanf_l(const char *file, const char *format, _locale_t locale, __ms_va_list ap)
#endif /* SECURE */
#endif /* WIDE_SCANF */ #endif /* WIDE_SCANF */
#else /* STRING */ #else /* STRING */
#ifdef WIDE_SCANF #ifdef WIDE_SCANF
#define _GETC_(file) (consumed++, fgetwc(file)) #define _GETC_(file) (consumed++, fgetwc(file))
#define _UNGETC_(nch, file) do { ungetwc(nch, file); consumed--; } while(0) #define _UNGETC_(nch, file) do { ungetwc(nch, file); consumed--; } while(0)
#define _FUNCTION_ int vfwscanf(FILE* file, const wchar_t *format, va_list ap) #ifdef SECURE
#define _FUNCTION_ static int vfwscanf_s_l(FILE* file, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#else /* SECURE */
#define _FUNCTION_ static int vfwscanf_l(FILE* file, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#endif /* SECURE */
#else /* WIDE_SCANF */ #else /* WIDE_SCANF */
#define _GETC_(file) (consumed++, fgetc(file)) #define _GETC_(file) (consumed++, fgetc(file))
#define _UNGETC_(nch, file) do { ungetc(nch, file); consumed--; } while(0) #define _UNGETC_(nch, file) do { ungetc(nch, file); consumed--; } while(0)
#define _FUNCTION_ int vfscanf(FILE* file, const char *format, va_list ap) #ifdef SECURE
#define _FUNCTION_ static int vfscanf_s_l(FILE* file, const char *format, _locale_t locale, __ms_va_list ap)
#else /* SECURE */
#define _FUNCTION_ static int vfscanf_l(FILE* file, const char *format, _locale_t locale, __ms_va_list ap)
#endif /* SECURE */
#endif /* WIDE_SCANF */ #endif /* WIDE_SCANF */
#endif /* STRING */ #endif /* STRING */
#endif /* CONSOLE */ #endif /* CONSOLE */
_FUNCTION_ { _FUNCTION_ {
pthreadlocinfo locinfo;
int rd = 0, consumed = 0; int rd = 0, consumed = 0;
int nch; int nch;
if (!*format) return 0; if (!*format) return 0;
@ -94,6 +115,11 @@ _FUNCTION_ {
return _EOF_RET; return _EOF_RET;
} }
if(!locale)
locinfo = get_locinfo();
else
locinfo = locale->locinfo;
while (*format) { while (*format) {
/* a whitespace character in the format string causes scanf to read, /* a whitespace character in the format string causes scanf to read,
* but not store, all consecutive white-space characters in the input * but not store, all consecutive white-space characters in the input
@ -246,8 +272,12 @@ _FUNCTION_ {
case 'f': case 'f':
case 'g': case 'g':
case 'G': { /* read a float */ case 'G': { /* read a float */
long double cur = 0; //long double cur = 1, expcnt = 10;
int negative = 0; ULONGLONG d, hlp;
int exp = 0, negative = 0;
//unsigned fpcontrol;
//BOOL negexp;
/* skip initial whitespace */ /* skip initial whitespace */
while ((nch!=_EOF_) && _ISSPACE_(nch)) while ((nch!=_EOF_) && _ISSPACE_(nch))
nch = _GETC_(file); nch = _GETC_(file);
@ -259,69 +289,112 @@ _FUNCTION_ {
if (width==0) break; if (width==0) break;
nch = _GETC_(file); nch = _GETC_(file);
} }
/* get first digit. */
if ('.' != nch) { /* get first digit. */
if (!_ISDIGIT_(nch)) break; if (*locinfo->lconv->decimal_point != nch) {
cur = (nch - '0'); if (!_ISDIGIT_(nch)) break;
nch = _GETC_(file); d = nch - '0';
if (width>0) width--;
/* read until no more digits */
while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
cur = cur*10 + (nch - '0');
nch = _GETC_(file);
if (width>0) width--;
}
} else {
cur = 0; /* MaxPayneDemo Fix: .8 -> 0.8 */
}
/* handle decimals */
if (width!=0 && nch == '.') {
long double dec = 1;
nch = _GETC_(file); nch = _GETC_(file);
if (width>0) width--; if (width>0) width--;
/* read until no more digits */
while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
hlp = d*10 + nch - '0';
nch = _GETC_(file);
if (width>0) width--;
if(d > (ULONGLONG)-1/10 || hlp<d) {
exp++;
break;
}
else
d = hlp;
}
while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
exp++;
nch = _GETC_(file);
if (width>0) width--;
}
} else {
d = 0; /* Fix: .8 -> 0.8 */
}
/* handle decimals */
if (width!=0 && nch == *locinfo->lconv->decimal_point) {
nch = _GETC_(file);
if (width>0) width--;
while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
hlp = d*10 + nch - '0';
nch = _GETC_(file);
if (width>0) width--;
if(d > (ULONGLONG)-1/10 || hlp<d)
break;
d = hlp;
exp--;
}
while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) { while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
dec /= 10;
cur += dec * (nch - '0');
nch = _GETC_(file); nch = _GETC_(file);
if (width>0) width--; if (width>0) width--;
} }
} }
/* handle exponent */
if (width!=0 && (nch == 'e' || nch == 'E')) { /* handle exponent */
int exponent = 0, negexp = 0; if (width!=0 && (nch == 'e' || nch == 'E')) {
double expcnt, shift; int sign = 1, e = 0;
nch = _GETC_(file); nch = _GETC_(file);
if (width>0) width--; if (width>0) width--;
/* possible sign on the exponent */ if (width!=0 && (nch=='+' || nch=='-')) {
if (width!=0 && (nch=='+' || nch=='-')) { if(nch == '-')
negexp = (nch=='-'); sign = -1;
nch = _GETC_(file);
if (width>0) width--;
}
/* exponent digits */
while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
exponent *= 10;
exponent += (nch - '0');
nch = _GETC_(file); nch = _GETC_(file);
if (width>0) width--; if (width>0) width--;
} }
/* update 'cur' with this exponent. */
expcnt = 10; /* exponent digits */
shift = 1.0; while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
while (exponent!=0) { if(e > INT_MAX/10 || (e = e*10 + nch - '0')<0)
if (exponent&1) e = INT_MAX;
shift *= expcnt; nch = _GETC_(file);
exponent/=2; if (width>0) width--;
expcnt=expcnt*expcnt; }
} e *= sign;
cur = (negexp ? cur / shift : cur * shift);
} if(exp<0 && e<0 && e+exp>0) exp = INT_MIN;
else if(exp>0 && e>0 && e+exp<0) exp = INT_MAX;
else exp += e;
}
#ifdef __REACTOS__
/* ReactOS: don't inline float processing (kernel/freeldr don't like that! */
_internal_handle_float(negative, exp, suppress, d, l_prefix || L_prefix, &ap);
st = 1;
#else
fpcontrol = _control87(0, 0);
_control87(MSVCRT__EM_DENORMAL|MSVCRT__EM_INVALID|MSVCRT__EM_ZERODIVIDE
|MSVCRT__EM_OVERFLOW|MSVCRT__EM_UNDERFLOW|MSVCRT__EM_INEXACT, 0xffffffff);
negexp = (exp < 0);
if(negexp)
exp = -exp;
/* update 'cur' with this exponent. */
while(exp) {
if(exp & 1)
cur *= expcnt;
exp /= 2;
expcnt = expcnt*expcnt;
}
cur = (negexp ? d/cur : d*cur);
_control87(fpcontrol, 0xffffffff);
st = 1; st = 1;
if (!suppress) { if (!suppress) {
if (L_prefix) _SET_NUMBER_(long double); if (L_prefix) _SET_NUMBER_(double);
else if (l_prefix) _SET_NUMBER_(double); else if (l_prefix) _SET_NUMBER_(double);
else _SET_NUMBER_(float); else _SET_NUMBER_(float);
} }
#endif /* __REACTOS__ */
} }
break; break;
/* According to msdn, /* According to msdn,
@ -448,11 +521,7 @@ _FUNCTION_ {
int invert = 0; /* Set if we are NOT to find the chars */ int invert = 0; /* Set if we are NOT to find the chars */
/* Init our bitmap */ /* Init our bitmap */
#ifdef _LIBCNT_
Mask = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, _BITMAPSIZE_/8);
#else
Mask = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, _BITMAPSIZE_/8); Mask = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, _BITMAPSIZE_/8);
#endif
RtlInitializeBitMap(&bitMask, Mask, _BITMAPSIZE_); RtlInitializeBitMap(&bitMask, Mask, _BITMAPSIZE_);
/* Read the format */ /* Read the format */
@ -497,11 +566,7 @@ _FUNCTION_ {
} }
/* terminate */ /* terminate */
if (!suppress) *sptr = 0; if (!suppress) *sptr = 0;
#ifdef _LIBCNT_
RtlFreeHeap(RtlGetProcessHeap(), 0, Mask);
#else
HeapFree(GetProcessHeap(), 0, Mask); HeapFree(GetProcessHeap(), 0, Mask);
#endif
} }
break; break;
default: default:

View file

@ -0,0 +1,102 @@
#include "precomp.h"
#include "winesup.h"
#ifdef _LIBCNT_
static struct lconv _LIBCNT_lconv =
{
".", // char* decimal_point;
",", // char* thousands_sep;
" ", // char* grouping;
"$", // char* int_curr_symbol;
"$", // char* currency_symbol;
".", // char* mon_decimal_point;
"?", // char* mon_thousands_sep;
"/", // char* mon_grouping;
"+", // char* positive_sign;
"-", // char* negative_sign;
4, // char int_frac_digits;
4, // char frac_digits;
4, // char p_cs_precedes;
1, // char p_sep_by_space;
0, // char n_cs_precedes;
1, // char n_sep_by_space;
1, // char p_sign_posn;
1, // char n_sign_posn;
};
threadlocinfo _LIBCNT_locinfo =
{
2, // LONG refcount;
0, // CP_ACP, // unsigned int lc_codepage;
0, // unsigned int lc_collate_cp;
{0}, // unsigned long lc_handle[6];
{{0}}, // LC_ID lc_id[6];
// struct {
// char *locale;
// wchar_t *wlocale;
// int *refcount;
// int *wrefcount;
// } lc_category[6];
{{0}},
0, // int lc_clike;
2, // int mb_cur_max;
0, // int *lconv_intl_refcount;
0, // int *lconv_num_refcount;
0, // int *lconv_mon_refcount;
&_LIBCNT_lconv, // struct MSVCRT_lconv *lconv;
0, // int *ctype1_refcount;
0, // unsigned short *ctype1;
0, // const unsigned short *pctype;
0, // unsigned char *pclmap;
0, // unsigned char *pcumap;
0, // struct __lc_time_data *lc_time_curr;
};
#define get_locinfo() (&_LIBCNT_locinfo)
#endif
#define _SET_NUMBER_(type) *va_arg((*ap), type*) = negative ? -cur : cur
void
__declspec(noinline)
_internal_handle_float(
int negative,
int exp,
int suppress,
ULONGLONG d,
int l_or_L_prefix,
va_list *ap)
{
long double cur = 1, expcnt = 10;
unsigned fpcontrol;
BOOL negexp;
fpcontrol = _control87(0, 0);
_control87(_EM_DENORMAL|_EM_INVALID|_EM_ZERODIVIDE
|_EM_OVERFLOW|_EM_UNDERFLOW|_EM_INEXACT, 0xffffffff);
negexp = (exp < 0);
if(negexp)
exp = -exp;
/* update 'cur' with this exponent. */
while(exp) {
if(exp & 1)
cur *= expcnt;
exp /= 2;
expcnt = expcnt*expcnt;
}
cur = (negexp ? d/cur : d*cur);
_control87(fpcontrol, 0xffffffff);
if (!suppress) {
if (l_or_L_prefix) _SET_NUMBER_(double);
else _SET_NUMBER_(float);
}
}
#undef _SET_NUMBER_

View file

@ -0,0 +1,45 @@
#pragma once
#include <stdio.h>
#include <conio.h>
#include <float.h>
#include <locale.h>
#include <internal/locale.h>
#undef NtCurrentPeb
#define NtCurrentPeb() (NtCurrentTeb()->Peb)
#define GetProcessHeap() (NtCurrentPeb()->ProcessHeap)
#define HeapAlloc(_Heap, _Flags, _Size) RtlAllocateHeap(_Heap, _Flags, _Size)
#define HeapFree(_Heap, _Flags, _Ptr) RtlFreeHeap(_Heap, _Flags, _Ptr)
#ifdef _LIBCNT_
static inline unsigned int __control87(unsigned int new, unsigned int mask)
{
return 0;
}
#define _control87 __control87
extern threadlocinfo _LIBCNT_locinfo;
#define get_locinfo() (&_LIBCNT_locinfo)
#else
#define get_locinfo() ((pthreadlocinfo)get_locinfo())
#endif
void
__declspec(noinline)
_internal_handle_float(
int negative,
int exp,
int suppress,
ULONGLONG d,
int l_or_L_prefix,
va_list *ap);
//#include <debug.h>
#define __WINE_DEBUG_H
#undef WINE_DEFAULT_DEBUG_CHANNEL
#define WINE_DEFAULT_DEBUG_CHANNEL(_Ch)
#undef TRACE
#define TRACE(...) /* DPRINT(__VA_ARGS__) */
#define debugstr_a(format) format

View file

@ -10,6 +10,14 @@ Title: DejaVu Fonts
Used Version: 2.34 Used Version: 2.34
Website: http://dejavu.sourceforge.net Website: http://dejavu.sourceforge.net
Title: Ubuntu Fonts
Used Version: 0.80
Website: http://font.ubuntu.com
Title: Open Sans Fonts
Used Version: 1.10
Website: http://www.google.com/fonts/specimen/Open+Sans
Title: DXTN OpenGL Compression Libs Title: DXTN OpenGL Compression Libs
Used Version: 1.1 Used Version: 1.1
Website: http://www.geocities.com/dborca/opengl/tc.html Website: http://www.geocities.com/dborca/opengl/tc.html

View file

@ -47,9 +47,35 @@ list(APPEND FONT_FILES
LiberationSerif-Italic.ttf LiberationSerif-Italic.ttf
LiberationSerif-Regular.ttf LiberationSerif-Regular.ttf
Marlett.ttf Marlett.ttf
OpenSans-Bold.ttf
OpenSans-BoldItalic.ttf
OpenSans-CondBold.ttf
OpenSans-CondLight.ttf
OpenSans-CondLightItalic.ttf
OpenSans-ExtraBold.ttf
OpenSans-ExtraBoldItalic.ttf
OpenSans-Italic.ttf
OpenSans-Light.ttf
OpenSans-LightItalic.ttf
OpenSans-Regular.ttf
OpenSans-Semibold.ttf
OpenSans-SemiboldItalic.ttf
symbol.ttf symbol.ttf
tahoma.ttf tahoma.ttf
tahomabd.ttf tahomabd.ttf
Ubuntu-B.ttf
Ubuntu-BI.ttf
Ubuntu-C.ttf
Ubuntu-L.ttf
Ubuntu-LI.ttf
Ubuntu-M.ttf
Ubuntu-MI.ttf
UbuntuMono-B.ttf
UbuntuMono-BI.ttf
UbuntuMono-R.ttf
UbuntuMono-RI.ttf
Ubuntu-R.ttf
Ubuntu-RI.ttf
UniVGA16.ttf UniVGA16.ttf
) )

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
media/fonts/Ubuntu-B.ttf Normal file

Binary file not shown.

BIN
media/fonts/Ubuntu-BI.ttf Normal file

Binary file not shown.

BIN
media/fonts/Ubuntu-C.ttf Normal file

Binary file not shown.

BIN
media/fonts/Ubuntu-L.ttf Normal file

Binary file not shown.

BIN
media/fonts/Ubuntu-LI.ttf Normal file

Binary file not shown.

BIN
media/fonts/Ubuntu-M.ttf Normal file

Binary file not shown.

BIN
media/fonts/Ubuntu-MI.ttf Normal file

Binary file not shown.

BIN
media/fonts/Ubuntu-R.ttf Normal file

Binary file not shown.

BIN
media/fonts/Ubuntu-RI.ttf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more