user32: Return a proper NTSTATUS in the post DDE message callback.
This commit is contained in:
parent
d06192afe9
commit
621bcd0db2
3 changed files with 15 additions and 26 deletions
|
@ -333,7 +333,7 @@ static HGLOBAL dde_get_pair(HGLOBAL shm)
|
|||
*
|
||||
* Post a DDE message
|
||||
*/
|
||||
BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid, DWORD type )
|
||||
NTSTATUS post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid, DWORD type )
|
||||
{
|
||||
void* ptr = NULL;
|
||||
int size = 0;
|
||||
|
@ -344,7 +344,7 @@ BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD
|
|||
ULONGLONG hpack;
|
||||
|
||||
if (!UnpackDDElParam( msg, lparam, &uiLo, &uiHi ))
|
||||
return FALSE;
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
lp = lparam;
|
||||
switch (msg)
|
||||
|
@ -386,9 +386,9 @@ BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD
|
|||
if ((msg == WM_DDE_ADVISE && size < sizeof(DDEADVISE)) ||
|
||||
(msg == WM_DDE_DATA && size < FIELD_OFFSET(DDEDATA, Value)) ||
|
||||
(msg == WM_DDE_POKE && size < FIELD_OFFSET(DDEPOKE, Value)))
|
||||
return FALSE;
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
else if (msg != WM_DDE_DATA) return FALSE;
|
||||
else if (msg != WM_DDE_DATA) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
lp = uiHi;
|
||||
if (uiLo)
|
||||
|
@ -428,21 +428,12 @@ BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD
|
|||
req->lparam = lp;
|
||||
req->timeout = TIMEOUT_INFINITE;
|
||||
if (size) wine_server_add_data( req, ptr, size );
|
||||
if ((res = wine_server_call( req )))
|
||||
{
|
||||
if (res == STATUS_INVALID_PARAMETER)
|
||||
/* FIXME: find a STATUS_ value for this one */
|
||||
SetLastError( ERROR_INVALID_THREAD_ID );
|
||||
else
|
||||
SetLastError( RtlNtStatusToDosError(res) );
|
||||
}
|
||||
else
|
||||
FreeDDElParam( msg, lparam );
|
||||
if (!(res = wine_server_call( req ))) FreeDDElParam( msg, lparam );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
if (hunlock) GlobalUnlock(hunlock);
|
||||
|
||||
return !res;
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
|
@ -45,8 +45,8 @@ struct wm_char_mapping_data
|
|||
|
||||
extern HMODULE user32_module;
|
||||
|
||||
extern BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid,
|
||||
DWORD type );
|
||||
extern NTSTATUS post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid,
|
||||
DWORD type );
|
||||
extern BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
|
||||
const void *buffer, size_t size );
|
||||
extern void free_cached_data( UINT format, HANDLE handle );
|
||||
|
|
|
@ -3299,7 +3299,8 @@ static BOOL put_message_in_queue( const struct send_message_info *info, size_t *
|
|||
params.lparam = info->lparam;
|
||||
params.dest_tid = info->dest_tid;
|
||||
params.type = info->type;
|
||||
return KeUserModeCallback( NtUserPostDDEMessage, ¶ms, sizeof(params), &ret_ptr, &ret_len );
|
||||
res = KeUserModeCallback( NtUserPostDDEMessage, ¶ms, sizeof(params), &ret_ptr, &ret_len );
|
||||
goto done;
|
||||
}
|
||||
|
||||
SERVER_START_REQ( send_message )
|
||||
|
@ -3315,16 +3316,13 @@ static BOOL put_message_in_queue( const struct send_message_info *info, size_t *
|
|||
|
||||
if (info->flags & SMTO_ABORTIFHUNG) req->flags |= SEND_MSG_ABORT_IF_HUNG;
|
||||
for (i = 0; i < data.count; i++) wine_server_add_data( req, data.data[i], data.size[i] );
|
||||
if ((res = wine_server_call( req )))
|
||||
{
|
||||
if (res == STATUS_INVALID_PARAMETER)
|
||||
/* FIXME: find a STATUS_ value for this one */
|
||||
RtlSetLastWin32Error( ERROR_INVALID_THREAD_ID );
|
||||
else
|
||||
RtlSetLastWin32Error( RtlNtStatusToDosError(res) );
|
||||
}
|
||||
res = wine_server_call( req );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
|
||||
done:
|
||||
if (res == STATUS_INVALID_PARAMETER) res = STATUS_NO_LDT;
|
||||
if (res) RtlSetLastWin32Error( RtlNtStatusToDosError(res) );
|
||||
return !res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue