Commit 7879b8e3 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Get rid of the RegisterClipboardFormat driver entry point.

parent 59fb0ad1
...@@ -213,28 +213,18 @@ static HWND CLIPBOARD_SetClipboardViewer( HWND hWnd ) ...@@ -213,28 +213,18 @@ static HWND CLIPBOARD_SetClipboardViewer( HWND hWnd )
/************************************************************************** /**************************************************************************
* RegisterClipboardFormatW (USER32.@) * RegisterClipboardFormatW (USER32.@)
*/ */
UINT WINAPI RegisterClipboardFormatW(LPCWSTR FormatName) UINT WINAPI RegisterClipboardFormatW( LPCWSTR name )
{ {
return USER_Driver->pRegisterClipboardFormat(FormatName); return GlobalAddAtomW( name );
} }
/************************************************************************** /**************************************************************************
* RegisterClipboardFormatA (USER32.@) * RegisterClipboardFormatA (USER32.@)
*/ */
UINT WINAPI RegisterClipboardFormatA(LPCSTR formatName) UINT WINAPI RegisterClipboardFormatA( LPCSTR name )
{ {
int len; return GlobalAddAtomA( name );
LPWSTR wFormat;
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;
} }
......
...@@ -98,7 +98,6 @@ static const USER_DRIVER *load_driver(void) ...@@ -98,7 +98,6 @@ static const USER_DRIVER *load_driver(void)
GET_USER_FUNC(CountClipboardFormats); GET_USER_FUNC(CountClipboardFormats);
GET_USER_FUNC(EnumClipboardFormats); GET_USER_FUNC(EnumClipboardFormats);
GET_USER_FUNC(IsClipboardFormatAvailable); GET_USER_FUNC(IsClipboardFormatAvailable);
GET_USER_FUNC(RegisterClipboardFormat);
GET_USER_FUNC(EndClipboardUpdate); GET_USER_FUNC(EndClipboardUpdate);
GET_USER_FUNC(ChangeDisplaySettingsEx); GET_USER_FUNC(ChangeDisplaySettingsEx);
GET_USER_FUNC(EnumDisplayMonitors); GET_USER_FUNC(EnumDisplayMonitors);
...@@ -279,11 +278,6 @@ static BOOL CDECL nulldrv_IsClipboardFormatAvailable( UINT format ) ...@@ -279,11 +278,6 @@ static BOOL CDECL nulldrv_IsClipboardFormatAvailable( UINT format )
return FALSE; return FALSE;
} }
static UINT CDECL nulldrv_RegisterClipboardFormat( LPCWSTR name )
{
return 0;
}
static BOOL CDECL nulldrv_SetClipboardData( UINT format, HANDLE handle, BOOL owner ) static BOOL CDECL nulldrv_SetClipboardData( UINT format, HANDLE handle, BOOL owner )
{ {
return FALSE; return FALSE;
...@@ -457,7 +451,6 @@ static USER_DRIVER null_driver = ...@@ -457,7 +451,6 @@ static USER_DRIVER null_driver =
nulldrv_EnumClipboardFormats, nulldrv_EnumClipboardFormats,
nulldrv_GetClipboardData, nulldrv_GetClipboardData,
nulldrv_IsClipboardFormatAvailable, nulldrv_IsClipboardFormatAvailable,
nulldrv_RegisterClipboardFormat,
nulldrv_SetClipboardData, nulldrv_SetClipboardData,
/* display modes */ /* display modes */
nulldrv_ChangeDisplaySettingsEx, nulldrv_ChangeDisplaySettingsEx,
...@@ -626,11 +619,6 @@ static BOOL CDECL loaderdrv_IsClipboardFormatAvailable( UINT format ) ...@@ -626,11 +619,6 @@ static BOOL CDECL loaderdrv_IsClipboardFormatAvailable( UINT format )
return load_driver()->pIsClipboardFormatAvailable( format ); return load_driver()->pIsClipboardFormatAvailable( format );
} }
static UINT CDECL loaderdrv_RegisterClipboardFormat( LPCWSTR name )
{
return load_driver()->pRegisterClipboardFormat( name );
}
static BOOL CDECL loaderdrv_SetClipboardData( UINT format, HANDLE handle, BOOL owner ) static BOOL CDECL loaderdrv_SetClipboardData( UINT format, HANDLE handle, BOOL owner )
{ {
return load_driver()->pSetClipboardData( format, handle, owner ); return load_driver()->pSetClipboardData( format, handle, owner );
...@@ -798,7 +786,6 @@ static USER_DRIVER lazy_load_driver = ...@@ -798,7 +786,6 @@ static USER_DRIVER lazy_load_driver =
loaderdrv_EnumClipboardFormats, loaderdrv_EnumClipboardFormats,
loaderdrv_GetClipboardData, loaderdrv_GetClipboardData,
loaderdrv_IsClipboardFormatAvailable, loaderdrv_IsClipboardFormatAvailable,
loaderdrv_RegisterClipboardFormat,
loaderdrv_SetClipboardData, loaderdrv_SetClipboardData,
/* display modes */ /* display modes */
loaderdrv_ChangeDisplaySettingsEx, loaderdrv_ChangeDisplaySettingsEx,
......
...@@ -183,6 +183,9 @@ todo_wine ...@@ -183,6 +183,9 @@ todo_wine
ok(!EmptyClipboard(), "EmptyClipboard should fail if clipboard wasn't open\n"); ok(!EmptyClipboard(), "EmptyClipboard should fail if clipboard wasn't open\n");
ok(GetLastError() == ERROR_CLIPBOARD_NOT_OPEN || broken(GetLastError() == 0xdeadbeef), /* wow64 */ ok(GetLastError() == ERROR_CLIPBOARD_NOT_OPEN || broken(GetLastError() == 0xdeadbeef), /* wow64 */
"Wrong error %u\n", GetLastError()); "Wrong error %u\n", GetLastError());
format_id = RegisterClipboardFormatA("#1234");
ok(format_id == 1234, "invalid clipboard format id %04x\n", format_id);
} }
static HGLOBAL create_text(void) static HGLOBAL create_text(void)
......
...@@ -82,7 +82,6 @@ typedef struct tagUSER_DRIVER { ...@@ -82,7 +82,6 @@ typedef struct tagUSER_DRIVER {
UINT (CDECL *pEnumClipboardFormats)(UINT); /* Enumerate clipboard formats */ UINT (CDECL *pEnumClipboardFormats)(UINT); /* Enumerate clipboard formats */
HANDLE (CDECL *pGetClipboardData)(UINT); /* Get specified selection data */ HANDLE (CDECL *pGetClipboardData)(UINT); /* Get specified selection data */
BOOL (CDECL *pIsClipboardFormatAvailable)(UINT); /* Check if specified format is available */ BOOL (CDECL *pIsClipboardFormatAvailable)(UINT); /* Check if specified format is available */
UINT (CDECL *pRegisterClipboardFormat)(LPCWSTR); /* Register a clipboard format */
BOOL (CDECL *pSetClipboardData)(UINT, HANDLE, BOOL); /* Set specified selection data */ BOOL (CDECL *pSetClipboardData)(UINT, HANDLE, BOOL); /* Set specified selection data */
/* display modes */ /* display modes */
LONG (CDECL *pChangeDisplaySettingsEx)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID); LONG (CDECL *pChangeDisplaySettingsEx)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
......
...@@ -2481,18 +2481,6 @@ static BOOL X11DRV_CLIPBOARD_IsSelectionOwner(void) ...@@ -2481,18 +2481,6 @@ static BOOL X11DRV_CLIPBOARD_IsSelectionOwner(void)
**************************************************************************/ **************************************************************************/
/**************************************************************************
* RegisterClipboardFormat (X11DRV.@)
*
* Registers a custom X clipboard format
* Returns: Format id or 0 on failure
*/
UINT CDECL X11DRV_RegisterClipboardFormat(LPCWSTR FormatName)
{
return GlobalAddAtomW( FormatName );
}
static void selection_acquire(void) static void selection_acquire(void)
{ {
Window owner; Window owner;
......
...@@ -94,7 +94,6 @@ ...@@ -94,7 +94,6 @@
@ cdecl GetDC(long long long ptr ptr long) X11DRV_GetDC @ cdecl GetDC(long long long ptr ptr long) X11DRV_GetDC
@ cdecl IsClipboardFormatAvailable(long) X11DRV_IsClipboardFormatAvailable @ cdecl IsClipboardFormatAvailable(long) X11DRV_IsClipboardFormatAvailable
@ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) X11DRV_MsgWaitForMultipleObjectsEx @ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) X11DRV_MsgWaitForMultipleObjectsEx
@ cdecl RegisterClipboardFormat(wstr) X11DRV_RegisterClipboardFormat
@ cdecl ReleaseDC(long long) X11DRV_ReleaseDC @ cdecl ReleaseDC(long long) X11DRV_ReleaseDC
@ cdecl ScrollDC(long long long ptr ptr long ptr) X11DRV_ScrollDC @ cdecl ScrollDC(long long long ptr ptr long ptr) X11DRV_ScrollDC
@ cdecl SetClipboardData(long long long) X11DRV_SetClipboardData @ cdecl SetClipboardData(long long long) X11DRV_SetClipboardData
......
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