Commit 7e2a7c94 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

Get rid of W->A calls.

parent 8032418e
...@@ -87,9 +87,9 @@ typedef struct tagUSER_DRIVER { ...@@ -87,9 +87,9 @@ typedef struct tagUSER_DRIVER {
BOOL (*pEndClipboardUpdate)(void); /* End clipboard update */ BOOL (*pEndClipboardUpdate)(void); /* End clipboard update */
BOOL (*pEnumClipboardFormats)(UINT); /* Enumerate clipboard formats */ BOOL (*pEnumClipboardFormats)(UINT); /* Enumerate clipboard formats */
BOOL (*pGetClipboardData)(UINT, HANDLE16*, HANDLE*); /* Get specified selection data */ BOOL (*pGetClipboardData)(UINT, HANDLE16*, HANDLE*); /* Get specified selection data */
BOOL (*pGetClipboardFormatName)(UINT, LPSTR, UINT); /* Get a clipboard format name */ BOOL (*pGetClipboardFormatName)(UINT, LPWSTR, UINT); /* Get a clipboard format name */
BOOL (*pIsClipboardFormatAvailable)(UINT); /* Check if specified format is available */ BOOL (*pIsClipboardFormatAvailable)(UINT); /* Check if specified format is available */
INT (*pRegisterClipboardFormat)(LPCSTR); /* Register a clipboard format */ INT (*pRegisterClipboardFormat)(LPCWSTR); /* Register a clipboard format */
void (*pResetSelectionOwner)(HWND, BOOL); void (*pResetSelectionOwner)(HWND, BOOL);
BOOL (*pSetClipboardData)(UINT, HANDLE16, HANDLE, BOOL); /* Set specified selection data */ BOOL (*pSetClipboardData)(UINT, HANDLE16, HANDLE, BOOL); /* Set specified selection data */
/* display modes */ /* display modes */
......
...@@ -469,7 +469,7 @@ typedef HANDLE (*DRVIMPORTFUNC)(LPBYTE hData, UINT cBytes); ...@@ -469,7 +469,7 @@ typedef HANDLE (*DRVIMPORTFUNC)(LPBYTE hData, UINT cBytes);
typedef struct tagWINE_CLIPFORMAT { typedef struct tagWINE_CLIPFORMAT {
UINT wFormatID; UINT wFormatID;
LPSTR Name; LPCWSTR Name;
UINT drvData; UINT drvData;
UINT wFlags; UINT wFlags;
DRVIMPORTFUNC lpDrvImportFunc; DRVIMPORTFUNC lpDrvImportFunc;
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
#include "winerror.h" #include "winerror.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "heap.h"
#include "user_private.h" #include "user_private.h"
#include "win.h" #include "win.h"
...@@ -225,13 +224,13 @@ static BOOL CLIPBOARD_CloseClipboard(void) ...@@ -225,13 +224,13 @@ static BOOL CLIPBOARD_CloseClipboard(void)
**************************************************************************/ **************************************************************************/
/************************************************************************** /**************************************************************************
* RegisterClipboardFormatA (USER32.@) * RegisterClipboardFormatW (USER32.@)
*/ */
UINT WINAPI RegisterClipboardFormatA(LPCSTR FormatName) UINT WINAPI RegisterClipboardFormatW(LPCWSTR FormatName)
{ {
UINT wFormatID = 0; UINT wFormatID = 0;
TRACE("%s\n", debugstr_a(FormatName)); TRACE("%s\n", debugstr_w(FormatName));
if (USER_Driver.pRegisterClipboardFormat) if (USER_Driver.pRegisterClipboardFormat)
wFormatID = USER_Driver.pRegisterClipboardFormat(FormatName); wFormatID = USER_Driver.pRegisterClipboardFormat(FormatName);
...@@ -241,21 +240,28 @@ UINT WINAPI RegisterClipboardFormatA(LPCSTR FormatName) ...@@ -241,21 +240,28 @@ UINT WINAPI RegisterClipboardFormatA(LPCSTR FormatName)
/************************************************************************** /**************************************************************************
* RegisterClipboardFormatW (USER32.@) * RegisterClipboardFormatA (USER32.@)
*/ */
UINT WINAPI RegisterClipboardFormatW(LPCWSTR formatName) UINT WINAPI RegisterClipboardFormatA(LPCSTR formatName)
{ {
LPSTR aFormat = HEAP_strdupWtoA( GetProcessHeap(), 0, formatName ); int len;
UINT ret = RegisterClipboardFormatA( aFormat ); LPWSTR wFormat;
HeapFree( GetProcessHeap(), 0, aFormat ); UINT ret;
len = MultiByteToWideChar(CP_ACP, 0, formatName, -1, NULL, 0);
wFormat = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, formatName, -1, wFormat, len);
ret = RegisterClipboardFormatW(wFormat);
HeapFree(GetProcessHeap(), 0, wFormat);
return ret; return ret;
} }
/************************************************************************** /**************************************************************************
* GetClipboardFormatNameA (USER32.@) * GetClipboardFormatNameW (USER32.@)
*/ */
INT WINAPI GetClipboardFormatNameA(UINT wFormat, LPSTR retStr, INT maxlen) INT WINAPI GetClipboardFormatNameW(UINT wFormat, LPWSTR retStr, INT maxlen)
{ {
INT len = 0; INT len = 0;
...@@ -269,17 +275,17 @@ INT WINAPI GetClipboardFormatNameA(UINT wFormat, LPSTR retStr, INT maxlen) ...@@ -269,17 +275,17 @@ INT WINAPI GetClipboardFormatNameA(UINT wFormat, LPSTR retStr, INT maxlen)
/************************************************************************** /**************************************************************************
* GetClipboardFormatNameW (USER32.@) * GetClipboardFormatNameA (USER32.@)
*/ */
INT WINAPI GetClipboardFormatNameW(UINT wFormat, LPWSTR retStr, INT maxlen) INT WINAPI GetClipboardFormatNameA(UINT wFormat, LPSTR retStr, INT maxlen)
{ {
INT ret; INT ret;
LPSTR p = HeapAlloc( GetProcessHeap(), 0, maxlen ); LPWSTR p = HeapAlloc( GetProcessHeap(), 0, maxlen*sizeof(WCHAR) );
if(p == NULL) return 0; /* FIXME: is this the correct failure value? */ if(p == NULL) return 0; /* FIXME: is this the correct failure value? */
ret = GetClipboardFormatNameA( wFormat, p, maxlen ); ret = GetClipboardFormatNameW( wFormat, p, maxlen );
if (maxlen > 0 && !MultiByteToWideChar( CP_ACP, 0, p, -1, retStr, maxlen )) if (maxlen > 0 && !WideCharToMultiByte( CP_ACP, 0, p, -1, retStr, maxlen, 0, 0))
retStr[maxlen-1] = 0; retStr[maxlen-1] = 0;
HeapFree( GetProcessHeap(), 0, p ); HeapFree( GetProcessHeap(), 0, p );
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment