From 92e0fb44ca14e7b9d050e2968fefb94f2ff7b05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 22 Feb 2016 19:07:44 +0000 Subject: [PATCH] [VIDEOPRT] - Complete the table of exported VideoPort functions (compatible Win2k3 SP2), some functions were missing in it: see for example the last picture of http://www.reactos.org/forum/viewtopic.php?f=4&t=14727#p120344 . - Don't redirect the VideoPortInterlockedIncrement/Decrement/Exchange functions directly to NTOS, because otherwise they cannot be included in the exports table. svn path=/trunk/; revision=70769 --- reactos/win32ss/drivers/videoprt/funclist.c | 72 ++++++++++++++----- reactos/win32ss/drivers/videoprt/stubs.c | 50 ++++++------- .../win32ss/drivers/videoprt/videoprt.spec | 15 ++-- 3 files changed, 88 insertions(+), 49 deletions(-) diff --git a/reactos/win32ss/drivers/videoprt/funclist.c b/reactos/win32ss/drivers/videoprt/funclist.c index c3f7fd34723..e84e3ab5087 100644 --- a/reactos/win32ss/drivers/videoprt/funclist.c +++ b/reactos/win32ss/drivers/videoprt/funclist.c @@ -31,46 +31,82 @@ typedef struct _VIDEO_PORT_FUNCTION_TABLE { /* GLOBAL VARIABLES ***********************************************************/ -#define VP_EXPORTED_FUNCS (sizeof(VideoPortExports) / sizeof(*VideoPortExports)) - /* Create an array of entries with pfn, psz, for IntVideoPortGetProcAddress */ #define MAKE_ENTRY(FUNCTIONNAME) { FUNCTIONNAME, #FUNCTIONNAME } const VIDEO_PORT_FUNCTION_TABLE VideoPortExports[] = { + MAKE_ENTRY(VideoPortDDCMonitorHelper), + MAKE_ENTRY(VideoPortDoDma), + MAKE_ENTRY(VideoPortGetCommonBuffer), + MAKE_ENTRY(VideoPortGetMdl), + MAKE_ENTRY(VideoPortLockPages), + MAKE_ENTRY(VideoPortSignalDmaComplete), + MAKE_ENTRY(VideoPortUnlockPages), + MAKE_ENTRY(VideoPortAssociateEventsWithDmaHandle), + MAKE_ENTRY(VideoPortGetBytesUsed), + MAKE_ENTRY(VideoPortSetBytesUsed), + MAKE_ENTRY(VideoPortGetDmaContext), + MAKE_ENTRY(VideoPortSetDmaContext), + MAKE_ENTRY(VideoPortMapDmaMemory), + MAKE_ENTRY(VideoPortUnmapDmaMemory), + MAKE_ENTRY(VideoPortGetAgpServices), + MAKE_ENTRY(VideoPortAllocateContiguousMemory), + MAKE_ENTRY(VideoPortGetRomImage), + MAKE_ENTRY(VideoPortGetAssociatedDeviceExtension), + MAKE_ENTRY(VideoPortGetAssociatedDeviceID), + MAKE_ENTRY(VideoPortAcquireDeviceLock), + MAKE_ENTRY(VideoPortReleaseDeviceLock), + MAKE_ENTRY(VideoPortAllocateBuffer), + MAKE_ENTRY(VideoPortFreeCommonBuffer), + MAKE_ENTRY(VideoPortReleaseBuffer), + MAKE_ENTRY(VideoPortInterlockedIncrement), + MAKE_ENTRY(VideoPortInterlockedDecrement), + MAKE_ENTRY(VideoPortInterlockedExchange), + MAKE_ENTRY(VideoPortGetVgaStatus), MAKE_ENTRY(VideoPortQueueDpc), - MAKE_ENTRY(VideoPortAllocatePool), - MAKE_ENTRY(VideoPortFreePool), - MAKE_ENTRY(VideoPortReleaseCommonBuffer), - MAKE_ENTRY(VideoPortAllocateCommonBuffer), - MAKE_ENTRY(VideoPortCreateSecondaryDisplay), + MAKE_ENTRY(VideoPortEnumerateChildren), + MAKE_ENTRY(VideoPortQueryServices), MAKE_ENTRY(VideoPortGetDmaAdapter), - MAKE_ENTRY(VideoPortGetVersion), + MAKE_ENTRY(VideoPortPutDmaAdapter), + MAKE_ENTRY(VideoPortAllocateCommonBuffer), + MAKE_ENTRY(VideoPortReleaseCommonBuffer), MAKE_ENTRY(VideoPortLockBuffer), MAKE_ENTRY(VideoPortUnlockBuffer), + MAKE_ENTRY(VideoPortStartDma), + MAKE_ENTRY(VideoPortCompleteDma), + MAKE_ENTRY(VideoPortCreateEvent), + MAKE_ENTRY(VideoPortDeleteEvent), MAKE_ENTRY(VideoPortSetEvent), MAKE_ENTRY(VideoPortClearEvent), MAKE_ENTRY(VideoPortReadStateEvent), - MAKE_ENTRY(VideoPortRegisterBugcheckCallback), - MAKE_ENTRY(VideoPortCreateEvent), - MAKE_ENTRY(VideoPortDeleteEvent), MAKE_ENTRY(VideoPortWaitForSingleObject), + MAKE_ENTRY(VideoPortAllocatePool), + MAKE_ENTRY(VideoPortFreePool), + MAKE_ENTRY(VideoPortCreateSpinLock), + MAKE_ENTRY(VideoPortDeleteSpinLock), + MAKE_ENTRY(VideoPortAcquireSpinLock), + MAKE_ENTRY(VideoPortAcquireSpinLockAtDpcLevel), + MAKE_ENTRY(VideoPortReleaseSpinLock), + MAKE_ENTRY(VideoPortReleaseSpinLockFromDpcLevel), MAKE_ENTRY(VideoPortCheckForDeviceExistence), + MAKE_ENTRY(VideoPortCreateSecondaryDisplay), MAKE_ENTRY(VideoPortFlushRegistry), MAKE_ENTRY(VideoPortQueryPerformanceCounter), + MAKE_ENTRY(VideoPortGetVersion), + MAKE_ENTRY(VideoPortRegisterBugcheckCallback), }; #undef MAKE_ENTRY PVOID NTAPI IntVideoPortGetProcAddress( - IN PVOID HwDeviceExtension, - IN PUCHAR FunctionName) + IN PVOID HwDeviceExtension, + IN PUCHAR FunctionName) { - ULONG i = 0; + ULONG i; TRACE_(VIDEOPRT, "VideoPortGetProcAddress(%s)\n", FunctionName); /* Search by name */ - - for (i = 0; i < VP_EXPORTED_FUNCS; i++) + for (i = 0; i < ARRAYSIZE(VideoPortExports); i++) { if (!strcmp((PCHAR)FunctionName, VideoPortExports[i].Name)) { @@ -78,7 +114,7 @@ IntVideoPortGetProcAddress( } } - ERR_(VIDEOPRT, "VideoPortGetProcAddress: Can't resolve symbol %s\n", FunctionName); + ERR_(VIDEOPRT, "VideoPortGetProcAddress: Can't resolve symbol %s\n", FunctionName); - return NULL; + return NULL; } diff --git a/reactos/win32ss/drivers/videoprt/stubs.c b/reactos/win32ss/drivers/videoprt/stubs.c index d7b0d890f2b..5aa47a49dc2 100644 --- a/reactos/win32ss/drivers/videoprt/stubs.c +++ b/reactos/win32ss/drivers/videoprt/stubs.c @@ -105,6 +105,31 @@ WdDdiWatchdogDpcCallback( UNIMPLEMENTED; } +LONG +FASTCALL +VideoPortInterlockedDecrement( + IN PLONG Addend) +{ + return _InterlockedDecrement(Addend); +} + +LONG +FASTCALL +VideoPortInterlockedIncrement( + IN PLONG Addend) +{ + return _InterlockedIncrement(Addend); +} + +LONG +FASTCALL +VideoPortInterlockedExchange( + IN OUT PLONG Target, + IN LONG Value) +{ + return InterlockedExchange(Target, Value); +} + #ifdef _M_AMD64 UCHAR NTAPI @@ -328,31 +353,6 @@ VideoPortWriteRegisterBufferUlong( WRITE_REGISTER_BUFFER_ULONG(Register, Buffer, Count); } -LONG -FASTCALL -VideoPortInterlockedDecrement( - IN PLONG Addend) -{ - return _InterlockedDecrement(Addend); -} - -LONG -FASTCALL -VideoPortInterlockedIncrement( - IN PLONG Addend) -{ - return _InterlockedIncrement(Addend); -} - -LONG -FASTCALL -VideoPortInterlockedExchange( - IN OUT PLONG Target, - IN LONG Value) -{ - return InterlockedExchange(Target, Value); -} - VOID NTAPI VideoPortQuerySystemTime( diff --git a/reactos/win32ss/drivers/videoprt/videoprt.spec b/reactos/win32ss/drivers/videoprt/videoprt.spec index 1ad665a7900..e243d40c0e2 100644 --- a/reactos/win32ss/drivers/videoprt/videoprt.spec +++ b/reactos/win32ss/drivers/videoprt/videoprt.spec @@ -44,12 +44,15 @@ @ stdcall VideoPortGetVgaStatus(ptr ptr) @ stdcall VideoPortInitialize(ptr ptr ptr ptr) @ stdcall VideoPortInt10(ptr ptr) -@ fastcall -arch=i386,arm VideoPortInterlockedDecrement(ptr) NTOSKRNL.InterlockedDecrement -@ fastcall -arch=x86_64 VideoPortInterlockedDecrement(ptr) -@ fastcall -arch=i386,arm VideoPortInterlockedExchange(ptr long) NTOSKRNL.InterlockedExchange -@ fastcall -arch=x86_64 VideoPortInterlockedExchange(ptr long) -@ fastcall -arch=i386,arm VideoPortInterlockedIncrement(ptr) NTOSKRNL.InterlockedIncrement -@ fastcall -arch=x86_64 VideoPortInterlockedIncrement(ptr) +;;@ fastcall -arch=i386,arm VideoPortInterlockedDecrement(ptr) NTOSKRNL.InterlockedDecrement +;;@ fastcall -arch=x86_64 VideoPortInterlockedDecrement(ptr) +@ fastcall VideoPortInterlockedDecrement(ptr) +;;@ fastcall -arch=i386,arm VideoPortInterlockedExchange(ptr long) NTOSKRNL.InterlockedExchange +;;@ fastcall -arch=x86_64 VideoPortInterlockedExchange(ptr long) +@ fastcall VideoPortInterlockedExchange(ptr long) +;;@ fastcall -arch=i386,arm VideoPortInterlockedIncrement(ptr) NTOSKRNL.InterlockedIncrement +;;@ fastcall -arch=x86_64 VideoPortInterlockedIncrement(ptr) +@ fastcall VideoPortInterlockedIncrement(ptr) @ stdcall VideoPortIsNoVesa() @ stdcall VideoPortLockBuffer(ptr ptr long long) @ stdcall VideoPortLockPages(ptr ptr ptr ptr long)