Module: wine
Branch: master
Commit: 93c37404f42782e71093dcff0063d48bb08233a4
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=93c37404f42782e71093dcf…
Author: Paul Vriens <Paul.Vriens(a)xs4all.nl>
Date: Thu Sep 28 12:11:04 2006 +0200
crypt32: A small test to verify when to write function pointers.
---
dlls/crypt32/tests/sip.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/dlls/crypt32/tests/sip.c b/dlls/crypt32/tests/sip.c
index 61293aa..6fa6b99 100644
--- a/dlls/crypt32/tests/sip.c
+++ b/dlls/crypt32/tests/sip.c
@@ -283,41 +283,50 @@ static void test_SIPLoad(void)
SetLastError(0xdeadbeef);
memset(&sdi, 0, sizeof(SIP_DISPATCH_INFO));
sdi.cbSize = sizeof(SIP_DISPATCH_INFO);
+ sdi.pfGet = (pCryptSIPGetSignedDataMsg)0xdeadbeef;
ret = CryptSIPLoad(&dummySubject, 0, &sdi);
ok ( !ret, "Expected CryptSIPLoad to fail\n");
todo_wine
ok ( GetLastError() == TRUST_E_SUBJECT_FORM_UNKNOWN,
"Expected TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08lx\n", GetLastError());
+ ok( sdi.pfGet == (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected no change to the function pointer\n");
/* cbSize not initialized */
SetLastError(0xdeadbeef);
memset(&sdi, 0, sizeof(SIP_DISPATCH_INFO));
+ sdi.pfGet = (pCryptSIPGetSignedDataMsg)0xdeadbeef;
ret = CryptSIPLoad(&dummySubject, 0, &sdi);
ok ( !ret, "Expected CryptSIPLoad to fail\n");
todo_wine
ok ( GetLastError() == TRUST_E_SUBJECT_FORM_UNKNOWN,
"Expected TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08lx\n", GetLastError());
+ ok( sdi.pfGet == (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected no change to the function pointer\n");
/* cbSize not initialized, but valid subject (named unknown but registered by wintrust) */
SetLastError(0xdeadbeef);
memset(&sdi, 0, sizeof(SIP_DISPATCH_INFO));
+ sdi.pfGet = (pCryptSIPGetSignedDataMsg)0xdeadbeef;
ret = CryptSIPLoad(&unknown, 0, &sdi);
todo_wine
{
ok ( ret, "Expected CryptSIPLoad to succeed\n");
ok ( GetLastError() == ERROR_PROC_NOT_FOUND,
"Expected ERROR_PROC_NOT_FOUND, got 0x%08lx\n", GetLastError());
+ ok( sdi.pfGet != (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected a function pointer to be loaded.\n");
}
/* All OK */
SetLastError(0xdeadbeef);
memset(&sdi, 0, sizeof(SIP_DISPATCH_INFO));
sdi.cbSize = sizeof(SIP_DISPATCH_INFO);
+ sdi.pfGet = (pCryptSIPGetSignedDataMsg)0xdeadbeef;
ret = CryptSIPLoad(&unknown, 0, &sdi);
todo_wine
ok ( ret, "Expected CryptSIPLoad to succeed\n");
ok ( GetLastError() == 0xdeadbeef,
"Expected 0xdeadbeef, got 0x%08lx\n", GetLastError());
+ todo_wine
+ ok( sdi.pfGet != (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected a function pointer to be loaded.\n");
/* The function addresses returned by CryptSIPLoad are actually the addresses of
* crypt32's own functions. A function calling these addresses will end up first
@@ -351,11 +360,13 @@ static void test_SIPLoad(void)
SetLastError(0xdeadbeef);
memset(&sdi, 0, sizeof(SIP_DISPATCH_INFO));
sdi.cbSize = sizeof(SIP_DISPATCH_INFO);
+ sdi.pfGet = (pCryptSIPGetSignedDataMsg)0xdeadbeef;
ret = CryptSIPLoad(&unknown, 1, &sdi);
ok ( !ret, "Expected CryptSIPLoad to fail\n");
todo_wine
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got 0x%08lx\n", GetLastError());
+ ok( sdi.pfGet == (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected no change to the function pointer\n");
}
START_TEST(sip)
Module: wine
Branch: master
Commit: 26c5839d61de888882a6732c2f1fc41fd2a5aeff
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=26c5839d61de888882a6732…
Author: Detlef Riekenberg <wine.dev(a)web.de>
Date: Wed Sep 27 23:22:33 2006 +0200
localspl: Start implementation of InitializePrintMonitor.
---
dlls/localspl/Makefile.in | 1 +
dlls/localspl/localmon.c | 70 +++++++++++++++++++++++++++++++++++++++++
dlls/localspl/localspl_main.c | 11 ------
3 files changed, 71 insertions(+), 11 deletions(-)
diff --git a/dlls/localspl/Makefile.in b/dlls/localspl/Makefile.in
index 7d80fb7..0e74179 100644
--- a/dlls/localspl/Makefile.in
+++ b/dlls/localspl/Makefile.in
@@ -6,6 +6,7 @@ MODULE = localspl.dll
IMPORTS = kernel32
C_SRCS = \
+ localmon.c \
localspl_main.c
@MAKE_DLL_RULES@
diff --git a/dlls/localspl/localmon.c b/dlls/localspl/localmon.c
new file mode 100644
index 0000000..6665585
--- /dev/null
+++ b/dlls/localspl/localmon.c
@@ -0,0 +1,70 @@
+/*
+ * Implementation of the Local Printmonitor
+ *
+ * Copyright 2006 Detlef Riekenberg
+ *
+ * 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
+ */
+
+#include <stdarg.h>
+
+#define COBJMACROS
+#define NONAMELESSUNION
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "winver.h"
+#include "winnls.h"
+
+#include "winspool.h"
+#include "ddk/winsplp.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+
+WINE_DEFAULT_DEBUG_CHANNEL(localspl);
+
+/*****************************************************
+ * InitializePrintMonitor (LOCALSPL.@)
+ *
+ * Initialize the Monitor for the Local Ports
+ *
+ * PARAMS
+ * regroot [I] Registry-Path, where the settings are stored
+ *
+ * RETURNS
+ * Success: Pointer to a MONITOREX Structure
+ * Failure: NULL
+ *
+ * NOTES
+ * Native localspl.dll fails, when the Section "Ports" is missing in "win.ini".
+ *
+ */
+
+LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot)
+{
+ FIXME("(%s) stub\n", debugstr_w(regroot));
+ if (!regroot || !regroot[0]) {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return NULL;
+ }
+
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return NULL;
+}
diff --git a/dlls/localspl/localspl_main.c b/dlls/localspl/localspl_main.c
index 0bc94f6..48d1efb 100644
--- a/dlls/localspl/localspl_main.c
+++ b/dlls/localspl/localspl_main.c
@@ -58,14 +58,3 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,
}
return TRUE;
}
-
-
-/*****************************************************
- * InitializePrintMonitor (LOCALSPL.@)
- */
-
-LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot)
-{
- FIXME("(%s) stub\n", debugstr_w(regroot));
- return NULL;
-}