Implemented DIGDD_PEEK for SysMouseA::GetDeviceData.

This commit is contained in:
Marcus Meissner 2000-12-19 02:10:26 +00:00 committed by Alexandre Julliard
parent 89c476f9d6
commit d88dbb4a10
1 changed files with 13 additions and 10 deletions

View File

@ -630,21 +630,19 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceData(LPDIRECTINPUTDEVICE2A iface,
DWORD flags
) {
ICOM_THIS(SysMouseAImpl,iface);
DWORD nqpos = 0;
EnterCriticalSection(&(This->crit));
TRACE("(%p)->(dods=%ld,entries=%ld,fl=0x%08lx)\n",This,dodsize,*entries,flags);
if (flags & DIGDD_PEEK)
FIXME("DIGDD_PEEK\n");
TRACE("(%p)->(dods=%ld,dod=%p,entries=%ld,fl=0x%08lx)\n",This,dodsize,dod,*entries,flags);
if (dod == NULL) {
*entries = This->queue_pos;
This->queue_pos = 0;
nqpos = 0;
} else {
/* Check for buffer overflow */
if (This->queue_pos > *entries) {
WARN("Buffer overflow not handled properly yet...\n");
This->queue_pos = *entries;
if (This->queue_pos > dodsize) {
FIXME("Buffer overflow not handled properly yet...\n");
This->queue_pos = dodsize;
}
if (dodsize != sizeof(DIDEVICEOBJECTDATA)) {
ERR("Wrong structure size !\n");
@ -660,10 +658,15 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceData(LPDIRECTINPUTDEVICE2A iface,
*entries = This->queue_pos;
/* Reset the event queue */
This->queue_pos = 0;
nqpos = 0;
}
if (!(flags & DIGDD_PEEK))
This->queue_pos = nqpos;
LeaveCriticalSection(&(This->crit));
TRACE("returing *entries = %ld\n",*entries);
/* Check if we need to do a mouse warping */
if (This->need_warp == WARP_NEEDED) {
POINT point;