Alexandre Julliard : user: Make a lot of winproc functions static.
Alexandre Julliard
julliard at wine.codeweavers.com
Sat May 20 11:22:38 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 917d03bd045e1d1167b5392a50609052c06ab340
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=917d03bd045e1d1167b5392a50609052c06ab340
Author: Alexandre Julliard <julliard at winehq.org>
Date: Sat May 20 16:36:52 2006 +0200
user: Make a lot of winproc functions static.
---
dlls/user/winproc.c | 72 +++++++++++++++++++++++++++++++++++++++++---------
dlls/user/winproc.h | 73 ---------------------------------------------------
2 files changed, 59 insertions(+), 86 deletions(-)
diff --git a/dlls/user/winproc.c b/dlls/user/winproc.c
index 39f914c..21f1375 100644
--- a/dlls/user/winproc.c
+++ b/dlls/user/winproc.c
@@ -67,6 +67,53 @@ static CRITICAL_SECTION_DEBUG critsect_d
};
static CRITICAL_SECTION winproc_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
+typedef struct
+{
+ WPARAM16 wParam;
+ LPARAM lParam;
+ LRESULT lResult;
+} MSGPARAM16;
+
+/* map a Unicode string to a 16-bit pointer */
+inline static SEGPTR map_str_32W_to_16( LPCWSTR str )
+{
+ LPSTR ret;
+ INT len;
+
+ if (!HIWORD(str)) return (SEGPTR)LOWORD(str);
+ len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL );
+ if ((ret = HeapAlloc( GetProcessHeap(), 0, len )))
+ WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
+ return MapLS(ret);
+}
+
+/* unmap a Unicode string that was converted to a 16-bit pointer */
+inline static void unmap_str_32W_to_16( SEGPTR str )
+{
+ if (!HIWORD(str)) return;
+ HeapFree( GetProcessHeap(), 0, MapSL(str) );
+ UnMapLS( str );
+}
+
+/* map a 16-bit pointer to a Unicode string */
+inline static LPWSTR map_str_16_to_32W( SEGPTR str )
+{
+ LPWSTR ret;
+ INT len;
+
+ if (!HIWORD(str)) return (LPWSTR)(ULONG_PTR)LOWORD(str);
+ len = MultiByteToWideChar( CP_ACP, 0, MapSL(str), -1, NULL, 0 );
+ if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
+ MultiByteToWideChar( CP_ACP, 0, MapSL(str), -1, ret, len );
+ return ret;
+}
+
+/* unmap a 16-bit pointer that was converted to a Unicode string */
+inline static void unmap_str_16_to_32W( LPCWSTR str )
+{
+ if (HIWORD(str)) HeapFree( GetProcessHeap(), 0, (void *)str );
+}
+
/* find an existing winproc for a given 16-bit function and type */
/* FIXME: probably should do something more clever than a linear search */
static inline WINDOWPROC *find_winproc16( WNDPROC16 func )
@@ -1367,8 +1414,8 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UI
*
* Unmap a message that was mapped from 16- to 32-bit Ansi.
*/
-LRESULT WINPROC_UnmapMsg16To32A( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
- LRESULT result )
+static LRESULT WINPROC_UnmapMsg16To32A( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
+ LRESULT result )
{
switch(msg)
{
@@ -1485,8 +1532,8 @@ LRESULT WINPROC_UnmapMsg16To32A( HWND hw
* Map a message from 16- to 32-bit Unicode.
* Return value is -1 on error, 0 if OK, 1 if an UnmapMsg call is needed.
*/
-INT WINPROC_MapMsg16To32W( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pmsg32,
- WPARAM *pwparam32, LPARAM *plparam )
+static INT WINPROC_MapMsg16To32W( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pmsg32,
+ WPARAM *pwparam32, LPARAM *plparam )
{
*pmsg32=(UINT)msg16;
*pwparam32 = (WPARAM)wParam16;
@@ -1603,8 +1650,8 @@ INT WINPROC_MapMsg16To32W( HWND hwnd, UI
*
* Unmap a message that was mapped from 16- to 32-bit Unicode.
*/
-LRESULT WINPROC_UnmapMsg16To32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
- LRESULT result, WNDPROC dispatch )
+static LRESULT WINPROC_UnmapMsg16To32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
+ LRESULT result, WNDPROC dispatch )
{
switch(msg)
{
@@ -2233,8 +2280,8 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UI
*
* Unmap a message that was mapped from 32-bit Ansi to 16-bit.
*/
-void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
- MSGPARAM16* p16 )
+static void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
+ MSGPARAM16* p16 )
{
switch(msg)
{
@@ -2442,9 +2489,8 @@ void WINPROC_UnmapMsg32ATo16( HWND hwnd,
* Map a message from 32-bit Unicode to 16-bit.
* Return value is -1 on error, 0 if OK, 1 if an UnmapMsg call is needed.
*/
-INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32, WPARAM wParam32,
- UINT16 *pmsg16, WPARAM16 *pwparam16,
- LPARAM *plparam )
+static INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32, WPARAM wParam32,
+ UINT16 *pmsg16, WPARAM16 *pwparam16, LPARAM *plparam )
{
*pmsg16 = LOWORD(msg32);
*pwparam16 = LOWORD(wParam32);
@@ -2558,8 +2604,8 @@ INT WINPROC_MapMsg32WTo16( HWND hwnd, UI
*
* Unmap a message that was mapped from 32-bit Unicode to 16-bit.
*/
-void WINPROC_UnmapMsg32WTo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
- MSGPARAM16* p16 )
+static void WINPROC_UnmapMsg32WTo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
+ MSGPARAM16* p16 )
{
switch(msg)
{
diff --git a/dlls/user/winproc.h b/dlls/user/winproc.h
index 4bbc6f3..53ebb94 100644
--- a/dlls/user/winproc.h
+++ b/dlls/user/winproc.h
@@ -26,23 +26,6 @@ #include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wine/winbase16.h"
-#include "winnls.h"
-
-typedef struct
-{
- WPARAM16 wParam;
- LPARAM lParam;
- LRESULT lResult;
-} MSGPARAM16;
-
-typedef struct
-{
- WPARAM wParam;
- LPARAM lParam;
- LRESULT lResult;
-} MSGPARAM;
-
-struct tagWINDOWPROC;
typedef LRESULT (*winproc_callback_t)( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
LRESULT *result, void *arg );
@@ -65,70 +48,14 @@ extern LRESULT WINPROC_CallProc32ATo16(
extern INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16,
UINT *pmsg32, WPARAM *pwparam32,
LPARAM *plparam );
-extern INT WINPROC_MapMsg16To32W( HWND hwnd, UINT16 msg16, WPARAM16 wParam16,
- UINT *pmsg32, WPARAM *pwparam32,
- LPARAM *plparam );
extern INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32,
WPARAM wParam32, UINT16 *pmsg16,
WPARAM16 *pwparam16, LPARAM *plparam );
-extern INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32,
- WPARAM wParam32, UINT16 *pmsg16,
- WPARAM16 *pwparam16, LPARAM *plparam );
-extern LRESULT WINPROC_UnmapMsg16To32A( HWND hwnd, UINT msg, WPARAM wParam,
- LPARAM lParam, LRESULT result );
-extern LRESULT WINPROC_UnmapMsg16To32W( HWND hwnd, UINT msg, WPARAM wParam,
- LPARAM lParam, LRESULT result,
- WNDPROC dispatch );
-extern void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam,
- LPARAM lParam, MSGPARAM16* pm16 );
-extern void WINPROC_UnmapMsg32WTo16( HWND hwnd, UINT msg, WPARAM wParam,
- LPARAM lParam, MSGPARAM16* pm16 );
extern INT_PTR WINPROC_CallDlgProc16( DLGPROC16 func, HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam );
extern INT_PTR WINPROC_CallDlgProcA( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
extern INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
-/* map a Unicode string to a 16-bit pointer */
-inline static SEGPTR map_str_32W_to_16( LPCWSTR str )
-{
- LPSTR ret;
- INT len;
-
- if (!HIWORD(str)) return (SEGPTR)LOWORD(str);
- len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL );
- if ((ret = HeapAlloc( GetProcessHeap(), 0, len )))
- WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
- return MapLS(ret);
-}
-
-/* unmap a Unicode string that was converted to a 16-bit pointer */
-inline static void unmap_str_32W_to_16( SEGPTR str )
-{
- if (!HIWORD(str)) return;
- HeapFree( GetProcessHeap(), 0, MapSL(str) );
- UnMapLS( str );
-}
-
-/* map a 16-bit pointer to a Unicode string */
-inline static LPWSTR map_str_16_to_32W( SEGPTR str )
-{
- LPWSTR ret;
- INT len;
-
- if (!HIWORD(str)) return (LPWSTR)(ULONG_PTR)LOWORD(str);
- len = MultiByteToWideChar( CP_ACP, 0, MapSL(str), -1, NULL, 0 );
- if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
- MultiByteToWideChar( CP_ACP, 0, MapSL(str), -1, ret, len );
- return ret;
-}
-
-/* unmap a 16-bit pointer that was converted to a Unicode string */
-inline static void unmap_str_16_to_32W( LPCWSTR str )
-{
- if (HIWORD(str)) HeapFree( GetProcessHeap(), 0, (void *)str );
-}
-
-
/* Class functions */
struct tagCLASS; /* opaque structure */
struct tagWND;
More information about the wine-cvs
mailing list