2021-08-31 11:18:20 +02:00
|
|
|
/*
|
|
|
|
* Unix interface for Win32 syscalls
|
|
|
|
*
|
|
|
|
* Copyright (C) 2021 Alexandre Julliard
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
#pragma makedep unix
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "ntstatus.h"
|
|
|
|
#define WIN32_NO_STATUS
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winnt.h"
|
2021-10-06 16:20:35 +02:00
|
|
|
#include "ntgdi_private.h"
|
2021-10-12 16:42:35 +02:00
|
|
|
#include "ntuser.h"
|
2021-08-31 11:18:20 +02:00
|
|
|
#include "wine/unixlib.h"
|
|
|
|
|
|
|
|
|
|
|
|
static void * const syscalls[] =
|
|
|
|
{
|
2021-10-11 18:49:36 +02:00
|
|
|
NtGdiAddFontMemResourceEx,
|
|
|
|
NtGdiAddFontResourceW,
|
2021-10-11 18:48:44 +02:00
|
|
|
NtGdiCombineRgn,
|
2021-10-11 18:48:15 +02:00
|
|
|
NtGdiCreateBitmap,
|
2021-10-11 18:50:09 +02:00
|
|
|
NtGdiCreateClientObj,
|
2021-10-08 13:35:41 +02:00
|
|
|
NtGdiCreateDIBBrush,
|
2021-10-11 18:48:15 +02:00
|
|
|
NtGdiCreateDIBSection,
|
2021-10-11 18:48:44 +02:00
|
|
|
NtGdiCreateEllipticRgn,
|
2021-10-11 18:51:06 +02:00
|
|
|
NtGdiCreateHalftonePalette,
|
2021-10-08 13:35:41 +02:00
|
|
|
NtGdiCreateHatchBrushInternal,
|
2021-10-11 18:51:06 +02:00
|
|
|
NtGdiCreatePaletteInternal,
|
2021-10-08 13:35:41 +02:00
|
|
|
NtGdiCreatePatternBrushInternal,
|
2021-10-12 15:29:19 +02:00
|
|
|
NtGdiCreatePen,
|
2021-10-11 18:48:44 +02:00
|
|
|
NtGdiCreateRectRgn,
|
|
|
|
NtGdiCreateRoundRectRgn,
|
2021-10-08 13:35:41 +02:00
|
|
|
NtGdiCreateSolidBrush,
|
2021-10-15 16:53:28 +02:00
|
|
|
NtGdiDdDDICloseAdapter,
|
|
|
|
NtGdiDdDDICreateDevice,
|
|
|
|
NtGdiDdDDIOpenAdapterFromDeviceName,
|
|
|
|
NtGdiDdDDIOpenAdapterFromHdc,
|
|
|
|
NtGdiDdDDIOpenAdapterFromLuid,
|
|
|
|
NtGdiDdDDIQueryStatistics,
|
|
|
|
NtGdiDdDDISetQueuedLimit,
|
2021-10-11 18:50:09 +02:00
|
|
|
NtGdiDeleteClientObj,
|
2021-10-11 18:49:07 +02:00
|
|
|
NtGdiDescribePixelFormat,
|
|
|
|
NtGdiDrawStream,
|
2021-10-11 18:48:44 +02:00
|
|
|
NtGdiEqualRgn,
|
2021-10-12 15:29:19 +02:00
|
|
|
NtGdiExtCreatePen,
|
2021-10-11 18:48:44 +02:00
|
|
|
NtGdiExtCreateRegion,
|
2021-10-11 18:50:09 +02:00
|
|
|
NtGdiExtGetObjectW,
|
2021-10-12 15:28:52 +02:00
|
|
|
NtGdiFlattenPath,
|
2021-08-31 11:18:20 +02:00
|
|
|
NtGdiFlush,
|
2021-10-11 18:48:15 +02:00
|
|
|
NtGdiGetBitmapBits,
|
|
|
|
NtGdiGetBitmapDimension,
|
2021-10-11 18:50:09 +02:00
|
|
|
NtGdiGetColorAdjustment,
|
|
|
|
NtGdiGetDCObject,
|
2021-10-11 18:49:36 +02:00
|
|
|
NtGdiGetFontFileData,
|
|
|
|
NtGdiGetFontFileInfo,
|
2021-10-11 18:51:06 +02:00
|
|
|
NtGdiGetNearestPaletteIndex,
|
2021-10-12 15:28:52 +02:00
|
|
|
NtGdiGetPath,
|
2021-10-11 18:48:44 +02:00
|
|
|
NtGdiGetRegionData,
|
|
|
|
NtGdiGetRgnBox,
|
2021-10-12 15:30:00 +02:00
|
|
|
NtGdiGetSpoolMessage,
|
2021-10-11 18:51:06 +02:00
|
|
|
NtGdiGetSystemPaletteUse,
|
2021-10-11 18:49:07 +02:00
|
|
|
NtGdiGetTransform,
|
2021-10-11 18:49:36 +02:00
|
|
|
NtGdiHfontCreate,
|
2021-10-12 15:30:00 +02:00
|
|
|
NtGdiInitSpool,
|
2021-10-11 18:48:44 +02:00
|
|
|
NtGdiOffsetRgn,
|
2021-10-12 15:28:52 +02:00
|
|
|
NtGdiPathToRegion,
|
2021-10-11 18:48:44 +02:00
|
|
|
NtGdiPtInRegion,
|
|
|
|
NtGdiRectInRegion,
|
2021-10-11 18:49:36 +02:00
|
|
|
NtGdiRemoveFontMemResourceEx,
|
|
|
|
NtGdiRemoveFontResourceW,
|
2021-10-11 18:49:07 +02:00
|
|
|
NtGdiSaveDC,
|
2021-10-11 18:48:15 +02:00
|
|
|
NtGdiSetBitmapBits,
|
|
|
|
NtGdiSetBitmapDimension,
|
2021-10-11 18:49:07 +02:00
|
|
|
NtGdiSetBrushOrg,
|
2021-10-11 18:50:09 +02:00
|
|
|
NtGdiSetColorAdjustment,
|
2021-10-11 18:51:06 +02:00
|
|
|
NtGdiSetMagicColors,
|
2021-10-11 18:48:44 +02:00
|
|
|
NtGdiSetMetaRgn,
|
2021-10-11 18:49:07 +02:00
|
|
|
NtGdiSetPixelFormat,
|
2021-10-11 18:48:44 +02:00
|
|
|
NtGdiSetRectRgn,
|
2021-10-11 18:49:36 +02:00
|
|
|
NtGdiSetTextJustification,
|
2021-10-11 18:50:37 +02:00
|
|
|
NtGdiSetVirtualResolution,
|
2021-10-11 18:49:07 +02:00
|
|
|
NtGdiSwapBuffers,
|
2021-10-11 18:50:37 +02:00
|
|
|
NtGdiTransformPoints,
|
2021-11-12 12:54:45 +01:00
|
|
|
NtUserAddClipboardFormatListener,
|
2021-11-16 12:32:55 +01:00
|
|
|
NtUserAttachThreadInput,
|
2021-10-13 14:53:36 +02:00
|
|
|
NtUserCloseDesktop,
|
2021-10-12 16:42:35 +02:00
|
|
|
NtUserCloseWindowStation,
|
2021-10-14 15:21:15 +02:00
|
|
|
NtUserCreateDesktopEx,
|
2021-10-14 15:20:42 +02:00
|
|
|
NtUserCreateWindowStation,
|
2021-11-12 12:53:28 +01:00
|
|
|
NtUserGetClipboardFormatName,
|
2021-11-12 12:53:50 +01:00
|
|
|
NtUserGetClipboardOwner,
|
2021-11-12 12:54:29 +01:00
|
|
|
NtUserGetClipboardSequenceNumber,
|
2021-11-12 12:53:59 +01:00
|
|
|
NtUserGetClipboardViewer,
|
2021-12-03 12:55:44 +01:00
|
|
|
NtUserGetCursor,
|
2021-11-16 12:33:09 +01:00
|
|
|
NtUserGetKeyState,
|
2021-11-16 12:35:43 +01:00
|
|
|
NtUserGetKeyboardLayout,
|
2021-11-16 12:33:23 +01:00
|
|
|
NtUserGetKeyboardState,
|
2021-11-08 14:48:28 +01:00
|
|
|
NtUserGetLayeredWindowAttributes,
|
2021-11-17 12:48:53 +01:00
|
|
|
NtUserGetMouseMovePointsEx,
|
2021-10-13 14:55:30 +02:00
|
|
|
NtUserGetObjectInformation,
|
2021-11-16 12:36:26 +01:00
|
|
|
NtUserGetOpenClipboardWindow,
|
2021-10-13 14:52:53 +02:00
|
|
|
NtUserGetProcessWindowStation,
|
2021-11-08 14:48:45 +01:00
|
|
|
NtUserGetProp,
|
2021-10-13 14:54:00 +02:00
|
|
|
NtUserGetThreadDesktop,
|
2021-10-14 15:21:33 +02:00
|
|
|
NtUserOpenDesktop,
|
2021-10-13 14:54:56 +02:00
|
|
|
NtUserOpenInputDesktop,
|
2021-10-14 15:20:56 +02:00
|
|
|
NtUserOpenWindowStation,
|
2021-11-12 12:54:45 +01:00
|
|
|
NtUserRemoveClipboardFormatListener,
|
2021-11-08 14:48:55 +01:00
|
|
|
NtUserRemoveProp,
|
2021-11-16 12:33:36 +01:00
|
|
|
NtUserSetKeyboardState,
|
2021-10-13 14:56:22 +02:00
|
|
|
NtUserSetObjectInformation,
|
2021-10-13 14:53:22 +02:00
|
|
|
NtUserSetProcessWindowStation,
|
2021-11-08 14:48:37 +01:00
|
|
|
NtUserSetProp,
|
2021-10-13 14:54:21 +02:00
|
|
|
NtUserSetThreadDesktop,
|
2021-08-31 11:18:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static BYTE arguments[ARRAY_SIZE(syscalls)];
|
|
|
|
|
|
|
|
static SYSTEM_SERVICE_TABLE syscall_table =
|
|
|
|
{
|
|
|
|
(ULONG_PTR *)syscalls,
|
|
|
|
0,
|
|
|
|
ARRAY_SIZE(syscalls),
|
|
|
|
arguments
|
|
|
|
};
|
|
|
|
|
|
|
|
static NTSTATUS init( void *dispatcher )
|
|
|
|
{
|
2021-10-06 16:20:35 +02:00
|
|
|
NTSTATUS status;
|
|
|
|
if ((status = ntdll_init_syscalls( 1, &syscall_table, dispatcher ))) return status;
|
2021-10-14 15:22:40 +02:00
|
|
|
if ((status = gdi_init())) return status;
|
|
|
|
winstation_init();
|
|
|
|
return STATUS_SUCCESS;
|
2021-08-31 11:18:20 +02:00
|
|
|
}
|
|
|
|
|
2021-10-06 16:20:35 +02:00
|
|
|
unixlib_entry_t __wine_unix_call_funcs[] =
|
|
|
|
{
|
|
|
|
init,
|
|
|
|
callbacks_init,
|
|
|
|
};
|