[v4 PATCH 2/5] ole32: Move IsValidInterface() to another file.

Nikolay Sivov nsivov at codeweavers.com
Wed Aug 5 00:54:58 CDT 2020


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/ole32/Makefile.in  |  1 -
 dlls/ole32/ifs.c        | 54 -----------------------------------------
 dlls/ole32/ole32_main.c | 21 ++++++++++++++++
 3 files changed, 21 insertions(+), 55 deletions(-)
 delete mode 100644 dlls/ole32/ifs.c

diff --git a/dlls/ole32/Makefile.in b/dlls/ole32/Makefile.in
index 4738407d7fd..86f13e188cf 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 845bdeea4a5..00000000000
--- 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 c38c525d5a6..e321afe3390 100644
--- a/dlls/ole32/ole32_main.c
+++ b/dlls/ole32/ole32_main.c
@@ -175,3 +175,24 @@ 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)
+	);
+}
-- 
2.27.0




More information about the wine-devel mailing list