https://git.reactos.org/?p=reactos.git;a=commitdiff;h=40c42305c31dd4e1f39c6…
commit 40c42305c31dd4e1f39c6f6432ecd4cf422094e8
Author: James Tabor <james.tabor(a)reactos.org>
AuthorDate: Fri Jun 21 13:10:03 2019 -0500
Commit: James Tabor <james.tabor(a)reactos.org>
CommitDate: Fri Jun 21 13:10:03 2019 -0500
[Win32SS] Add Driver Callback
Add user driver callback to be used later on.
---
win32ss/include/callback.h | 5 ++++-
win32ss/user/ntuser/callback.c | 25 +++++++++++++++++++++++++
win32ss/user/user32/misc/dllmain.c | 7 +++++++
3 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/win32ss/include/callback.h b/win32ss/include/callback.h
index 75eda686a2d..5b6f49ce3a2 100644
--- a/win32ss/include/callback.h
+++ b/win32ss/include/callback.h
@@ -18,7 +18,8 @@
#define USER32_CALLBACK_DDEGET (14)
#define USER32_CALLBACK_SETOBM (15)
#define USER32_CALLBACK_LPK (16)
-#define USER32_CALLBACK_MAXIMUM (16)
+#define USER32_CALLBACK_UMPD (17)
+#define USER32_CALLBACK_MAXIMUM (17)
typedef struct _WINDOWPROC_CALLBACK_ARGUMENTS
{
@@ -186,4 +187,6 @@ NTSTATUS WINAPI
User32CallOBMFromKernel(PVOID Arguments, ULONG ArgumentLength);
NTSTATUS WINAPI
User32CallLPKFromKernel(PVOID Arguments, ULONG ArgumentLength);
+NTSTATUS WINAPI
+User32CallUMPDFromKernel(PVOID Arguments, ULONG ArgumentLength);
#endif /* __INCLUDE_USER32_CALLBACK_H */
diff --git a/win32ss/user/ntuser/callback.c b/win32ss/user/ntuser/callback.c
index fb9fc9692d5..151a2f12af9 100644
--- a/win32ss/user/ntuser/callback.c
+++ b/win32ss/user/ntuser/callback.c
@@ -1208,5 +1208,30 @@ co_IntSetupOBM(VOID)
IntCbFreeMemory(Argument);
}
+LRESULT
+APIENTRY
+co_UserCBClientPrinterThunk( PVOID pkt, INT InSize, PVOID pvOutData, INT OutSize )
+{
+ ULONG ResultLength;
+ PVOID ResultPointer;
+ NTSTATUS Status;
+ UserLeaveCo();
+
+ Status = KeUserModeCallback(USER32_CALLBACK_UMPD,
+ 0,
+ 0,
+ &ResultPointer,
+ &ResultLength);
+
+
+ UserEnterCo();
+
+ if (!NT_SUCCESS(Status))
+ {
+ ERR("User UMPD callback failed!\n");
+ }
+
+ return 0;
+}
/* EOF */
diff --git a/win32ss/user/user32/misc/dllmain.c b/win32ss/user/user32/misc/dllmain.c
index e329b85229b..a7d0f098b49 100644
--- a/win32ss/user/user32/misc/dllmain.c
+++ b/win32ss/user/user32/misc/dllmain.c
@@ -206,6 +206,7 @@ PVOID apfnDispatch[USER32_CALLBACK_MAXIMUM + 1] =
User32CallDDEGetFromKernel,
User32CallOBMFromKernel,
User32CallLPKFromKernel,
+ User32CallUMPDFromKernel,
};
@@ -663,3 +664,9 @@ NTSTATUS WINAPI User32CallLPKFromKernel(PVOID Arguments, ULONG
ArgumentLength)
return ZwCallbackReturn(&bResult, sizeof(BOOL), STATUS_SUCCESS);
}
+
+NTSTATUS WINAPI User32CallUMPDFromKernel(PVOID Arguments, ULONG ArgumentLength)
+{
+ // = GdiPrinterThunk( , , );
+ return ZwCallbackReturn(Arguments, ArgumentLength, STATUS_SUCCESS);
+}