- Timestamp:
- May 15, 2002, 12:58:07 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dinput/mouse.c
r8348 r8416 117 117 CRITICAL_SECTION crit; 118 118 119 #ifdef __WIN32OS2__ 120 char hookcode[32]; 121 #endif 122 119 123 /* This is for mouse reporting. */ 120 124 Wine_InternalMouseData m_state; … … 218 222 ICOM_THIS(SysMouseAImpl,iface); 219 223 224 #ifdef __WIN32OS2__ 225 dprintf(("SysMouseAImpl_Release %x", This)); 226 #endif 227 220 228 This->ref--; 221 229 if (This->ref) … … 316 324 317 325 /* low-level mouse hook */ 326 #ifdef __WIN32OS2__ 327 static LRESULT CALLBACK dinput_mouse_hook(SysMouseAImpl* This, int code, WPARAM wparam, LPARAM lparam ) 328 #else 318 329 static LRESULT CALLBACK dinput_mouse_hook( int code, WPARAM wparam, LPARAM lparam ) 330 #endif 319 331 { 320 332 LRESULT ret; 321 333 MSLLHOOKSTRUCT *hook = (MSLLHOOKSTRUCT *)lparam; 334 #ifndef __WIN32OS2__ 322 335 SysMouseAImpl* This = (SysMouseAImpl*) current_lock; 336 #endif 323 337 324 338 //testestest … … 440 454 ICOM_THIS(SysMouseAImpl,iface); 441 455 RECT rect; 442 456 457 #ifdef __WIN32OS2__ 458 dprintf(("SysMouseAImpl_Acquire %x", This)); 459 #else 443 460 TRACE("(this=%p)\n",This); 444 461 #endif 445 462 if (This->acquired == 0) { 446 463 POINT point; … … 465 482 466 483 /* Install our mouse hook */ 484 #ifdef __WIN32OS2__ 485 //push ebp 486 This->hookcode[0] = 0x55; 487 //mov ebp, esp 488 This->hookcode[1] = 0x8B; This->hookcode[2] = 0xEC; 489 //push [ebp+16] 490 This->hookcode[3] = 0xFF; This->hookcode[4] = 0x75; This->hookcode[5] = 0x10; 491 //push [ebp+12] 492 This->hookcode[6] = 0xFF; This->hookcode[7] = 0x75; This->hookcode[8] = 0x0C; 493 //push [ebp+8] 494 This->hookcode[9] = 0xFF; This->hookcode[10] = 0x75; This->hookcode[11] = 0x08; 495 //push This 496 This->hookcode[12] = 0x68; *(DWORD *)&This->hookcode[13] = (DWORD)This; 497 //mov eax, dinput_mouse_hook 498 This->hookcode[17] = 0xB8; *(DWORD *)&This->hookcode[18] = (DWORD)&dinput_mouse_hook; 499 //call eax 500 This->hookcode[22] = 0xFF; This->hookcode[23] = 0xD0; 501 //pop ebp 502 This->hookcode[24] = 0x5D; 503 //ret 12 504 This->hookcode[25] = 0xC2; *(WORD *)&This->hookcode[26] = 0x000C; 505 506 This->hook = SetWindowsHookExW( WH_MOUSE_LL, (HOOKPROC)This->hookcode, 0, 0 ); 507 #else 467 508 This->hook = SetWindowsHookExW( WH_MOUSE_LL, dinput_mouse_hook, 0, 0 ); 509 #endif 468 510 469 511 /* Get the window dimension and find the center */ … … 472 514 This->win_centerY = (rect.bottom - rect.top ) / 2; 473 515 516 #ifndef __WIN32OS2__ 474 517 /* Warp the mouse to the center of the window */ 475 518 if (This->absolute == 0) { … … 485 528 #endif 486 529 } 487 530 #endif 488 531 This->acquired = 1; 489 532 } … … 498 541 ICOM_THIS(SysMouseAImpl,iface); 499 542 543 #ifdef __WIN32OS2__ 544 dprintf(("SysMouseAImpl_Unacquire %x", This)); 545 #else 500 546 TRACE("(this=%p)\n",This); 547 #endif 501 548 502 549 if (This->acquired)
Note:
See TracChangeset
for help on using the changeset viewer.