Nikolay Sivov : ole32: Move IsValidInterface() to another file.

Alexandre Julliard julliard at winehq.org
Wed Aug 5 16:05:00 CDT 2020


Module: wine
Branch: master
Commit: eb316eda1dceab1d4c1a1335353da79e0c346c26
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=eb316eda1dceab1d4c1a1335353da79e0c346c26

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Aug  5 08:54:58 2020 +0300

ole32: Move IsValidInterface() to another file.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ole32/Makefile.in  |  1 -
 dlls/ole32/ifs.c        | 54 -------------------------------------------------
 dlls/ole32/ole32_main.c | 19 +++++++++++++++++
 3 files changed, 19 insertions(+), 55 deletions(-)

diff --git a/dlls/ole32/Makefile.in b/dlls/ole32/Makefile.in
index 4738407d7f..86f13e188c 100644
--- a/dlls/ole32/Makefile.in
+++ b/dlls/ole32/Makefile.in
@@ -23,7 +23,6 @@ C_SRCS = \
 	ftmarshal.c \
 	git.c \
 	hglobalstream.c \
-	ifs.c \
 	itemmoniker.c \
 	marshal.c \
 	memlockbytes.c \
diff --git a/dlls/ole32/ifs.c b/dlls/ole32/ifs.c
deleted file mode 100644
index 845bdeea4a..0000000000
--- a/dlls/ole32/ifs.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *	basic interfaces
- *
- *	Copyright 1997	Marcus Meissner
- *
- * 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 <ctype.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#define COBJMACROS
-
-#include "windef.h"
-#include "winbase.h"
-#include "winuser.h"
-#include "ole2.h"
-#include "winerror.h"
-
-/******************************************************************************
- *		IsValidInterface	[OLE32.@]
- *
- * Determines whether a pointer is a valid interface.
- *
- * PARAMS
- *  punk [I] Interface to be tested.
- *
- * RETURNS
- *  TRUE, if the passed pointer is a valid interface, or FALSE otherwise.
- */
-BOOL WINAPI IsValidInterface(LPUNKNOWN punk)
-{
-	return !(
-		IsBadReadPtr(punk,4)					||
-		IsBadReadPtr(punk->lpVtbl,4)				||
-		IsBadReadPtr(punk->lpVtbl->QueryInterface,9)	||
-		IsBadCodePtr((FARPROC)punk->lpVtbl->QueryInterface)
-	);
-}
diff --git a/dlls/ole32/ole32_main.c b/dlls/ole32/ole32_main.c
index c38c525d5a..414fdf2b36 100644
--- a/dlls/ole32/ole32_main.c
+++ b/dlls/ole32/ole32_main.c
@@ -175,3 +175,22 @@ HRESULT WINAPI CoGetCallState(int unknown, PULONG unknown2)
     FIXME("%d, %p\n", unknown, unknown2);
     return E_NOTIMPL;
 }
+
+/******************************************************************************
+ *		IsValidInterface	[OLE32.@]
+ *
+ * Determines whether a pointer is a valid interface.
+ *
+ * PARAMS
+ *  punk [I] Interface to be tested.
+ *
+ * RETURNS
+ *  TRUE, if the passed pointer is a valid interface, or FALSE otherwise.
+ */
+BOOL WINAPI IsValidInterface(LPUNKNOWN punk)
+{
+	return !(IsBadReadPtr(punk,4) ||
+                 IsBadReadPtr(punk->lpVtbl,4) ||
+                 IsBadReadPtr(punk->lpVtbl->QueryInterface,9) ||
+                 IsBadCodePtr((FARPROC)punk->lpVtbl->QueryInterface));
+}




More information about the wine-cvs mailing list