user32: Get rid of the RegisterClipboardFormat driver entry point.

This commit is contained in:
Alexandre Julliard 2011-03-07 17:05:32 +01:00
parent 59fb0ad174
commit 7879b8e349
6 changed files with 7 additions and 41 deletions

View File

@ -213,28 +213,18 @@ static HWND CLIPBOARD_SetClipboardViewer( HWND hWnd )
/**************************************************************************
* RegisterClipboardFormatW (USER32.@)
*/
UINT WINAPI RegisterClipboardFormatW(LPCWSTR FormatName)
UINT WINAPI RegisterClipboardFormatW( LPCWSTR name )
{
return USER_Driver->pRegisterClipboardFormat(FormatName);
return GlobalAddAtomW( name );
}
/**************************************************************************
* RegisterClipboardFormatA (USER32.@)
*/
UINT WINAPI RegisterClipboardFormatA(LPCSTR formatName)
UINT WINAPI RegisterClipboardFormatA( LPCSTR name )
{
int len;
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;
return GlobalAddAtomA( name );
}

View File

@ -98,7 +98,6 @@ static const USER_DRIVER *load_driver(void)
GET_USER_FUNC(CountClipboardFormats);
GET_USER_FUNC(EnumClipboardFormats);
GET_USER_FUNC(IsClipboardFormatAvailable);
GET_USER_FUNC(RegisterClipboardFormat);
GET_USER_FUNC(EndClipboardUpdate);
GET_USER_FUNC(ChangeDisplaySettingsEx);
GET_USER_FUNC(EnumDisplayMonitors);
@ -279,11 +278,6 @@ static BOOL CDECL nulldrv_IsClipboardFormatAvailable( UINT format )
return FALSE;
}
static UINT CDECL nulldrv_RegisterClipboardFormat( LPCWSTR name )
{
return 0;
}
static BOOL CDECL nulldrv_SetClipboardData( UINT format, HANDLE handle, BOOL owner )
{
return FALSE;
@ -457,7 +451,6 @@ static USER_DRIVER null_driver =
nulldrv_EnumClipboardFormats,
nulldrv_GetClipboardData,
nulldrv_IsClipboardFormatAvailable,
nulldrv_RegisterClipboardFormat,
nulldrv_SetClipboardData,
/* display modes */
nulldrv_ChangeDisplaySettingsEx,
@ -626,11 +619,6 @@ static BOOL CDECL loaderdrv_IsClipboardFormatAvailable( UINT 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 )
{
return load_driver()->pSetClipboardData( format, handle, owner );
@ -798,7 +786,6 @@ static USER_DRIVER lazy_load_driver =
loaderdrv_EnumClipboardFormats,
loaderdrv_GetClipboardData,
loaderdrv_IsClipboardFormatAvailable,
loaderdrv_RegisterClipboardFormat,
loaderdrv_SetClipboardData,
/* display modes */
loaderdrv_ChangeDisplaySettingsEx,

View File

@ -183,6 +183,9 @@ todo_wine
ok(!EmptyClipboard(), "EmptyClipboard should fail if clipboard wasn't open\n");
ok(GetLastError() == ERROR_CLIPBOARD_NOT_OPEN || broken(GetLastError() == 0xdeadbeef), /* wow64 */
"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)

View File

@ -82,7 +82,6 @@ typedef struct tagUSER_DRIVER {
UINT (CDECL *pEnumClipboardFormats)(UINT); /* Enumerate clipboard formats */
HANDLE (CDECL *pGetClipboardData)(UINT); /* Get specified selection data */
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 */
/* display modes */
LONG (CDECL *pChangeDisplaySettingsEx)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);

View File

@ -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)
{
Window owner;

View File

@ -94,7 +94,6 @@
@ cdecl GetDC(long long long ptr ptr long) X11DRV_GetDC
@ cdecl IsClipboardFormatAvailable(long) X11DRV_IsClipboardFormatAvailable
@ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) X11DRV_MsgWaitForMultipleObjectsEx
@ cdecl RegisterClipboardFormat(wstr) X11DRV_RegisterClipboardFormat
@ cdecl ReleaseDC(long long) X11DRV_ReleaseDC
@ cdecl ScrollDC(long long long ptr ptr long ptr) X11DRV_ScrollDC
@ cdecl SetClipboardData(long long long) X11DRV_SetClipboardData