- Timestamp:
- Jul 28, 2003, 1:35:32 PM (22 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmcomm.cpp
r10109 r10185 1 /* $Id: hmcomm.cpp,v 1. 39 2003-05-23 13:53:43sandervl Exp $ */1 /* $Id: hmcomm.cpp,v 1.40 2003-07-28 11:35:31 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 #include <os2win.h> 17 17 #include <string.h> 18 #include <stdio.h> 18 19 #include <handlemanager.h> 19 20 #include "handlenames.h" … … 64 65 static char *DebugCommEvent(DWORD dwEvents); 65 66 static char *DebugModemStatus(DWORD dwModemStatus); 67 #ifdef DEBUG_COMOUTPUT 68 static FILE *comlog = NULL; 69 #endif 66 70 #endif 67 71 //****************************************************************************** … … 117 121 HandleNamesAddSymbolicLink("AUX:", "COM1"); 118 122 HandleNamesAddSymbolicLink("\\\\.\\AUX", "COM1"); 123 #ifdef DEBUG_COMOUTPUT 124 comlog = fopen("comlog", "w"); 125 #endif 119 126 } 120 127 … … 229 236 return rc; 230 237 } 238 231 239 rc = SetBaud(pHMHandleData,9600); 232 240 dprintf(("Init Baud to 9600 rc = %d",rc)); … … 328 336 329 337 *lpdwResult = (ret) ? ulBytesRead : 0; 330 dprintf 2(("KERNEL32: CommReadIOHandler %d bytes read", *lpdwResult));338 dprintf(("KERNEL32: CommReadIOHandler %d bytes read", *lpdwResult)); 331 339 332 340 if(ret == FALSE) { … … 335 343 else { 336 344 #ifdef DEBUG 345 if(ulBytesRead < qInfo.cch) { 346 dprintf(("WARNING: Not all data removed from queue!!")); 347 } 337 348 dprintf2(("%d Bytes read:", ulBytesRead)); 338 349 for(int i=0;i<min(ulBytesRead, 16);i++) { … … 372 383 dprintf2(("KERNEL32:CommWriteIOHandler %d byte(s) written", *lpdwResult)); 373 384 385 if(ulBytesWritten != lpRequest->nNumberOfBytes) { 386 dprintf(("WARNING: ulBytesWritten (%d) != lpRequest->nNumberOfBytes (%d)", ulBytesWritten, lpRequest->nNumberOfBytes)); 387 } 374 388 if(ret == FALSE) { 375 389 dprintf(("!ERROR!: CommWriteIOHandler failed with rc %d", GetLastError())); … … 432 446 dwEvent |= (COMEvt&0x0100)? EV_RING:0; 433 447 448 #ifdef DEBUG 449 if(dwEvent & EV_ERR) { 450 ULONG COMErr = 0; 451 452 rc = OSLibDosDevIOCtl( pHMHandleData->hHMHandle, 453 IOCTL_ASYNC, 454 ASYNC_GETCOMMERROR, 455 0,0,0, 456 &COMErr,2,&ulLen); 457 458 dprintf(("!!!!!!!----> ERROR OCCURRED (EV_ERR) reason %x <-----!!!!!", COMErr)); 459 460 } 461 #endif 434 462 if((dwEvent & EV_RXCHAR) && (dwMask & EV_RXCHAR)) 435 463 { … … 509 537 } 510 538 539 #ifdef DEBUG 540 dprintf2(("WriteFile: bytes to write:")); 541 for(int i=0;i<min(nNumberOfBytesToWrite, 16);i++) { 542 dprintf2(("%x %c", ((char *)lpBuffer)[i], ((char *)lpBuffer)[i])); 543 } 544 #endif 545 511 546 if(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) { 512 547 return pDevData->iohandler->WriteFile(pHMHandleData->hWin32Handle, lpBuffer, nNumberOfBytesToWrite, … … 517 552 &ulBytesWritten); 518 553 519 if(lpNumberOfBytesWritten) { 554 if(lpNumberOfBytesWritten) { 520 555 *lpNumberOfBytesWritten = (ret) ? ulBytesWritten : 0; 521 556 dprintf2(("KERNEL32:HMDeviceCommClass::WriteFile %d byte(s) written", *lpNumberOfBytesWritten)); … … 593 628 *lpNumberOfBytesRead = (ret) ? ulBytesRead : 0; 594 629 dprintf2(("KERNEL32:HMDeviceCommClass::ReadFile %d bytes read", *lpNumberOfBytesRead)); 630 if(qInfo.cch > ulBytesRead) { 631 dprintf(("Warning: more bytes available!!")); 632 } 595 633 } 596 634 if(ret == FALSE) { … … 599 637 #ifdef DEBUG 600 638 else { 639 int i; 601 640 dprintf2(("%d Bytes read:", ulBytesRead)); 602 for(int i=0;i<min(ulBytesRead, 16);i++) { 641 #ifdef DEBUG_COMOUTPUT 642 char *tmp = (char *)malloc(ulBytesRead+1); 643 memcpy(tmp, lpBuffer, ulBytesRead); 644 tmp[ulBytesRead] = 0; 645 dprintf2(("RF: %s", tmp)); 646 WORD sel = RestoreOS2FS(); 647 for(i=0;i<ulBytesRead;i++) { 648 fprintf(comlog, "%c", tmp[i]); 649 } 650 SetFS(sel); 651 free(tmp); 652 #endif 653 for(i=0;i<ulBytesRead;i++) { 603 654 dprintf2(("%x %c", ((char *)lpBuffer)[i], ((char *)lpBuffer)[i])); 604 655 } … … 893 944 if(lpdwErrors == NULL) 894 945 lpdwErrors = &dwError; 895 946 896 947 dprintf(("HMDeviceCommClass::ClearCommError")); 897 948 ulLen = sizeof(USHORT); … … 908 959 *lpdwErrors |= (COMErr & 0x0008)?CE_FRAME:0; 909 960 961 dprintf(("Error %x", *lpdwErrors)); 910 962 if(lpcst) 911 963 { … … 1530 1582 pCurDCB->XoffChar = XoffChar; 1531 1583 pCurDCB->ErrorChar = ErrorChar; 1584 1585 dprintf(("OS/2 DCB:\n" 1586 " WriteTimeout : %d\n" 1587 " ReadTimeout : %d\n" 1588 " CtlHandshake : 0x%x\n" 1589 " FlowReplace : 0x%x\n" 1590 " Timeout : 0x%x\n" 1591 " Error replacement Char : 0x%x\n" 1592 " Break replacement Char : 0x%x\n" 1593 " XON Char : 0x%x\n" 1594 " XOFF Char : 0x%x\n", 1595 os2dcb.usWriteTimeout, 1596 os2dcb.usReadTimeout, 1597 os2dcb.fbCtlHndShake, 1598 os2dcb.fbFlowReplace, 1599 os2dcb.fbTimeOut, 1600 os2dcb.bErrorReplacementChar, 1601 os2dcb.bBreakReplacementChar, 1602 os2dcb.bXONChar, 1603 os2dcb.bXOFFChar)); 1604 1532 1605 } 1533 1606 -
trunk/src/kernel32/kernelrsrc.orc
r7832 r10185 1 /* $Id: kernelrsrc.orc,v 1. 3 2002-02-07 16:34:52sandervl Exp $ */1 /* $Id: kernelrsrc.orc,v 1.4 2003-07-28 11:35:31 sandervl Exp $ */ 2 2 3 3 #include "winuser.h" … … 42 42 43 43 #include "nls\locale_rc.rc" 44 #include "messages\winerr_enu.mc.rc" -
trunk/src/kernel32/message.cpp
r4502 r10185 1 /* $Id: message.cpp,v 1.1 3 2000-10-20 11:46:47sandervl Exp $ */1 /* $Id: message.cpp,v 1.14 2003-07-28 11:35:31 sandervl Exp $ */ 2 2 3 3 /* … … 60 60 DWORD offset; 61 61 } *se; 62 struct _stringentry { 63 WORD len; 64 WORD unknown; 65 CHAR str[1]; 66 } *stre; 62 MESSAGE_RESOURCE_ENTRY *stre; 67 63 68 64 /*FIXME: I am not sure about the '1' ... But I've only seen those entries*/ … … 78 74 for (i=nrofentries;i--;) { 79 75 if ((id>=se->firstentry) && (id<=se->lastentry)) { 80 stre = ( struct _stringentry*)(p+se->offset);76 stre = (PMESSAGE_RESOURCE_ENTRY)(p+se->offset); 81 77 id -= se->firstentry; 82 78 break; … … 87 83 return 0; 88 84 for (i=id;i--;) { 89 if (!(slen=stre-> len))85 if (!(slen=stre->Length)) 90 86 return 0; 91 stre = ( struct _stringentry*)(((char*)stre)+slen);87 stre = (PMESSAGE_RESOURCE_ENTRY)(((char*)stre)+slen); 92 88 } 93 slen=stre-> len;89 slen=stre->Length; 94 90 95 91 i = min(buflen - 1, slen); … … 97 93 return slen; /* different to LoadString */ 98 94 if (i>0) { 99 strncpy(buffer,stre->str,i); 100 buffer[i]=0; 95 if (stre->Flags & MESSAGE_RESOURCE_UNICODE) 96 WideCharToMultiByte( CP_ACP, 0, (LPWSTR)stre->Text, -1, buffer, i, NULL, NULL ); 97 else 98 lstrcpynA(buffer, (LPSTR)stre->Text, i); 99 buffer[i]=0; 101 100 } else { 102 101 if (buflen>1) { … … 166 165 if (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) 167 166 { 168 from = (char*)HeapAlloc( GetProcessHeap(),0,200 ); 169 sprintf(from,"Systemmessage, messageid = 0x%08lx\n",dwMessageId); 167 INT bufsize; 168 HMODULE hmodule; 169 170 hmodule = GetModuleHandleA("kernel32"); 171 bufsize=LoadMessageA(hmodule,dwMessageId,dwLanguageId,NULL,100); 172 if (bufsize) 173 { 174 from = (char*)HeapAlloc( GetProcessHeap(), 0, bufsize + 1 ); 175 LoadMessageA(hmodule,dwMessageId,dwLanguageId,from,bufsize+1); 176 } 170 177 } 171 178 … … 415 422 if (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) 416 423 { 417 /* gather information from system message tables ... */ 418 from = (char*)HeapAlloc( GetProcessHeap(),0,200 ); 419 sprintf(from,"Systemmessage, messageid = 0x%08lx\n",dwMessageId); 424 INT bufsize; 425 HMODULE hmodule; 426 427 hmodule = GetModuleHandleA("kernel32"); 428 bufsize=LoadMessageA(hmodule,dwMessageId,dwLanguageId,NULL,100); 429 if (bufsize) 430 { 431 from = (char*)HeapAlloc( GetProcessHeap(), 0, bufsize + 1 ); 432 LoadMessageA(hmodule,dwMessageId,dwLanguageId,from,bufsize+1); 433 } 420 434 } 421 435 -
trunk/src/kernel32/overlappedio.cpp
r9340 r10185 1 /* $Id: overlappedio.cpp,v 1.2 0 2002-10-10 16:28:40sandervl Exp $ */1 /* $Id: overlappedio.cpp,v 1.21 2003-07-28 11:35:32 sandervl Exp $ */ 2 2 3 3 /* … … 87 87 threadparam->lpOverlappedObj = this; 88 88 hThreadWrite = ::CreateThread(NULL, 32*1024, OverlappedIOThread, (LPVOID)threadparam, 0, &dwThreadId); 89 SetThreadPriority(hThreadWrite, THREAD_PRIORITY_TIME_CRITICAL); 89 90 if(hThreadWrite) {//thread uses this object; keep reference count to avoid premature destruction 90 91 AddRef(); -
trunk/src/odincrt/critsect.cpp
r9756 r10185 1 /* $Id: critsect.cpp,v 1. 8 2003-02-06 10:30:02sandervl Exp $ */1 /* $Id: critsect.cpp,v 1.9 2003-07-28 11:30:17 sandervl Exp $ */ 2 2 /* 3 3 * Critical sections in the Win32 sense 4 * 4 * 5 5 * Copyright 2002 Sander van Leeuwen <sandervl@innotek.de> 6 6 * … … 12 12 #include <win32type.h> 13 13 #include <win32api.h> 14 #include <FastInfoBlocks.h> 14 15 15 16 #include <assert.h> … … 23 24 #define DebugInt3() 24 25 #endif 26 25 27 26 28 //****************************************************************************** … … 42 44 inline ULONG GetCurrentThreadId() 43 45 { 46 #ifdef fibGetPid 47 return MAKE_THREADID(fibGetPid(), fibGetTid()); 48 #else 44 49 PTIB ptib; 45 50 PPIB ppib; 46 51 APIRET rc; 47 52 48 53 rc = DosGetInfoBlocks(&ptib, &ppib); 49 54 if(rc == NO_ERROR) { … … 57 62 DebugInt3(); 58 63 return 0; 64 #endif 59 65 } 60 66 //****************************************************************************** … … 62 68 inline ULONG GetCurrentProcessId() 63 69 { 70 #ifdef fibGetPid 71 return fibGetPid(); 72 #else 64 73 PTIB ptib; 65 74 PPIB ppib; 66 75 APIRET rc; 67 76 68 77 rc = DosGetInfoBlocks(&ptib, &ppib); 69 78 if(rc == NO_ERROR) { … … 72 81 DebugInt3(); 73 82 return 0; 83 #endif 74 84 } 75 85 … … 77 87 * DosInitializeCriticalSection 78 88 */ 79 ULONG WIN32API DosInitializeCriticalSection(CRITICAL_SECTION_OS2 *crit, 89 ULONG WIN32API DosInitializeCriticalSection(CRITICAL_SECTION_OS2 *crit, 80 90 PSZ pszSemName, BOOL fShared) 81 91 { … … 131 141 { 132 142 #ifdef DEBUG 133 if (crit->LockCount != -1 || crit->OwningThread || crit->RecursionCount) /* Should not happen */ 143 if ( (crit->LockCount != -1 && crit->CreationCount == 1) 144 || crit->OwningThread 145 || crit->RecursionCount) /* Should not happen */ 134 146 { 135 147 DebugInt3(); … … 181 193 ULONG ulnrposts; 182 194 183 // now wait for it 195 // now wait for it 184 196 APIRET rc = DosWaitEventSem(crit->hmtxLock, ulTimeout); 185 197 if(rc != NO_ERROR) { … … 206 218 return ERROR_INVALID_PARAMETER; 207 219 } 208 220 209 221 if (--crit->RecursionCount) 210 222 { -
trunk/src/odincrt/file.cpp
r9709 r10185 1 /* $Id: file.cpp,v 1. 4 2003-01-22 17:06:42sandervl Exp $ */1 /* $Id: file.cpp,v 1.5 2003-07-28 11:30:17 sandervl Exp $ */ 2 2 /* 3 3 * Project Odin Software License can be found in LICENSE.TXT … … 232 232 } 233 233 234 235 char * _LNK_CONV CRTWRAP(tmpnam)( char * a) 236 { 237 unsigned short sel = RestoreOS2FS(); 238 char *rc; 239 240 rc = tmpnam(a); 241 SetFS(sel); 242 return rc; 243 } -
trunk/src/odincrt/odin36.def
r9715 r10185 1 ; $Id: odin36.def,v 1. 9 2003-01-23 12:33:04sandervl Exp $1 ; $Id: odin36.def,v 1.10 2003-07-28 11:30:17 sandervl Exp $ 2 2 ; Odin VAC++ 3.6.5 shared multithreaded runtime 3 3 LIBRARY ODINCRT INITINSTANCE TERMINSTANCE … … 54 54 55 55 odin_fdopen @605 NONAME 56 57 odin_tmpnam @409 NONAME 56 58 57 59 __nw__FUiPCcT1 @172 NONAME … … 450 452 stdout @407 NONAME 451 453 wcslen @408 NONAME 452 tmpnam @409 NONAME454 ;; tmpnam @409 NONAME 453 455 rewind @410 NONAME 454 456 wctype @411 NONAME -
trunk/src/odincrt/odin36d.def
r9715 r10185 1 ; $Id: odin36d.def,v 1. 9 2003-01-23 12:33:05sandervl Exp $1 ; $Id: odin36d.def,v 1.10 2003-07-28 11:30:18 sandervl Exp $ 2 2 ; Odin VAC++ 3.6.5 shared multithreaded runtime 3 3 LIBRARY ODINCRTD INITINSTANCE TERMINSTANCE … … 54 54 55 55 odin_fdopen @605 NONAME 56 57 odin_tmpnam @409 NONAME 56 58 57 59 __nw__FUiPCcT1 @172 NONAME … … 450 452 stdout @407 NONAME 451 453 wcslen @408 NONAME 452 tmpnam @409 NONAME454 ;; tmpnam @409 NONAME 453 455 rewind @410 NONAME 454 456 wctype @411 NONAME -
trunk/src/odincrt/odincrt.def
r9715 r10185 1 ; $Id: odincrt.def,v 1. 29 2003-01-23 12:33:05sandervl Exp $1 ; $Id: odincrt.def,v 1.30 2003-07-28 11:30:19 sandervl Exp $ 2 2 ; Odin VAC++ 3.08 shared multithreaded runtime 3 3 LIBRARY ODINCRT INITINSTANCE TERMINSTANCE … … 54 54 55 55 odin_fdopen @605 NONAME 56 57 odin_tmpnam @409 NONAME 56 58 57 59 __nw__FUiPCcT1 @172 NONAME … … 453 455 stdout @407 NONAME 454 456 wcslen @408 NONAME 455 tmpnam @409 NONAME457 ;; tmpnam @409 NONAME 456 458 rewind @410 NONAME 457 459 wctype @411 NONAME -
trunk/src/odincrt/odincrtd.def
r9715 r10185 1 ; $Id: odincrtd.def,v 1.1 0 2003-01-23 12:33:06sandervl Exp $1 ; $Id: odincrtd.def,v 1.11 2003-07-28 11:30:19 sandervl Exp $ 2 2 ; Odin VAC++ 3.08 shared multithreaded runtime 3 3 LIBRARY ODINCRTD INITINSTANCE TERMINSTANCE … … 54 54 55 55 odin_fdopen @605 NONAME 56 57 odin_tmpnam @409 NONAME 56 58 57 59 __nw__FUiPCcT1 @172 NONAME … … 450 452 stdout @407 NONAME 451 453 wcslen @408 NONAME 452 tmpnam @409 NONAME454 ;; tmpnam @409 NONAME 453 455 rewind @410 NONAME 454 456 wctype @411 NONAME -
trunk/src/odincrt/odincrtp.def
r9715 r10185 1 ; $Id: odincrtp.def,v 1. 7 2003-01-23 12:33:06sandervl Exp $1 ; $Id: odincrtp.def,v 1.8 2003-07-28 11:30:20 sandervl Exp $ 2 2 ; Odin VAC++ 3.08 shared multithreaded runtime 3 3 LIBRARY ODINCRTP INITINSTANCE TERMINSTANCE … … 65 65 66 66 odin_fdopen @605 NONAME 67 68 odin_tmpnam @409 NONAME 67 69 68 70 __nw__FUiPCcT1 @172 NONAME … … 461 463 stdout @407 NONAME 462 464 wcslen @408 NONAME 463 tmpnam @409 NONAME465 ;; tmpnam @409 NONAME 464 466 rewind @410 NONAME 465 467 wctype @411 NONAME -
trunk/src/ole32/ole2.c
r8973 r10185 166 166 static DWORD OLEDD_GetButtonState(); 167 167 168 #ifdef __WIN32OS2__ 169 static IDropTarget *IDropTarget_Constructor(); 170 171 HWND hwndTracker = 0; 172 #endif 168 173 169 174 /****************************************************************************** … … 561 566 trackerInfo.curDragTarget = 0; 562 567 568 #ifdef __WIN32OS2__ 569 IDataObject_AddRef(trackerInfo.dataObject); 570 #endif 571 563 572 hwndTrackWindow = CreateWindowA(OLEDD_DRAGTRACKERCLASS, 564 573 "TrackerWindow", … … 573 582 if (hwndTrackWindow!=0) 574 583 { 584 #ifdef __WIN32OS2__ 585 hwndTracker = hwndTrackWindow; 586 #endif 575 587 /* 576 588 * Capture the mouse input … … 619 631 DestroyWindow(hwndTrackWindow); 620 632 633 #ifdef __WIN32OS2__ 634 IDataObject_Release(trackerInfo.dataObject); 635 #endif 636 621 637 return trackerInfo.returnValue; 622 638 } 639 640 #ifdef __WIN32OS2__ 641 IDataObject_Release(trackerInfo.dataObject); 642 #endif 623 643 624 644 return E_FAIL; … … 1636 1656 1637 1657 RegisterClassA (&wndClass); 1658 1659 #ifdef __WIN32OS2__ 1660 { 1661 IDropTarget *desktopdnd; 1662 1663 desktopdnd = IDropTarget_Constructor(); 1664 RegisterDragDrop(GetDesktopWindow(), desktopdnd); 1665 } 1666 #endif 1638 1667 } 1639 1668 … … 1934 1963 */ 1935 1964 hwndNewTarget = WindowFromPoint(mousePos); 1965 1966 #ifdef __WIN32OS2__ 1967 dprintf(("OLEDD_TrackMouseMove: hwndNewTarget %x current %x", hwndNewTarget, trackerInfo->curDragTargetHWND)); 1968 #endif 1936 1969 1937 1970 /* … … 2512 2545 dprintf(("IDataObject_fnGetData %x %x", pformatetcIn, pmedium)); 2513 2546 2514 if(pformatetcIn->cfFormat != CF_HDROP )2547 if(pformatetcIn->cfFormat != CF_HDROP && pformatetcIn->cfFormat != CF_TEXT && pformatetcIn->cfFormat != CF_UNICODETEXT) 2515 2548 { 2516 2549 FIXME("-- expected clipformat not implemented\n"); … … 2883 2916 //****************************************************************************** 2884 2917 //****************************************************************************** 2918 2919 #include <oslibdnd.h> 2920 2921 typedef struct 2922 { 2923 /* IUnknown fields */ 2924 ICOM_VFIELD(IDropTarget); 2925 DWORD ref; 2926 2927 LPVOID lpDnDData; 2928 LPSTR lpOS2StringData; 2929 LPVOID lpDragStruct; 2930 POINTL pt; 2931 HGLOBAL hDndData; 2932 FORMATETC format; 2933 STGMEDIUM medium; 2934 LPDATAOBJECT pDataObject; 2935 } IDropTargetImpl; 2936 2937 2938 /*************************************************************************** 2939 * IDropTarget_QueryInterface 2940 */ 2941 static HRESULT WINAPI IDropTarget_fnQueryInterface(IDropTarget *iface, REFIID riid, LPVOID * ppvObj) 2942 { 2943 ICOM_THIS(IDropTargetImpl,iface); 2944 2945 dprintf(("IDropTarget_fnQueryInterface (%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj)); 2946 2947 *ppvObj = NULL; 2948 2949 if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ 2950 { 2951 *ppvObj = This; 2952 } 2953 else if(IsEqualIID(riid, &IID_IDropTarget)) /*IDropTarget*/ 2954 { 2955 *ppvObj = (IDropTarget*)This; 2956 } 2957 2958 if(*ppvObj) 2959 { 2960 IUnknown_AddRef((IUnknown*)*ppvObj); 2961 TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); 2962 return S_OK; 2963 } 2964 TRACE("-- Interface: E_NOINTERFACE\n"); 2965 return E_NOINTERFACE; 2966 } 2967 2968 /************************************************************************** 2969 * IDropTarget_AddRef 2970 */ 2971 static ULONG WINAPI IDropTarget_fnAddRef(IDropTarget *iface) 2972 { 2973 ICOM_THIS(IDropTargetImpl,iface); 2974 2975 dprintf(("IDropTarget_fnAddRef (%p)->(count=%lu)\n",This, This->ref)); 2976 2977 return ++(This->ref); 2978 } 2979 2980 /************************************************************************** 2981 * IDropTarget_fnCleanup 2982 */ 2983 static ULONG WINAPI IDropTarget_fnCleanup(IDropTarget *iface) 2984 { 2985 ICOM_THIS(IDropTargetImpl,iface); 2986 2987 if(This->pDataObject) { 2988 IDataObject_Release(This->pDataObject); 2989 This->pDataObject = 0; 2990 if(This->lpDnDData) { 2991 HeapFree(GetProcessHeap(), 0, This->lpDnDData); 2992 This->lpDnDData = NULL; 2993 } 2994 if(This->lpOS2StringData) { 2995 HeapFree(GetProcessHeap(), 0, This->lpOS2StringData); 2996 This->lpOS2StringData = NULL; 2997 } 2998 if(This->lpDragStruct) { 2999 OSLibFreeDragStruct(This->lpDragStruct); 3000 This->lpDragStruct = NULL; 3001 } 3002 } 3003 } 3004 /************************************************************************** 3005 * IDropTarget_Release 3006 */ 3007 static ULONG WINAPI IDropTarget_fnRelease(IDropTarget *iface) 3008 { 3009 ICOM_THIS(IDropTargetImpl,iface); 3010 3011 dprintf(("IDropTarget_fnRelease (%p)->(count=%lu)\n",This, This->ref)); 3012 3013 IDropTarget_fnCleanup(iface); 3014 if(This->ref == 1) { 3015 if(This->hDndData) { 3016 GlobalFree(This->hDndData); 3017 This->hDndData = 0; 3018 } 3019 } 3020 return --(This->ref); 3021 } 3022 //****************************************************************************** 3023 //****************************************************************************** 3024 static HRESULT WINAPI IDropTarget_fnDragEnter(IDropTarget *iface, IDataObject* pDataObject, 3025 DWORD grfKeyState, POINTL pt, DWORD* pdwEffect) 3026 { 3027 HRESULT ret; 3028 DWORD size, dwEffect; 3029 LPVOID lpData; 3030 DROPFILES *lpDrop; 3031 LPSTR *lpStringData; 3032 ICOM_THIS(IDropTargetImpl,iface); 3033 DWORD supportedformats[] = {CF_HDROP, CF_TEXT}; 3034 int i; 3035 3036 dprintf(("IDropTarget_fnDragEnter %x (%d,%d)", grfKeyState, pt.x, pt.y)); 3037 IDropTarget_fnCleanup(iface); 3038 3039 IDataObject_AddRef(pDataObject); 3040 This->pDataObject = pDataObject; 3041 3042 #ifdef DEBUG 3043 { 3044 IEnumFORMATETC *enumfmt = NULL; 3045 3046 if(IDataObject_EnumFormatEtc(pDataObject, DATADIR_GET, &enumfmt) == S_OK) { 3047 for (;;) { 3048 3049 FORMATETC tmp; 3050 ULONG actual = 1, res; 3051 3052 res = IEnumFORMATETC_Next(enumfmt, 1, &tmp, &actual); 3053 3054 if(res != S_OK) break; 3055 3056 dprintf(("format %x typed %x", tmp.cfFormat, tmp.tymed)); 3057 } 3058 IEnumFORMATETC_Release(enumfmt); 3059 } 3060 } 3061 #endif 3062 3063 for(i=0;i<sizeof(supportedformats)/sizeof(supportedformats[0]);i++) 3064 { 3065 This->format.cfFormat = supportedformats[i]; 3066 This->format.ptd = NULL; 3067 This->format.dwAspect = DVASPECT_CONTENT; 3068 This->format.lindex = -1; 3069 This->format.tymed = TYMED_HGLOBAL; 3070 ret = IDataObject_GetData(pDataObject, &This->format, &This->medium); 3071 if(ret != S_OK) { 3072 dprintf(("IDataObject_GetData failed with %x", ret)); 3073 continue; 3074 } 3075 size = GlobalSize(This->medium.u.hGlobal); 3076 if(size == 0) { 3077 dprintf(("GlobalSize failed for %x", This->medium.u.hGlobal)); 3078 ReleaseStgMedium(&This->medium); 3079 return E_OUTOFMEMORY; 3080 } 3081 dprintf(("handle %x size %d, format %x tymed %x", This->medium.u.hGlobal, size, This->format.cfFormat, This->format.tymed)); 3082 3083 if(size == 1) {//empty string; use previous data 3084 if(This->hDndData == 0) { 3085 DebugInt3(); 3086 ReleaseStgMedium(&This->medium); 3087 return E_OUTOFMEMORY; 3088 } 3089 This->medium.u.hGlobal = This->hDndData; 3090 3091 dprintf(("Reuse old global handle %x", This->hDndData)); 3092 size = GlobalSize(This->medium.u.hGlobal); 3093 if(size == 0) { 3094 dprintf(("GlobalSize failed for %x", This->medium.u.hGlobal)); 3095 ReleaseStgMedium(&This->medium); 3096 return E_OUTOFMEMORY; 3097 } 3098 dprintf(("handle %x size %d, format %x tymed %x", This->medium.u.hGlobal, size, This->format.cfFormat, This->format.tymed)); 3099 } 3100 else This->hDndData = This->medium.u.hGlobal; 3101 3102 This->lpDnDData = (LPVOID)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); 3103 if(This->lpDnDData == NULL) { 3104 dprintf(("HeapAlloc failed for %d bytes", size)); 3105 return E_OUTOFMEMORY; 3106 } 3107 This->lpOS2StringData = (LPVOID)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size*2); 3108 if(This->lpOS2StringData == NULL) { 3109 dprintf(("HeapAlloc failed for %d bytes", size)); 3110 return E_OUTOFMEMORY; 3111 } 3112 lpData = GlobalLock(This->medium.u.hGlobal); 3113 3114 if(This->format.cfFormat == CF_HDROP) { 3115 memcpy(This->lpDnDData, lpData, size); 3116 lpDrop = (DROPFILES *)This->lpDnDData; 3117 lpStringData = (LPSTR)(lpDrop) + lpDrop->pFiles; 3118 if(lpDrop->fWide == FALSE) { 3119 OemToCharA((LPSTR)lpStringData, (LPSTR)This->lpOS2StringData); 3120 } 3121 else { 3122 int len; 3123 len = lstrlenW((LPWSTR)lpStringData); 3124 WideCharToMultiByte( CP_OEMCP, 0, (LPWSTR)lpStringData, len, (LPSTR)This->lpOS2StringData, len, NULL, NULL ); 3125 } 3126 } 3127 else 3128 if(This->format.cfFormat == CF_TEXT) { 3129 strcpy(This->lpDnDData, lpData); 3130 OemToCharA( This->lpDnDData, This->lpOS2StringData ); 3131 } 3132 dprintf(("Drop string %s", This->lpOS2StringData)); 3133 GlobalUnlock(This->medium.u.hGlobal); 3134 3135 This->pt = pt; 3136 3137 This->lpDragStruct = OSLibCreateDragStruct(hwndTracker, This->pt.x, This->pt.y, This->lpOS2StringData); 3138 if(This->lpDragStruct == NULL) { 3139 dprintf(("OSLibCreateDragStruct")); 3140 ReleaseStgMedium(&This->medium); 3141 return E_OUTOFMEMORY; 3142 } 3143 3144 dwEffect = OSLibDragOver(This->lpDragStruct, pt.x, pt.y); 3145 break; 3146 } 3147 if(ret != S_OK) { 3148 dprintf(("IDataObject_GetData failed (fatal) with %x", ret)); 3149 return ret; 3150 } 3151 if(pdwEffect) { 3152 *pdwEffect = dwEffect; 3153 } 3154 3155 return S_OK; 3156 } 3157 //****************************************************************************** 3158 //****************************************************************************** 3159 static HRESULT WINAPI IDropTarget_fnDragOver(IDropTarget *iface, DWORD grfKeyState, POINTL pt, 3160 DWORD* pdwEffect) 3161 { 3162 DWORD dwEffect; 3163 ICOM_THIS(IDropTargetImpl,iface); 3164 3165 dprintf(("IDropTarget_fnDragOver %x (%d,%d)", grfKeyState, pt.x, pt.y)); 3166 3167 dwEffect = OSLibDragOver(This->lpDragStruct, pt.x, pt.y); 3168 if(pdwEffect) { 3169 *pdwEffect = dwEffect; 3170 } 3171 return S_OK; 3172 } 3173 //****************************************************************************** 3174 //****************************************************************************** 3175 static HRESULT WINAPI IDropTarget_fnDragLeave(IDropTarget *iface) 3176 { 3177 ICOM_THIS(IDropTargetImpl,iface); 3178 3179 dprintf(("IDropTarget_fnDragLeave")); 3180 3181 OSLibDragLeave(This->lpDragStruct); 3182 3183 IDropTarget_fnCleanup(iface); 3184 return S_OK; 3185 } 3186 //****************************************************************************** 3187 //****************************************************************************** 3188 static HRESULT WINAPI IDropTarget_fnDrop(IDropTarget *iface, IDataObject* pDataObject, DWORD grfKeyState, 3189 POINTL pt, DWORD* pdwEffect) 3190 { 3191 DWORD dwEffect; 3192 ICOM_THIS(IDropTargetImpl,iface); 3193 3194 dprintf(("IDropTarget_fnDrop %x (%d,%d) %s", grfKeyState, pt.x, pt.y, This->lpOS2StringData)); 3195 3196 dwEffect = OSLibDragDrop(This->lpDragStruct, pt.x, pt.y, This->lpOS2StringData); 3197 if(pdwEffect) { 3198 *pdwEffect = dwEffect; 3199 } 3200 return S_OK; 3201 } 3202 //****************************************************************************** 3203 //****************************************************************************** 3204 3205 static struct ICOM_VTABLE(IDropTarget) droptarget = 3206 { 3207 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 3208 IDropTarget_fnQueryInterface, 3209 IDropTarget_fnAddRef, 3210 IDropTarget_fnRelease, 3211 IDropTarget_fnDragEnter, 3212 IDropTarget_fnDragOver, 3213 IDropTarget_fnDragLeave, 3214 IDropTarget_fnDrop, 3215 }; 3216 3217 3218 /************************************************************************** 3219 * IDropTarget_Constructor 3220 */ 3221 static IDropTarget *IDropTarget_Constructor() 3222 { 3223 IDropTargetImpl* dto; 3224 3225 dto = (IDropTargetImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDropTargetImpl)); 3226 3227 if (dto) 3228 { 3229 dto->ref = 1; 3230 dto->pDataObject = NULL; 3231 dto->lpDnDData = NULL; 3232 dto->lpOS2StringData = NULL; 3233 dto->hDndData = 0; 3234 ICOM_VTBL(dto) = &droptarget; 3235 } 3236 3237 return (IDropTarget *)dto; 3238 } 3239 2885 3240 #endif 2886 3241 -
trunk/src/ole32/ole32.mak
r9400 r10185 1 # $Id: ole32.mak,v 1.2 1 2002-11-12 17:06:02sandervl Exp $1 # $Id: ole32.mak,v 1.22 2003-07-28 11:32:05 sandervl Exp $ 2 2 3 3 # … … 50 50 $(OBJDIR)\imessagefilter.obj \ 51 51 $(OBJDIR)\memlockbytes.obj \ 52 !if "$(DEBUG)" == "1" 52 53 $(OBJDIR)\oString.obj \ 54 !endif 53 55 $(OBJDIR)\ole2impl.obj \ 54 56 $(OBJDIR)\ole2.obj \ -
trunk/src/olepro32/olepro32.cpp
r3931 r10185 1 /* $Id: olepro32.cpp,v 1. 2 2000-08-02 16:29:41 birdExp $ */1 /* $Id: olepro32.cpp,v 1.3 2003-07-28 11:29:30 sandervl Exp $ */ 2 2 /* 3 3 * OlePro32 Stubs … … 59 59 } 60 60 61 HRESULT WINAPI DllUnregisterServer()61 HRESULT WINAPI OLEPRO32_DllUnregisterServer() 62 62 { 63 63 dprintf(("not implemented (olepro32.dll) \n")); … … 65 65 } 66 66 67 HRESULT WINAPI DllRegisterServer()67 HRESULT WINAPI OLEPRO32_DllRegisterServer() 68 68 { 69 69 dprintf(("not implemented (olepro32.dll) \n")); … … 71 71 } 72 72 73 HRESULT WINAPI DllCanUnloadNow( )73 HRESULT WINAPI OLEPRO32_DllCanUnloadNow( ) 74 74 { 75 75 dprintf(("not implemented (olepro32.dll) \n")); … … 77 77 } 78 78 79 HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, LPVOID* ppv )79 HRESULT WINAPI OLEPRO32_DllGetClassObject( REFCLSID rclsid, REFIID riid, LPVOID* ppv ) 80 80 { 81 81 dprintf(("not implemented (olepro32.dll) \n")); -
trunk/src/olepro32/olepro32.def
r4809 r10185 1 ; $Id: olepro32.def,v 1. 2 2000-12-16 22:53:33 birdExp $1 ; $Id: olepro32.def,v 1.3 2003-07-28 11:29:30 sandervl Exp $ 2 2 3 3 ; … … 9 9 10 10 EXPORTS 11 OleIconToCursor = _OleIconToCursor@8@24812 OleCreatePropertyFrameIndirect 13 OleCreatePropertyFrame = _OleCreatePropertyFrame@44 @25014 OleLoadPicture = _OleLoadPicture@20@25115 OleCreatePictureIndirect = _OleCreatePictureIndirect@16 @25216 OleCreateFontIndirect = _OleCreateFontIndirect@12 @25317 OleTranslateColor = _OleTranslateColor@12 @25418 DllCanUnloadNow =_DllCanUnloadNow@0 @25519 DllGetClassObject = _ DllGetClassObject@12 @25620 DllRegisterServer = _ DllRegisterServer@0 @25721 DllUnregisterServer = _ DllUnregisterServer@0 @25811 OleIconToCursor = _OleIconToCursor@8 @248 12 OleCreatePropertyFrameIndirect = _OleCreatePropertyFrameIndirect@4 @249 13 OleCreatePropertyFrame = _OleCreatePropertyFrame@44 @250 14 OleLoadPicture = _OleLoadPicture@20 @251 15 OleCreatePictureIndirect = _OleCreatePictureIndirect@16 @252 16 OleCreateFontIndirect = _OleCreateFontIndirect@12 @253 17 OleTranslateColor = _OleTranslateColor@12 @254 18 DllCanUnloadNow = _OLEPRO32_DllCanUnloadNow@0 @255 19 DllGetClassObject = _OLEPRO32_DllGetClassObject@12 @256 20 DllRegisterServer = _OLEPRO32_DllRegisterServer@0 @257 21 DllUnregisterServer = _OLEPRO32_DllUnregisterServer@0 @258 -
trunk/src/shell32/enumidlist.c
r9094 r10185 1 /* $Id: enumidlist.c,v 1. 6 2002-08-22 14:20:44sandervl Exp $ */1 /* $Id: enumidlist.c,v 1.7 2003-07-28 11:28:56 sandervl Exp $ */ 2 2 /* 3 3 * IEnumIDList … … 202 202 for (x = 0;x < count;x++) 203 203 { 204 if ( !(dwFlags & SHCONTF_INCLUDEHIDDEN) && (stffile[x].dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ) continue; 205 204 206 if (stffile[x].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 205 207 { //directory … … 247 249 for (x = 0;x < count;x++) 248 250 { 251 if ( !(dwFlags & SHCONTF_INCLUDEHIDDEN) && (stffile[x].dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ) continue; 252 249 253 if (! (stffile[x].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ) 250 254 { -
trunk/src/shell32/shlfolder.c
r9885 r10185 235 235 * This functions does not set flags!! It only resets flags when nessesary. 236 236 */ 237 #include <dbglog.h> 237 238 static HRESULT SHELL32_GetItemAttributes( 238 239 IShellFolder * psf, … … 240 241 LPDWORD pdwAttributes) 241 242 { 243 #if 1 244 GUID const *clsid; 245 DWORD dwAttributes; 246 DWORD dwSupportedAttr=SFGAO_CANCOPY | /*0x00000001 */ 247 SFGAO_CANMOVE | /*0x00000002 */ 248 SFGAO_CANLINK | /*0x00000004 */ 249 SFGAO_CANRENAME | /*0x00000010 */ 250 SFGAO_CANDELETE | /*0x00000020 */ 251 SFGAO_HASPROPSHEET | /*0x00000040 */ 252 SFGAO_DROPTARGET | /*0x00000100 */ 253 SFGAO_READONLY | /*0x00040000 */ 254 SFGAO_HIDDEN | /*0x00080000 */ 255 SFGAO_FILESYSANCESTOR | /*0x10000000 */ 256 SFGAO_FOLDER | /*0x20000000 */ 257 SFGAO_FILESYSTEM | /*0x40000000 */ 258 SFGAO_HASSUBFOLDER; /*0x80000000 */ 259 260 TRACE ("0x%08lx\n", *pdwAttributes); 261 262 dprintf(("_ILGetTextPointer returned %s", _ILGetTextPointer(pidl))); 263 264 if (*pdwAttributes & ~dwSupportedAttr) 265 { 266 WARN ("attributes 0x%08lx not implemented\n", (*pdwAttributes & ~dwSupportedAttr)); 267 *pdwAttributes &= dwSupportedAttr; 268 } 269 270 if (_ILIsDrive (pidl)) { 271 *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANLINK; 272 } else if ((clsid = _ILGetGUIDPointer (pidl))) { 273 if (HCR_GetFolderAttributes (clsid, &dwAttributes)) { 274 *pdwAttributes &= dwAttributes; 275 } else { 276 *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME|SFGAO_CANLINK; 277 } 278 } else if (_ILGetDataPointer (pidl)) { 279 dwAttributes = _ILGetFileAttributes (pidl, NULL, 0); 280 *pdwAttributes &= ~SFGAO_FILESYSANCESTOR; 281 282 if (((SFGAO_FOLDER|SFGAO_HASSUBFOLDER) & *pdwAttributes) && !(dwAttributes & FILE_ATTRIBUTE_DIRECTORY)) 283 *pdwAttributes &= ~(SFGAO_FOLDER | SFGAO_HASSUBFOLDER); 284 285 if ((SFGAO_HIDDEN & *pdwAttributes) && !(dwAttributes & FILE_ATTRIBUTE_HIDDEN)) 286 *pdwAttributes &= ~SFGAO_HIDDEN; 287 288 if ((SFGAO_READONLY & *pdwAttributes) && !(dwAttributes & FILE_ATTRIBUTE_READONLY)) 289 *pdwAttributes &= ~SFGAO_READONLY; 290 } else { 291 *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME|SFGAO_CANLINK; 292 } 293 TRACE ("-- 0x%08lx\n", *pdwAttributes); 294 return S_OK; 295 #else 242 296 GUID const * clsid; 243 297 DWORD dwAttributes; … … 284 338 TRACE("-- 0x%08lx\n", *pdwAttributes); 285 339 return S_OK; 340 #endif 286 341 } 287 342 … … 1809 1864 if (!SUCCEEDED(SHELL32_CoCreateInitSF (This->absPidl, pidl, clsid, riid, (LPVOID*)&pShellFolder))) 1810 1865 { 1866 #ifdef __WIN32OS2__ 1867 //SvL: no implementation present, so just copy 'my computer' 1868 if ( IsEqualIID(clsid, &CLSID_NetworkPlaces)) { 1869 pShellFolder = ISF_MyComputer_Constructor(); 1870 } 1871 #else 1811 1872 return E_INVALIDARG; 1873 #endif 1812 1874 } 1813 1875 } -
trunk/src/user32/Makefile
r9930 r10185 1 # $Id: Makefile,v 1.10 6 2003-03-20 13:20:44 sandervl Exp $1 # $Id: Makefile,v 1.107 2003-07-28 11:27:44 sandervl Exp $ 2 2 3 3 # … … 111 111 $(OBJDIR)\oslibprf.obj \ 112 112 $(OBJDIR)\dragdrop.obj \ 113 $(OBJDIR)\oslibdnd.obj \ 113 114 !ifdef DEBUG 114 115 $(OBJDIR)\dbgwrap.obj \ -
trunk/src/user32/USER32.DEF
r10031 r10185 1 ; $Id: USER32.DEF,v 1. 79 2003-04-23 18:00:58sandervl Exp $1 ; $Id: USER32.DEF,v 1.80 2003-07-28 11:27:44 sandervl Exp $ 2 2 3 3 LIBRARY USER32 INITINSTANCE TERMINSTANCE … … 728 728 _CustForceMonoCursor@0 @2036 NONAME 729 729 730 731 _OSLibDragOver@12 @2038 NONAME 732 _OSLibDragLeave@4 @2039 NONAME 733 _OSLibDragDrop@16 @2040 NONAME 734 _OSLibCreateDragStruct@16 @2041 NONAME 735 _OSLibFreeDragStruct@4 @2042 NONAME -
trunk/src/user32/dragdrop.cpp
r8735 r10185 1 /* $Id: dragdrop.cpp,v 1. 3 2002-06-20 14:18:14sandervl Exp $ */1 /* $Id: dragdrop.cpp,v 1.4 2003-07-28 11:27:45 sandervl Exp $ */ 2 2 3 3 /* … … 31 31 DWORD dwExStyle; 32 32 HWND orghwnd = hwnd; 33 33 34 dprintf(("DragDropFiles %x (%d,%d) %d %s %d %d", hwnd, point.x, point.y, cFiles, pszFiles, cbszFiles, fNonClient)); 35 34 36 dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); 35 37 … … 66 68 BOOL DragDropDragOver(HWND hwnd, DWORD dwEffect) 67 69 { 70 dprintf(("DragDropDragOver %x %x", hwnd, dwEffect)); 68 71 if(pfnDragOver) { 69 72 return pfnDragOver(hwnd, dwEffect); … … 78 81 DROPFILES *pDropFile; 79 82 HGLOBAL hDropFile; 83 84 dprintf(("DragDropDragEnter %x (%d,%d) %d %s %d %d", hwnd, point.x, point.y, cFiles, pszFiles, cbszFiles, fNonClient)); 80 85 81 86 if(pfnDragEnter) { … … 103 108 BOOL DragDropDragLeave(HWND hwnd) 104 109 { 110 dprintf(("DragDropDragLeave %x", hwnd)); 105 111 if(pfnDragLeave) { 106 112 return pfnDragLeave(hwnd); … … 113 119 { 114 120 DWORD dwExStyle; 121 122 dprintf(("DragDropDragAccept %x", hwnd)); 115 123 116 124 dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); -
trunk/src/user32/oslibmsg.cpp
r10122 r10185 1 /* $Id: oslibmsg.cpp,v 1.7 0 2003-05-27 10:52:25 sandervl Exp $ */1 /* $Id: oslibmsg.cpp,v 1.71 2003-07-28 11:27:45 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 746 746 return (ULONG)WinSendMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), pvMsgPacket); 747 747 } 748 748 //****************************************************************************** 749 //****************************************************************************** 750 BOOL OSLibSendWinMessage(HWND hwnd, ULONG winmsg) 751 { 752 return (BOOL)WinSendMsg(Win32ToOS2Handle(hwnd), TranslateWinMsg(winmsg, TRUE), 0, 0); 753 } 749 754 //****************************************************************************** 750 755 //****************************************************************************** -
trunk/src/user32/oslibmsg.h
r10012 r10185 1 /* $Id: oslibmsg.h,v 1.2 0 2003-04-11 14:22:05 sandervl Exp $ */1 /* $Id: oslibmsg.h,v 1.21 2003-07-28 11:27:45 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 55 55 ULONG OSLibSendMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode); 56 56 ULONG OSLibWinBroadcastMsg(ULONG msg, ULONG wParam, ULONG lParam, BOOL fSend); 57 BOOL OSLibSendWinMessage(HWND hwnd, ULONG winmsg); 57 58 58 59 //Direct posting of messages that must remain invisible to the win32 app -
trunk/src/user32/oslibmsgtranslate.cpp
r10104 r10185 1 /* $Id: oslibmsgtranslate.cpp,v 1.11 0 2003-05-16 10:59:27sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.111 2003-07-28 11:27:46 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 97 97 //****************************************************************************** 98 98 //****************************************************************************** 99 ULONG GetMouseKeyState()100 {101 ULONG keystate = 0;102 103 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)104 keystate |= MK_LBUTTON_W;105 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000)106 keystate |= MK_RBUTTON_W;107 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000)108 keystate |= MK_MBUTTON_W;109 if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000)110 keystate |= MK_SHIFT_W;111 if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000)112 keystate |= MK_CONTROL_W;113 114 return keystate;115 }116 //******************************************************************************117 //******************************************************************************118 99 LONG IsNCMouseMsg(Win32BaseWindow *win32wnd) 119 100 { -
trunk/src/user32/pmwindow.cpp
r10136 r10185 1 /* $Id: pmwindow.cpp,v 1.21 6 2003-06-03 11:58:37 sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.217 2003-07-28 11:27:47 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 52 52 #include <pmscan.h> 53 53 #include <winscan.h> 54 #include <oslibdnd.h> 54 55 #include <win\dbt.h> 55 56 #include "dragdrop.h" … … 1059 1060 rc = (MRFROM2SHORT (DOR_NEVERDROP, 0)); 1060 1061 } 1062 break; 1063 } 1064 1065 case DM_RENDER: 1066 { 1067 PDRAGTRANSFER pDragTransfer = (PDRAGTRANSFER)mp1; 1068 1069 dprintf(("OS2: DM_RENDER %x", pDragTransfer)); 1070 1071 rc = (MRESULT)OSLibRenderFormat(pDragTransfer); 1072 break; 1073 } 1074 1075 case DM_RENDERPREPARE: 1076 { 1077 PDRAGTRANSFER pDragTransfer = (PDRAGTRANSFER)mp1; 1078 1079 dprintf(("OS2: DM_RENDERPREPARE %x", pDragTransfer)); 1080 break; 1081 } 1082 1083 case DM_ENDCONVERSATION: 1084 { 1085 dprintf(("OS2: DM_ENDCONVERSATION")); 1086 rc = (MRESULT)OSLibEndConversation(); 1087 break; 1088 } 1089 1090 case DM_RENDERFILE: 1091 { 1092 dprintf(("OS2: DM_ENDCONVERSATION")); 1093 rc = FALSE; 1061 1094 break; 1062 1095 } … … 2284 2317 cItems = DrgQueryDragitemCount(pDragInfo); 2285 2318 2286 //compute rmemory required to hold all filenames2319 //compute memory required to hold all filenames 2287 2320 int bufsize = 0; 2288 2321 for (i = 0; i < cItems; i++) { -
trunk/src/user32/user32.cpp
r9601 r10185 1 /* $Id: user32.cpp,v 1.12 6 2003-01-03 17:20:04sandervl Exp $ */1 /* $Id: user32.cpp,v 1.127 2003-07-28 11:27:47 sandervl Exp $ */ 2 2 3 3 /* … … 696 696 break; 697 697 698 case SPI_SETMOUSESPEED: 699 dprintf(("USER32: SPI_SETMOUSESPEED is ignored, implement!\n")); 700 break; 701 698 702 case SPI_SETMOUSEBUTTONSWAP: 699 703 // TODO make this for Win32 apps only, Open32 changes OS/2 settings! -
trunk/src/user32/user32dbg.def
r10031 r10185 1 ; $Id: user32dbg.def,v 1.1 2 2003-04-23 18:00:59 sandervl Exp $1 ; $Id: user32dbg.def,v 1.13 2003-07-28 11:27:49 sandervl Exp $ 2 2 3 3 LIBRARY USER32 INITINSTANCE TERMINSTANCE … … 726 726 727 727 _CustForceMonoCursor@0 @2036 NONAME 728 729 _OSLibDragOver@12 @2038 NONAME 730 _OSLibDragLeave@4 @2039 NONAME 731 _OSLibDragDrop@16 @2040 NONAME 732 _OSLibCreateDragStruct@16 @2041 NONAME 733 _OSLibFreeDragStruct@4 @2042 NONAME -
trunk/src/user32/windowmsg.cpp
r10104 r10185 1 /* $Id: windowmsg.cpp,v 1.4 2 2003-05-16 10:59:28sandervl Exp $ */1 /* $Id: windowmsg.cpp,v 1.43 2003-07-28 11:27:50 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window message APIs for OS/2 … … 105 105 return FALSE; 106 106 } 107 107 108 108 // only WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP 109 109 // can go into TranslateMessage 110 110 111 111 return OSLibWinTranslateMessage((MSG *)msg); 112 112 } … … 140 140 { 141 141 BOOL fFoundMsg; 142 142 143 143 dprintf2(("PeekMessageA %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg)); 144 144 fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax, … … 314 314 * when the WM_SETTEXT message has been used to set the icon 315 315 */ 316 INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM *plparam )316 INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plparam ) 317 317 { 318 318 switch(msg) … … 321 321 { 322 322 LPARAM *ptr = (LPARAM *)HeapAlloc( GetProcessHeap(), 0, 323 wParam * sizeof(WCHAR) + sizeof(LPARAM) );323 *pwparam * sizeof(WCHAR) + sizeof(LPARAM) ); 324 324 if (!ptr) return -1; 325 325 *ptr++ = *plparam; /* Store previous lParam */ … … 431 431 return 1; 432 432 433 /* kso 2003-07-03: to make password field work, I took this from latest wine code. (winproc.c) */ 434 case EM_SETPASSWORDCHAR: 435 { 436 BYTE ch = LOWORD(*pwparam); 437 WCHAR wch = 0; 438 MultiByteToWideChar(CP_ACP, 0, (LPCSTR)&ch, 1, &wch, 1); 439 *pwparam = MAKEWPARAM( wch, HIWORD(*pwparam) ); 440 } 441 return 0; 442 433 443 case WM_ASKCBFORMATNAME: 434 444 case WM_DEVMODECHANGE: 435 445 case WM_PAINTCLIPBOARD: 436 446 case WM_SIZECLIPBOARD: 437 case EM_SETPASSWORDCHAR:438 447 // FIXME_(msg)("message %s (0x%x) needs translation, please report\n", SPY_GetMsgName(msg), msg ); 439 448 return -1; … … 810 819 LRESULT result; 811 820 812 if (WINPROC_MapMsg32ATo32W( hwnd, msg, wParam, &lParam ) == -1) return 0;821 if (WINPROC_MapMsg32ATo32W( hwnd, msg, &wParam, &lParam ) == -1) return 0; 813 822 result = func( hwnd, msg, wParam, lParam ); 814 823 WINPROC_UnmapMsg32ATo32W( hwnd, msg, wParam, lParam ); … … 911 920 //TODO: Ignoring all messages could be dangerous. But processing them, 912 921 //while the app doesn't expect any, isn't safe either. 913 if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 922 if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 914 923 { 915 924 if (msg.message == WM_QUIT) { … … 965 974 //TODO: Ignoring all messages could be dangerous. But processing them, 966 975 //while the app doesn't expect any, isn't safe either. 967 if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 976 if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 968 977 { 969 978 if (msg.message == WM_QUIT) { … … 971 980 return WAIT_ABANDONED; 972 981 } 973 982 974 983 /* otherwise dispatch it */ 975 984 DispatchMessageA(&msg); … … 1036 1045 //TODO: Ignoring all messages could be dangerous. But processing them, 1037 1046 //while the app doesn't expect any, isn't safe either. 1038 if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 1047 if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 1039 1048 { 1040 1049 if (msg.message == WM_QUIT) { -
trunk/src/user32/winmouse.cpp
r9019 r10185 1 /* $Id: winmouse.cpp,v 1.2 6 2002-08-16 16:49:05sandervl Exp $ */1 /* $Id: winmouse.cpp,v 1.27 2003-07-28 11:27:50 sandervl Exp $ */ 2 2 /* 3 3 * Win32 mouse functions … … 40 40 #include "hook.h" 41 41 42 #include <winkeyboard.h> 43 42 44 #define DBG_LOCALLOG DBG_winmouse 43 45 #include "dbglocal.h" … … 150 152 { 151 153 dprintf(("USER32: SetCapture %x; already set to that window; ignore", hwnd)); 154 //TODO: NT4 SP6 sends this message even now 155 //////// SendMessageA(hwndPrev, WM_CAPTURECHANGED, 0L, hwnd); 152 156 return hwndPrev; 153 157 } … … 252 256 INPUT i; 253 257 254 // format input packet255 258 i.type = INPUT_MOUSE; 256 259 i.mi.dx = dx; … … 292 295 // TranslateMessage posts an appropriate 293 296 // WM_CHAR message. 297 294 298 HWND hwnd = GetForegroundWindow(); 295 299 296 300 LPINPUT piBase = pInputs; 297 301 for (int i = 0; … … 305 309 { 306 310 PMOUSEINPUT p = (PMOUSEINPUT)&piBase->mi; 307 MSG msg; 308 309 // simulate mouse input message 310 // @@@PH 311 MSG msg; 312 HWND hwndCapture; 313 314 hwndCapture = GetCapture(); 315 if(hwndCapture) hwnd = hwndCapture; 316 317 if(p->dwFlags & MOUSEEVENTF_MOVE) 318 { 319 if(!(p->dwFlags & MOUSEEVENTF_ABSOLUTE)) { 320 POINT pt; 321 322 if(GetCursorPos(&pt) == TRUE) { 323 LONG relx = (LONG)p->dx; 324 LONG rely = (LONG)p->dy; 325 326 p->dx = pt.x + relx; 327 p->dy = pt.y + rely; 328 } 329 else { 330 DebugInt3(); 331 return 0; 332 } 333 } 334 SetCursorPos(p->dx, p->dy); 335 OSLibSendWinMessage(hwnd, WM_MOUSEMOVE); 336 } 337 338 if(p->dwFlags & MOUSEEVENTF_LEFTDOWN) 339 { 340 KeySetOverlayKeyState(VK_LBUTTON, KEYOVERLAYSTATE_DOWN); 341 OSLibSendWinMessage(hwnd, WM_LBUTTONDOWN); 342 } 343 if(p->dwFlags & MOUSEEVENTF_LEFTUP) 344 { 345 KeySetOverlayKeyState(VK_LBUTTON, KEYOVERLAYSTATE_DONTCARE); 346 OSLibSendWinMessage(hwnd, WM_LBUTTONUP); 347 } 348 if(p->dwFlags & MOUSEEVENTF_RIGHTDOWN) 349 { 350 KeySetOverlayKeyState(VK_RBUTTON, KEYOVERLAYSTATE_DOWN); 351 OSLibSendWinMessage(hwnd, WM_RBUTTONDOWN); 352 } 353 if(p->dwFlags & MOUSEEVENTF_RIGHTUP) 354 { 355 KeySetOverlayKeyState(VK_RBUTTON, KEYOVERLAYSTATE_DONTCARE); 356 OSLibSendWinMessage(hwnd, WM_RBUTTONUP); 357 } 358 if(p->dwFlags & MOUSEEVENTF_MIDDLEDOWN) 359 { 360 KeySetOverlayKeyState(VK_MBUTTON, KEYOVERLAYSTATE_DOWN); 361 OSLibSendWinMessage(hwnd, WM_MBUTTONDOWN); 362 } 363 if(p->dwFlags & MOUSEEVENTF_MIDDLEUP) 364 { 365 KeySetOverlayKeyState(VK_MBUTTON, KEYOVERLAYSTATE_DONTCARE); 366 OSLibSendWinMessage(hwnd, WM_MBUTTONUP); 367 } 311 368 } 312 369 break; … … 319 376 BOOL fUnicode = (p->dwFlags & KEYEVENTF_UNICODE) == KEYEVENTF_UNICODE; 320 377 DWORD extrainfo = GetMessageExtraInfo(); 378 379 //TODO: We should really send an OS/2 WM_CHAR message here and let 380 // our existing code handle everything (WM_CHAR generation) 381 // This is a quick and dirty implementation. Not entirely correct. 321 382 322 383 // build keyboard message … … 360 421 361 422 SetMessageExtraInfo( (LPARAM)p->dwExtraInfo ); 423 424 KeySetOverlayKeyState(msg.wParam, (msg.message == WM_KEYDOWN) ? KEYOVERLAYSTATE_DOWN : KEYOVERLAYSTATE_DONTCARE); 362 425 363 426 if (fUnicode) … … 365 428 else 366 429 SendMessageA(hwnd, msg.message, msg.wParam, msg.lParam); 367 430 431 if(msg.message == WM_KEYDOWN) { 432 char keybstate[256]; 433 WORD key = 0; 434 435 GetKeyboardState((LPBYTE)&keybstate[0]); 436 if(ToAscii(p->wVk, p->wScan, (LPBYTE)&keybstate[0], &key, 0) != 0) { 437 SendMessageA(hwnd, WM_CHAR, key, msg.lParam); 438 } 439 } 440 368 441 //restore extra info 369 442 SetMessageExtraInfo(extrainfo); … … 656 729 //****************************************************************************** 657 730 //****************************************************************************** 731 ULONG GetMouseKeyState() 732 { 733 ULONG keystate = 0; 734 735 if(GetKeyState(VK_LBUTTON) & 0x8000) 736 keystate |= MK_LBUTTON; 737 if(GetKeyState(VK_RBUTTON) & 0x8000) 738 keystate |= MK_RBUTTON; 739 if(GetKeyState(VK_MBUTTON) & 0x8000) 740 keystate |= MK_MBUTTON; 741 if(GetKeyState(VK_SHIFT) & 0x8000) 742 keystate |= MK_SHIFT; 743 if(GetKeyState(VK_CONTROL) & 0x8000) 744 keystate |= MK_CONTROL; 745 746 return keystate; 747 } 748 //****************************************************************************** 749 //****************************************************************************** -
trunk/src/user32/winmouse.h
r8347 r10185 1 /* $Id: winmouse.h,v 1. 8 2002-04-30 14:54:07sandervl Exp $ */1 /* $Id: winmouse.h,v 1.9 2003-07-28 11:27:51 sandervl Exp $ */ 2 2 /* 3 3 * Mouse handler for DINPUT … … 12 12 #define __WINMOUSE_H__ 13 13 14 ULONG GetMouseKeyState(); 15 14 16 #endif //__WINMOUSE_H__ -
trunk/src/winmm/waveindart.cpp
r9902 r10185 1 /* $Id: waveindart.cpp,v 1. 6 2003-03-05 14:49:04 sandervl Exp $ */1 /* $Id: waveindart.cpp,v 1.7 2003-07-28 11:30:44 sandervl Exp $ */ 2 2 3 3 /* … … 262 262 //TODO: don't do this here. Select line or mic depending on aux settings 263 263 //(until we really support the mixer extensions anyway) 264 /* Set the connector to ' line in' */264 /* Set the connector to 'microphone' */ 265 265 memset( &ConnectorParms, '\0', sizeof( MCI_CONNECTOR_PARMS ) ); 266 ConnectorParms.ulConnectorType = MCI_ LINE_IN_CONNECTOR;266 ConnectorParms.ulConnectorType = MCI_MICROPHONE_CONNECTOR; 267 267 rc = mymciSendCommand(DeviceId, MCI_CONNECTOR, MCI_WAIT | 268 268 MCI_ENABLE_CONNECTOR | MCI_CONNECTOR_TYPE, … … 311 311 wmutex.enter(); 312 312 if(State != STATE_RECORDING) { 313 dprintf(("Not recording!!")); 313 314 State = STATE_STOPPED; 314 315 wmutex.leave(); … … 342 343 return MMSYSERR_NOERROR; 343 344 } 344 if(State != STATE_RECORDING) {345 wmutex.leave();346 return(MMSYSERR_HANDLEBUSY);347 }348 345 wmutex.leave(); 349 346 … … 415 412 rc = mymciSendCommand(DeviceId, MCI_STATUS, MCI_STATUS_ITEM|MCI_WAIT, (PVOID)&mciStatus, 0); 416 413 if((rc & 0xFFFF) == MCIERR_SUCCESS) { 417 nrbytes = ( mciStatus.ulReturn * (getAvgBytesPerSecond()/1000));414 nrbytes = (((double)mciStatus.ulReturn * (double)getAvgBytesPerSecond())/1000.0); 418 415 return nrbytes;; 419 416 }
Note:
See TracChangeset
for help on using the changeset viewer.