Changeset 10185 for trunk/src


Ignore:
Timestamp:
Jul 28, 2003, 1:35:32 PM (22 years ago)
Author:
sandervl
Message:

Updates

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:43 sandervl Exp $ */
     1/* $Id: hmcomm.cpp,v 1.40 2003-07-28 11:35:31 sandervl Exp $ */
    22
    33/*
     
    1616#include <os2win.h>
    1717#include <string.h>
     18#include <stdio.h>
    1819#include <handlemanager.h>
    1920#include "handlenames.h"
     
    6465static char *DebugCommEvent(DWORD dwEvents);
    6566static char *DebugModemStatus(DWORD dwModemStatus);
     67#ifdef DEBUG_COMOUTPUT
     68static FILE *comlog = NULL;
     69#endif
    6670#endif
    6771//******************************************************************************
     
    117121    HandleNamesAddSymbolicLink("AUX:",       "COM1");
    118122    HandleNamesAddSymbolicLink("\\\\.\\AUX", "COM1");
     123#ifdef DEBUG_COMOUTPUT
     124    comlog = fopen("comlog", "w");
     125#endif
    119126}
    120127
     
    229236            return rc;
    230237        }
     238
    231239        rc = SetBaud(pHMHandleData,9600);
    232240        dprintf(("Init Baud to 9600 rc = %d",rc));
     
    328336
    329337    *lpdwResult = (ret) ? ulBytesRead : 0;
    330     dprintf2(("KERNEL32: CommReadIOHandler %d bytes read", *lpdwResult));
     338    dprintf(("KERNEL32: CommReadIOHandler %d bytes read", *lpdwResult));
    331339
    332340    if(ret == FALSE) {
     
    335343    else {
    336344#ifdef DEBUG
     345        if(ulBytesRead < qInfo.cch) {
     346            dprintf(("WARNING: Not all data removed from queue!!"));
     347        }
    337348        dprintf2(("%d Bytes read:", ulBytesRead));
    338349        for(int i=0;i<min(ulBytesRead, 16);i++) {
     
    372383    dprintf2(("KERNEL32:CommWriteIOHandler %d byte(s) written", *lpdwResult));
    373384
     385    if(ulBytesWritten != lpRequest->nNumberOfBytes) {
     386        dprintf(("WARNING: ulBytesWritten (%d) != lpRequest->nNumberOfBytes (%d)", ulBytesWritten, lpRequest->nNumberOfBytes));
     387    }
    374388    if(ret == FALSE) {
    375389       dprintf(("!ERROR!: CommWriteIOHandler failed with rc %d", GetLastError()));
     
    432446        dwEvent |= (COMEvt&0x0100)? EV_RING:0;
    433447 
     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
    434462        if((dwEvent & EV_RXCHAR) && (dwMask & EV_RXCHAR))
    435463        {
     
    509537    }
    510538
     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
    511546    if(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) {
    512547        return pDevData->iohandler->WriteFile(pHMHandleData->hWin32Handle, lpBuffer, nNumberOfBytesToWrite,
     
    517552                        &ulBytesWritten);
    518553
    519     if(lpNumberOfBytesWritten) {
     554    if(lpNumberOfBytesWritten) { 
    520555       *lpNumberOfBytesWritten = (ret) ? ulBytesWritten : 0;
    521556       dprintf2(("KERNEL32:HMDeviceCommClass::WriteFile %d byte(s) written", *lpNumberOfBytesWritten));
     
    593628        *lpNumberOfBytesRead = (ret) ? ulBytesRead : 0;
    594629        dprintf2(("KERNEL32:HMDeviceCommClass::ReadFile %d bytes read", *lpNumberOfBytesRead));
     630        if(qInfo.cch > ulBytesRead) {
     631            dprintf(("Warning: more bytes available!!"));
     632        }
    595633    }
    596634    if(ret == FALSE) {
     
    599637#ifdef DEBUG
    600638    else {
     639        int i;
    601640        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++) {
    603654            dprintf2(("%x %c", ((char *)lpBuffer)[i], ((char *)lpBuffer)[i]));
    604655        }
     
    893944  if(lpdwErrors == NULL)
    894945     lpdwErrors = &dwError;
    895 
     946 
    896947  dprintf(("HMDeviceCommClass::ClearCommError"));
    897948  ulLen = sizeof(USHORT);
     
    908959  *lpdwErrors |= (COMErr & 0x0008)?CE_FRAME:0;
    909960
     961  dprintf(("Error %x", *lpdwErrors));
    910962  if(lpcst)
    911963  {
     
    15301582    pCurDCB->XoffChar           = XoffChar;
    15311583    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
    15321605  }
    15331606
  • trunk/src/kernel32/kernelrsrc.orc

    r7832 r10185  
    1 /* $Id: kernelrsrc.orc,v 1.3 2002-02-07 16:34:52 sandervl Exp $ */
     1/* $Id: kernelrsrc.orc,v 1.4 2003-07-28 11:35:31 sandervl Exp $ */
    22
    33#include "winuser.h"
     
    4242
    4343#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.13 2000-10-20 11:46:47 sandervl Exp $ */
     1/* $Id: message.cpp,v 1.14 2003-07-28 11:35:31 sandervl Exp $ */
    22
    33/*
     
    6060        DWORD   offset;
    6161    } *se;
    62     struct      _stringentry {
    63         WORD    len;
    64         WORD    unknown;
    65         CHAR    str[1];
    66     } *stre;
     62    MESSAGE_RESOURCE_ENTRY *stre;
    6763
    6864    /*FIXME: I am not sure about the '1' ... But I've only seen those entries*/
     
    7874    for (i=nrofentries;i--;) {
    7975        if ((id>=se->firstentry) && (id<=se->lastentry)) {
    80             stre = (struct _stringentry*)(p+se->offset);
     76            stre = (PMESSAGE_RESOURCE_ENTRY)(p+se->offset);
    8177            id  -= se->firstentry;
    8278            break;
     
    8783        return 0;
    8884    for (i=id;i--;) {
    89         if (!(slen=stre->len))
     85        if (!(slen=stre->Length))
    9086                return 0;
    91         stre = (struct _stringentry*)(((char*)stre)+slen);
     87        stre = (PMESSAGE_RESOURCE_ENTRY)(((char*)stre)+slen);
    9288    }
    93     slen=stre->len;
     89    slen=stre->Length;
    9490
    9591    i = min(buflen - 1, slen);
     
    9793        return slen; /* different to LoadString */
    9894    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;
    101100    } else {
    102101        if (buflen>1) {
     
    166165   if (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)
    167166   {
    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      }
    170177   }
    171178
     
    415422   if (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)
    416423   {
    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      }
    420434   }
    421435
  • trunk/src/kernel32/overlappedio.cpp

    r9340 r10185  
    1 /* $Id: overlappedio.cpp,v 1.20 2002-10-10 16:28:40 sandervl Exp $ */
     1/* $Id: overlappedio.cpp,v 1.21 2003-07-28 11:35:32 sandervl Exp $ */
    22
    33/*
     
    8787        threadparam->lpOverlappedObj = this;
    8888        hThreadWrite = ::CreateThread(NULL, 32*1024, OverlappedIOThread, (LPVOID)threadparam, 0, &dwThreadId);
     89        SetThreadPriority(hThreadWrite, THREAD_PRIORITY_TIME_CRITICAL);
    8990        if(hThreadWrite) {//thread uses this object; keep reference count to avoid premature destruction
    9091            AddRef();
  • trunk/src/odincrt/critsect.cpp

    r9756 r10185  
    1 /* $Id: critsect.cpp,v 1.8 2003-02-06 10:30:02 sandervl Exp $ */
     1/* $Id: critsect.cpp,v 1.9 2003-07-28 11:30:17 sandervl Exp $ */
    22/*
    33 * Critical sections in the Win32 sense
    4  * 
     4 *
    55 * Copyright 2002 Sander van Leeuwen <sandervl@innotek.de>
    66 *
     
    1212#include <win32type.h>
    1313#include <win32api.h>
     14#include <FastInfoBlocks.h>
    1415
    1516#include <assert.h>
     
    2324#define DebugInt3()
    2425#endif
     26
    2527
    2628//******************************************************************************
     
    4244inline ULONG GetCurrentThreadId()
    4345{
     46#ifdef fibGetPid
     47    return MAKE_THREADID(fibGetPid(), fibGetTid());
     48#else
    4449    PTIB   ptib;
    4550    PPIB   ppib;
    4651    APIRET rc;
    47  
     52
    4853    rc = DosGetInfoBlocks(&ptib, &ppib);
    4954    if(rc == NO_ERROR) {
     
    5762    DebugInt3();
    5863    return 0;
     64#endif
    5965}
    6066//******************************************************************************
     
    6268inline ULONG GetCurrentProcessId()
    6369{
     70#ifdef fibGetPid
     71    return fibGetPid();
     72#else
    6473    PTIB   ptib;
    6574    PPIB   ppib;
    6675    APIRET rc;
    67  
     76
    6877    rc = DosGetInfoBlocks(&ptib, &ppib);
    6978    if(rc == NO_ERROR) {
     
    7281    DebugInt3();
    7382    return 0;
     83#endif
    7484}
    7585
     
    7787 *           DosInitializeCriticalSection
    7888 */
    79 ULONG WIN32API DosInitializeCriticalSection(CRITICAL_SECTION_OS2 *crit, 
     89ULONG WIN32API DosInitializeCriticalSection(CRITICAL_SECTION_OS2 *crit,
    8090                                            PSZ pszSemName, BOOL fShared)
    8191{
     
    131141    {
    132142#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 */
    134146        {
    135147           DebugInt3();
     
    181193        ULONG ulnrposts;
    182194
    183         // now wait for it 
     195        // now wait for it
    184196        APIRET rc = DosWaitEventSem(crit->hmtxLock, ulTimeout);
    185197        if(rc != NO_ERROR) {
     
    206218        return ERROR_INVALID_PARAMETER;
    207219    }
    208        
     220
    209221    if (--crit->RecursionCount)
    210222    {
  • trunk/src/odincrt/file.cpp

    r9709 r10185  
    1 /* $Id: file.cpp,v 1.4 2003-01-22 17:06:42 sandervl Exp $ */
     1/* $Id: file.cpp,v 1.5 2003-07-28 11:30:17 sandervl Exp $ */
    22/*
    33 * Project Odin Software License can be found in LICENSE.TXT
     
    232232}
    233233
     234
     235char * _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:04 sandervl Exp $
     1; $Id: odin36.def,v 1.10 2003-07-28 11:30:17 sandervl Exp $
    22; Odin VAC++ 3.6.5 shared multithreaded runtime
    33LIBRARY ODINCRT INITINSTANCE TERMINSTANCE
     
    5454
    5555    odin_fdopen                                           @605 NONAME
     56
     57    odin_tmpnam                                           @409 NONAME
    5658
    5759    __nw__FUiPCcT1                                      @172  NONAME
     
    450452    stdout                                            @407  NONAME
    451453    wcslen                                            @408  NONAME
    452     tmpnam                                            @409  NONAME
     454;;    tmpnam                                            @409  NONAME
    453455    rewind                                            @410  NONAME
    454456    wctype                                            @411  NONAME
  • trunk/src/odincrt/odin36d.def

    r9715 r10185  
    1 ; $Id: odin36d.def,v 1.9 2003-01-23 12:33:05 sandervl Exp $
     1; $Id: odin36d.def,v 1.10 2003-07-28 11:30:18 sandervl Exp $
    22; Odin VAC++ 3.6.5 shared multithreaded runtime
    33LIBRARY ODINCRTD INITINSTANCE TERMINSTANCE
     
    5454
    5555    odin_fdopen                                           @605 NONAME
     56
     57    odin_tmpnam                                           @409 NONAME
    5658
    5759    __nw__FUiPCcT1                                      @172  NONAME
     
    450452    stdout                                            @407  NONAME
    451453    wcslen                                            @408  NONAME
    452     tmpnam                                            @409  NONAME
     454;;    tmpnam                                            @409  NONAME
    453455    rewind                                            @410  NONAME
    454456    wctype                                            @411  NONAME
  • trunk/src/odincrt/odincrt.def

    r9715 r10185  
    1 ; $Id: odincrt.def,v 1.29 2003-01-23 12:33:05 sandervl Exp $
     1; $Id: odincrt.def,v 1.30 2003-07-28 11:30:19 sandervl Exp $
    22; Odin VAC++ 3.08 shared multithreaded runtime
    33LIBRARY ODINCRT INITINSTANCE TERMINSTANCE
     
    5454
    5555    odin_fdopen                                           @605 NONAME
     56
     57    odin_tmpnam                                           @409 NONAME
    5658
    5759    __nw__FUiPCcT1                                      @172  NONAME
     
    453455    stdout                                            @407  NONAME
    454456    wcslen                                            @408  NONAME
    455     tmpnam                                            @409  NONAME
     457;;    tmpnam                                            @409  NONAME
    456458    rewind                                            @410  NONAME
    457459    wctype                                            @411  NONAME
  • trunk/src/odincrt/odincrtd.def

    r9715 r10185  
    1 ; $Id: odincrtd.def,v 1.10 2003-01-23 12:33:06 sandervl Exp $
     1; $Id: odincrtd.def,v 1.11 2003-07-28 11:30:19 sandervl Exp $
    22; Odin VAC++ 3.08 shared multithreaded runtime
    33LIBRARY ODINCRTD INITINSTANCE TERMINSTANCE
     
    5454
    5555    odin_fdopen                                           @605 NONAME
     56
     57    odin_tmpnam                                           @409 NONAME
    5658
    5759    __nw__FUiPCcT1                                      @172  NONAME
     
    450452    stdout                                            @407  NONAME
    451453    wcslen                                            @408  NONAME
    452     tmpnam                                            @409  NONAME
     454;;    tmpnam                                            @409  NONAME
    453455    rewind                                            @410  NONAME
    454456    wctype                                            @411  NONAME
  • trunk/src/odincrt/odincrtp.def

    r9715 r10185  
    1 ; $Id: odincrtp.def,v 1.7 2003-01-23 12:33:06 sandervl Exp $
     1; $Id: odincrtp.def,v 1.8 2003-07-28 11:30:20 sandervl Exp $
    22; Odin VAC++ 3.08 shared multithreaded runtime
    33LIBRARY ODINCRTP INITINSTANCE TERMINSTANCE
     
    6565
    6666    odin_fdopen                                           @605 NONAME
     67
     68    odin_tmpnam                                           @409 NONAME
    6769
    6870    __nw__FUiPCcT1                                      @172  NONAME
     
    461463    stdout                                            @407  NONAME
    462464    wcslen                                            @408  NONAME
    463     tmpnam                                            @409  NONAME
     465;;    tmpnam                                            @409  NONAME
    464466    rewind                                            @410  NONAME
    465467    wctype                                            @411  NONAME
  • trunk/src/ole32/ole2.c

    r8973 r10185  
    166166static DWORD OLEDD_GetButtonState();
    167167
     168#ifdef __WIN32OS2__
     169static IDropTarget *IDropTarget_Constructor();
     170
     171HWND hwndTracker = 0;
     172#endif
    168173
    169174/******************************************************************************
     
    561566  trackerInfo.curDragTarget     = 0;
    562567
     568#ifdef __WIN32OS2__
     569  IDataObject_AddRef(trackerInfo.dataObject);
     570#endif
     571
    563572  hwndTrackWindow = CreateWindowA(OLEDD_DRAGTRACKERCLASS,
    564573                                    "TrackerWindow",
     
    573582  if (hwndTrackWindow!=0)
    574583  {
     584#ifdef __WIN32OS2__
     585    hwndTracker = hwndTrackWindow;
     586#endif
    575587    /*
    576588     * Capture the mouse input
     
    619631    DestroyWindow(hwndTrackWindow);
    620632
     633#ifdef __WIN32OS2__
     634    IDataObject_Release(trackerInfo.dataObject);
     635#endif
     636
    621637    return trackerInfo.returnValue;
    622638  }
     639
     640#ifdef __WIN32OS2__
     641  IDataObject_Release(trackerInfo.dataObject);
     642#endif
    623643
    624644  return E_FAIL;
     
    16361656 
    16371657    RegisterClassA (&wndClass);
     1658
     1659#ifdef __WIN32OS2__
     1660    {
     1661      IDropTarget *desktopdnd;
     1662
     1663      desktopdnd = IDropTarget_Constructor();
     1664      RegisterDragDrop(GetDesktopWindow(), desktopdnd);
     1665    }
     1666#endif
    16381667}
    16391668
     
    19341963   */
    19351964  hwndNewTarget = WindowFromPoint(mousePos);
     1965
     1966#ifdef __WIN32OS2__
     1967  dprintf(("OLEDD_TrackMouseMove: hwndNewTarget %x current %x", hwndNewTarget, trackerInfo->curDragTargetHWND));
     1968#endif
    19361969
    19371970  /*
     
    25122545    dprintf(("IDataObject_fnGetData %x %x", pformatetcIn, pmedium));
    25132546
    2514         if(pformatetcIn->cfFormat != CF_HDROP)
     2547        if(pformatetcIn->cfFormat != CF_HDROP && pformatetcIn->cfFormat != CF_TEXT && pformatetcIn->cfFormat != CF_UNICODETEXT)
    25152548        {
    25162549        FIXME("-- expected clipformat not implemented\n");
     
    28832916//******************************************************************************
    28842917//******************************************************************************
     2918
     2919#include <oslibdnd.h>
     2920
     2921typedef 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*/
     2941static 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*/
     2971static 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*/
     2983static 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*/
     3007static 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//******************************************************************************
     3024static 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//******************************************************************************
     3159static 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//******************************************************************************
     3175static 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//******************************************************************************
     3188static 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
     3205static 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*/
     3221static 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
    28853240#endif
    28863241
  • trunk/src/ole32/ole32.mak

    r9400 r10185  
    1 # $Id: ole32.mak,v 1.21 2002-11-12 17:06:02 sandervl Exp $
     1# $Id: ole32.mak,v 1.22 2003-07-28 11:32:05 sandervl Exp $
    22
    33#
     
    5050$(OBJDIR)\imessagefilter.obj \
    5151$(OBJDIR)\memlockbytes.obj \
     52!if "$(DEBUG)" == "1"
    5253$(OBJDIR)\oString.obj \
     54!endif
    5355$(OBJDIR)\ole2impl.obj \
    5456$(OBJDIR)\ole2.obj \
  • trunk/src/olepro32/olepro32.cpp

    r3931 r10185  
    1 /* $Id: olepro32.cpp,v 1.2 2000-08-02 16:29:41 bird Exp $ */
     1/* $Id: olepro32.cpp,v 1.3 2003-07-28 11:29:30 sandervl Exp $ */
    22/*
    33 * OlePro32 Stubs
     
    5959}
    6060
    61 HRESULT WINAPI DllUnregisterServer()
     61HRESULT WINAPI OLEPRO32_DllUnregisterServer()
    6262{
    6363        dprintf(("not implemented (olepro32.dll) \n"));
     
    6565}
    6666
    67 HRESULT WINAPI DllRegisterServer()
     67HRESULT WINAPI OLEPRO32_DllRegisterServer()
    6868{
    6969        dprintf(("not implemented (olepro32.dll) \n"));
     
    7171}
    7272
    73 HRESULT WINAPI DllCanUnloadNow( )
     73HRESULT WINAPI OLEPRO32_DllCanUnloadNow( )
    7474{
    7575        dprintf(("not implemented (olepro32.dll) \n"));
     
    7777}
    7878
    79 HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, LPVOID* ppv )
     79HRESULT WINAPI OLEPRO32_DllGetClassObject( REFCLSID rclsid, REFIID riid, LPVOID* ppv )
    8080{
    8181        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 bird Exp $
     1; $Id: olepro32.def,v 1.3 2003-07-28 11:29:30 sandervl Exp $
    22
    33;
     
    99
    1010EXPORTS
    11    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          = _DllCanUnloadNow@0        @255
    19    DllGetClassObject            = _DllGetClassObject@12     @256
    20    DllRegisterServer            = _DllRegisterServer@0      @257
    21    DllUnregisterServer          = _DllUnregisterServer@0    @258
     11   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:44 sandervl Exp $ */
     1/* $Id: enumidlist.c,v 1.7 2003-07-28 11:28:56 sandervl Exp $ */
    22/*
    33 *      IEnumIDList
     
    202202              for (x = 0;x < count;x++)
    203203              {
     204                if ( !(dwFlags & SHCONTF_INCLUDEHIDDEN) && (stffile[x].dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ) continue;
     205
    204206                if (stffile[x].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
    205207                { //directory
     
    247249              for (x = 0;x < count;x++)
    248250              {
     251                if ( !(dwFlags & SHCONTF_INCLUDEHIDDEN) && (stffile[x].dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ) continue;
     252
    249253                if (! (stffile[x].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
    250254                {
  • trunk/src/shell32/shlfolder.c

    r9885 r10185  
    235235 * This functions does not set flags!! It only resets flags when nessesary.
    236236 */
     237#include <dbglog.h>
    237238static HRESULT SHELL32_GetItemAttributes(
    238239        IShellFolder * psf,
     
    240241        LPDWORD pdwAttributes)
    241242{
     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
    242296        GUID const * clsid;
    243297        DWORD dwAttributes;
     
    284338        TRACE("-- 0x%08lx\n", *pdwAttributes);
    285339        return S_OK;
     340#endif
    286341}
    287342
     
    18091864             if (!SUCCEEDED(SHELL32_CoCreateInitSF (This->absPidl, pidl, clsid, riid, (LPVOID*)&pShellFolder)))
    18101865             {
     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
    18111872               return E_INVALIDARG;
     1873#endif
    18121874             }
    18131875          }
  • trunk/src/user32/Makefile

    r9930 r10185  
    1 # $Id: Makefile,v 1.106 2003-03-20 13:20:44 sandervl Exp $
     1# $Id: Makefile,v 1.107 2003-07-28 11:27:44 sandervl Exp $
    22
    33#
     
    111111$(OBJDIR)\oslibprf.obj \
    112112$(OBJDIR)\dragdrop.obj \
     113$(OBJDIR)\oslibdnd.obj \
    113114!ifdef DEBUG
    114115$(OBJDIR)\dbgwrap.obj \
  • trunk/src/user32/USER32.DEF

    r10031 r10185  
    1 ; $Id: USER32.DEF,v 1.79 2003-04-23 18:00:58 sandervl Exp $
     1; $Id: USER32.DEF,v 1.80 2003-07-28 11:27:44 sandervl Exp $
    22
    33LIBRARY USER32 INITINSTANCE TERMINSTANCE
     
    728728    _CustForceMonoCursor@0                                       @2036 NONAME
    729729
     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:14 sandervl Exp $ */
     1/* $Id: dragdrop.cpp,v 1.4 2003-07-28 11:27:45 sandervl Exp $ */
    22
    33/*
     
    3131    DWORD      dwExStyle;
    3232    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
    3436    dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
    3537
     
    6668BOOL DragDropDragOver(HWND hwnd, DWORD dwEffect)
    6769{
     70    dprintf(("DragDropDragOver %x %x", hwnd, dwEffect));
    6871    if(pfnDragOver) {
    6972        return pfnDragOver(hwnd, dwEffect);
     
    7881    DROPFILES *pDropFile;
    7982    HGLOBAL    hDropFile;
     83
     84    dprintf(("DragDropDragEnter %x (%d,%d) %d %s %d %d", hwnd, point.x, point.y, cFiles, pszFiles, cbszFiles, fNonClient));
    8085
    8186    if(pfnDragEnter) {
     
    103108BOOL DragDropDragLeave(HWND hwnd)
    104109{
     110    dprintf(("DragDropDragLeave %x", hwnd));
    105111    if(pfnDragLeave) {
    106112        return pfnDragLeave(hwnd);
     
    113119{
    114120    DWORD      dwExStyle;
     121
     122    dprintf(("DragDropDragAccept %x", hwnd));
    115123
    116124    dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
  • trunk/src/user32/oslibmsg.cpp

    r10122 r10185  
    1 /* $Id: oslibmsg.cpp,v 1.70 2003-05-27 10:52:25 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.71 2003-07-28 11:27:45 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    746746    return (ULONG)WinSendMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), pvMsgPacket);
    747747}
    748 
     748//******************************************************************************
     749//******************************************************************************
     750BOOL OSLibSendWinMessage(HWND hwnd, ULONG winmsg)
     751{
     752    return (BOOL)WinSendMsg(Win32ToOS2Handle(hwnd), TranslateWinMsg(winmsg, TRUE), 0, 0);
     753}
    749754//******************************************************************************
    750755//******************************************************************************
  • trunk/src/user32/oslibmsg.h

    r10012 r10185  
    1 /* $Id: oslibmsg.h,v 1.20 2003-04-11 14:22:05 sandervl Exp $ */
     1/* $Id: oslibmsg.h,v 1.21 2003-07-28 11:27:45 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    5555ULONG OSLibSendMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode);
    5656ULONG OSLibWinBroadcastMsg(ULONG msg, ULONG wParam, ULONG lParam, BOOL fSend);
     57BOOL  OSLibSendWinMessage(HWND hwnd, ULONG winmsg);
    5758
    5859//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.110 2003-05-16 10:59:27 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.111 2003-07-28 11:27:46 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    9797//******************************************************************************
    9898//******************************************************************************
    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 //******************************************************************************
    11899LONG IsNCMouseMsg(Win32BaseWindow *win32wnd)
    119100{
  • trunk/src/user32/pmwindow.cpp

    r10136 r10185  
    1 /* $Id: pmwindow.cpp,v 1.216 2003-06-03 11:58:37 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.217 2003-07-28 11:27:47 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    5252#include <pmscan.h>
    5353#include <winscan.h>
     54#include <oslibdnd.h>
    5455#include <win\dbt.h>
    5556#include "dragdrop.h"
     
    10591060            rc = (MRFROM2SHORT (DOR_NEVERDROP, 0));
    10601061        }
     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;
    10611094        break;
    10621095    }
     
    22842317    cItems = DrgQueryDragitemCount(pDragInfo);
    22852318
    2286     //computer memory required to hold all filenames
     2319    //compute memory required to hold all filenames
    22872320    int bufsize = 0;
    22882321    for (i = 0; i < cItems; i++) {
  • trunk/src/user32/user32.cpp

    r9601 r10185  
    1 /* $Id: user32.cpp,v 1.126 2003-01-03 17:20:04 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.127 2003-07-28 11:27:47 sandervl Exp $ */
    22
    33/*
     
    696696        break;
    697697
     698    case SPI_SETMOUSESPEED:
     699        dprintf(("USER32: SPI_SETMOUSESPEED is ignored, implement!\n"));
     700        break;
     701
    698702    case SPI_SETMOUSEBUTTONSWAP:
    699703        // 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.12 2003-04-23 18:00:59 sandervl Exp $
     1; $Id: user32dbg.def,v 1.13 2003-07-28 11:27:49 sandervl Exp $
    22
    33LIBRARY USER32 INITINSTANCE TERMINSTANCE
     
    726726
    727727    _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.42 2003-05-16 10:59:28 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.43 2003-07-28 11:27:50 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    105105        return FALSE;
    106106    }
    107  
     107
    108108    // only WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP
    109109    // can go into TranslateMessage
    110  
     110
    111111    return OSLibWinTranslateMessage((MSG *)msg);
    112112}
     
    140140{
    141141    BOOL fFoundMsg;
    142  
     142
    143143    dprintf2(("PeekMessageA %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg));
    144144    fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax,
     
    314314 *  when the WM_SETTEXT message has been used to set the icon
    315315 */
    316 INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM *plparam )
     316INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plparam )
    317317{
    318318    switch(msg)
     
    321321        {
    322322            LPARAM *ptr = (LPARAM *)HeapAlloc( GetProcessHeap(), 0,
    323                                      wParam * sizeof(WCHAR) + sizeof(LPARAM) );
     323                                     *pwparam * sizeof(WCHAR) + sizeof(LPARAM) );
    324324            if (!ptr) return -1;
    325325            *ptr++ = *plparam;  /* Store previous lParam */
     
    431431        return 1;
    432432
     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
    433443    case WM_ASKCBFORMATNAME:
    434444    case WM_DEVMODECHANGE:
    435445    case WM_PAINTCLIPBOARD:
    436446    case WM_SIZECLIPBOARD:
    437     case EM_SETPASSWORDCHAR:
    438447        // FIXME_(msg)("message %s (0x%x) needs translation, please report\n", SPY_GetMsgName(msg), msg );
    439448        return -1;
     
    810819    LRESULT result;
    811820
    812     if (WINPROC_MapMsg32ATo32W( hwnd, msg, wParam, &lParam ) == -1) return 0;
     821    if (WINPROC_MapMsg32ATo32W( hwnd, msg, &wParam, &lParam ) == -1) return 0;
    813822    result = func( hwnd, msg, wParam, lParam );
    814823    WINPROC_UnmapMsg32ATo32W( hwnd, msg, wParam, lParam );
     
    911920              //TODO: Ignoring all messages could be dangerous. But processing them,
    912921              //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))
    914923              {
    915924                  if (msg.message == WM_QUIT) {
     
    965974                //TODO: Ignoring all messages could be dangerous. But processing them,
    966975                //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))
    968977                {
    969978                    if (msg.message == WM_QUIT) {
     
    971980                         return WAIT_ABANDONED;
    972981                    }
    973    
     982
    974983                    /* otherwise dispatch it */
    975984                    DispatchMessageA(&msg);
     
    10361045        //TODO: Ignoring all messages could be dangerous. But processing them,
    10371046        //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))
    10391048        {
    10401049            if (msg.message == WM_QUIT) {
  • trunk/src/user32/winmouse.cpp

    r9019 r10185  
    1 /* $Id: winmouse.cpp,v 1.26 2002-08-16 16:49:05 sandervl Exp $ */
     1/* $Id: winmouse.cpp,v 1.27 2003-07-28 11:27:50 sandervl Exp $ */
    22/*
    33 * Win32 mouse functions
     
    4040#include "hook.h"
    4141
     42#include <winkeyboard.h>
     43
    4244#define DBG_LOCALLOG    DBG_winmouse
    4345#include "dbglocal.h"
     
    150152  {
    151153    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);
    152156    return hwndPrev;
    153157  }
     
    252256  INPUT i;
    253257 
    254   // format input packet
    255258  i.type           = INPUT_MOUSE;
    256259  i.mi.dx          = dx;
     
    292295  // TranslateMessage posts an appropriate
    293296  // WM_CHAR message.
     297
    294298  HWND hwnd = GetForegroundWindow();
    295  
     299   
    296300  LPINPUT piBase = pInputs;
    297301  for (int i = 0;
     
    305309      {
    306310        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        }
    311368      } 
    312369      break;
     
    319376        BOOL fUnicode = (p->dwFlags & KEYEVENTF_UNICODE) == KEYEVENTF_UNICODE;
    320377        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.
    321382       
    322383        // build keyboard message
     
    360421
    361422        SetMessageExtraInfo( (LPARAM)p->dwExtraInfo );
     423
     424        KeySetOverlayKeyState(msg.wParam, (msg.message == WM_KEYDOWN) ? KEYOVERLAYSTATE_DOWN : KEYOVERLAYSTATE_DONTCARE);
    362425       
    363426        if (fUnicode)
     
    365428        else
    366429          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
    368441        //restore extra info
    369442        SetMessageExtraInfo(extrainfo);
     
    656729//******************************************************************************
    657730//******************************************************************************
     731ULONG 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:07 sandervl Exp $ */
     1/* $Id: winmouse.h,v 1.9 2003-07-28 11:27:51 sandervl Exp $ */
    22/*
    33 * Mouse handler for DINPUT
     
    1212#define __WINMOUSE_H__
    1313
     14ULONG GetMouseKeyState();
     15
    1416#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 $ */
    22
    33/*
     
    262262        //TODO: don't do this here. Select line or mic depending on aux settings
    263263        //(until we really support the mixer extensions anyway)
    264         /* Set the connector to 'line in' */
     264        /* Set the connector to 'microphone' */
    265265        memset( &ConnectorParms, '\0', sizeof( MCI_CONNECTOR_PARMS ) );
    266         ConnectorParms.ulConnectorType = MCI_LINE_IN_CONNECTOR;
     266        ConnectorParms.ulConnectorType = MCI_MICROPHONE_CONNECTOR;
    267267        rc = mymciSendCommand(DeviceId, MCI_CONNECTOR, MCI_WAIT |
    268268                              MCI_ENABLE_CONNECTOR | MCI_CONNECTOR_TYPE,
     
    311311    wmutex.enter();
    312312    if(State != STATE_RECORDING) {
     313        dprintf(("Not recording!!"));
    313314        State = STATE_STOPPED;
    314315        wmutex.leave();
     
    342343        return MMSYSERR_NOERROR;
    343344    }
    344     if(State != STATE_RECORDING) {
    345         wmutex.leave();
    346         return(MMSYSERR_HANDLEBUSY);
    347     }
    348345    wmutex.leave();
    349346
     
    415412    rc = mymciSendCommand(DeviceId, MCI_STATUS, MCI_STATUS_ITEM|MCI_WAIT, (PVOID)&mciStatus, 0);
    416413    if((rc & 0xFFFF) == MCIERR_SUCCESS) {
    417         nrbytes = (mciStatus.ulReturn * (getAvgBytesPerSecond()/1000));
     414        nrbytes = (((double)mciStatus.ulReturn * (double)getAvgBytesPerSecond())/1000.0);
    418415        return nrbytes;;
    419416    }
Note: See TracChangeset for help on using the changeset viewer.