[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
This commit is contained in:
Hermès Bélusca-Maïto
2016-02-22 19:07:44 +00:00
parent 195caaa854
commit 92e0fb44ca
3 changed files with 88 additions and 49 deletions
+54 -18
View File
@@ -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;
}
+25 -25
View File
@@ -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(
@@ -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)