wintrust(3/10): Move mem alloc functions to wintrust_main.c

Juan Lang juan.lang at gmail.com
Mon Aug 27 18:34:48 CDT 2007


--Juan
-------------- next part --------------
From 0a5b6c604502a2b9355eebedd7adfd51a4257e07 Mon Sep 17 00:00:00 2001
From: Juan Lang <juanlang at juan.corp.google.com>
Date: Mon, 27 Aug 2007 16:19:36 -0700
Subject: [PATCH] Move mem alloc functions to wintrust_main.c
---
 dlls/wintrust/register.c      |   12 +-----------
 dlls/wintrust/wintrust_main.c |   19 ++++++++++++++++++-
 dlls/wintrust/wintrust_priv.h |   25 +++++++++++++++++++++++++
 3 files changed, 44 insertions(+), 12 deletions(-)

diff --git a/dlls/wintrust/register.c b/dlls/wintrust/register.c
index 517359f..6d425c8 100644
--- a/dlls/wintrust/register.c
+++ b/dlls/wintrust/register.c
@@ -31,7 +31,7 @@ #include "guiddef.h"
 #include "wintrust.h"
 #include "softpub.h"
 #include "mssip.h"
-
+#include "wintrust_priv.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(wintrust);
@@ -812,16 +812,6 @@ error_close_key:
     return Func;
 }
 
-static void * WINAPI WINTRUST_Alloc(DWORD cb)
-{
-    return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb);
-}
-
-static void WINAPI WINTRUST_Free(void *p)
-{
-    HeapFree(GetProcessHeap(), 0, p);
-}
-
 /***********************************************************************
  *              WintrustLoadFunctionPointers (WINTRUST.@)
  */
diff --git a/dlls/wintrust/wintrust_main.c b/dlls/wintrust/wintrust_main.c
index 5e025d9..6b855a6 100644
--- a/dlls/wintrust/wintrust_main.c
+++ b/dlls/wintrust/wintrust_main.c
@@ -29,7 +29,7 @@ #include "wintrust.h"
 #include "softpub.h"
 #include "mscat.h"
 #include "objbase.h"
-
+#include "wintrust_priv.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(wintrust);
@@ -214,3 +214,20 @@ BOOL WINAPI WintrustSetRegPolicyFlags( D
     if (r) SetLastError(r);
     return r == ERROR_SUCCESS;
 }
+
+/* Utility functions */
+void * WINAPI WINTRUST_Alloc(DWORD cb)
+{
+    return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb);
+}
+
+void * WINAPI WINTRUST_ReAlloc(void *ptr, DWORD cb)
+{
+    return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ptr, cb);
+}
+
+void WINAPI WINTRUST_Free(void *p)
+{
+    HeapFree(GetProcessHeap(), 0, p);
+}
+
diff --git a/dlls/wintrust/wintrust_priv.h b/dlls/wintrust/wintrust_priv.h
new file mode 100644
index 0000000..dc6a873
--- /dev/null
+++ b/dlls/wintrust/wintrust_priv.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2007 Juan Lang
+ *
+ * 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
+ */
+#ifndef __WINTRUST_PRIV_H__
+#define __WINTRUST_PRIV_H__
+
+void * WINAPI WINTRUST_Alloc(DWORD cb);
+void * WINAPI WINTRUST_ReAlloc(void *ptr, DWORD cb);
+void WINAPI WINTRUST_Free(void *p);
+
+#endif /* ndef __WINTRUST_PRIV_H__ */
-- 
1.4.1


More information about the wine-patches mailing list