Changeset 10432 for trunk/src/ole32/ole2.c
- Timestamp:
 - Jan 30, 2004, 11:11:42 PM (22 years ago)
 - File:
 - 
      
- 1 edited
 
- 
          
  trunk/src/ole32/ole2.c (modified) (144 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
trunk/src/ole32/ole2.c
r10185 r10432 5 5 * Copyright 1995 Martin von Loewis 6 6 * Copyright 1999 Francis Beaudet 7 * Copyright 1999 Noel Borthwick 7 * Copyright 1999 Noel Borthwick 8 8 * 9 9 * This library is free software; you can redistribute it and/or … … 39 39 40 40 #include "wine/obj_clientserver.h" 41 #ifdef __WIN32OS2__ /* we've got older headers! */ 42 #include "wine/obj_propertystorage.h" 43 #include "wine/obj_oleaut.h" 44 #endif 41 45 #include "wine/winbase16.h" 42 46 #include "wine/wingdi16.h" … … 50 54 51 55 /****************************************************************************** 52 * These are static/global variables and internal data structures that the 56 * These are static/global variables and internal data structures that the 53 57 * OLE module uses to maintain it's state. 54 58 */ … … 76 80 77 81 BOOL escPressed; 78 HWND curDragTargetHWND; 82 HWND curTargetHWND; /* window the mouse is hovering over */ 83 HWND curDragTargetHWND; /* might be a ancestor of curTargetHWND */ 79 84 IDropTarget* curDragTarget; 80 85 } TrackerWindowInfo; … … 117 122 118 123 /****************************************************************************** 119 * These are the prototypes of miscelaneous utility methods 124 * These are the prototypes of miscelaneous utility methods 120 125 */ 121 126 static void OLEUTL_ReadRegistryDWORDValue(HKEY regKey, DWORD* pdwValue); … … 124 129 * These are the prototypes of the utility methods used to manage a shared menu 125 130 */ 126 static void OLEMenu_Initialize(); 127 static void OLEMenu_UnInitialize(); 131 #ifdef __WIN32OS2__ 132 /* Changed () -> (void) as () isn't a prototype good enought for VAC. */ 133 #endif 134 static void OLEMenu_Initialize(void); 135 static void OLEMenu_UnInitialize(void); 128 136 BOOL OLEMenu_InstallHooks( DWORD tid ); 129 137 BOOL OLEMenu_UnInstallHooks( DWORD tid ); … … 137 145 * These are the prototypes of the OLE Clipboard initialization methods (in clipboard.c) 138 146 */ 139 void OLEClipbrd_UnInitialize( );140 void OLEClipbrd_Initialize( );147 void OLEClipbrd_UnInitialize(void); 148 void OLEClipbrd_Initialize(void); 141 149 142 150 /****************************************************************************** 143 151 * These are the prototypes of the utility methods used for OLE Drag n Drop 144 152 */ 145 static void OLEDD_Initialize( );146 static void OLEDD_UnInitialize( );153 static void OLEDD_Initialize(void); 154 static void OLEDD_UnInitialize(void); 147 155 static void OLEDD_InsertDropTarget( 148 156 DropTargetNode* nodeToAdd); … … 152 160 HWND hwndOfTarget); 153 161 static LRESULT WINAPI OLEDD_DragTrackerWindowProc( 154 HWND hwnd, 162 HWND hwnd, 155 163 UINT uMsg, 156 WPARAM wParam, 164 WPARAM wParam, 157 165 LPARAM lParam); 158 166 static void OLEDD_TrackMouseMove( … … 164 172 POINT mousePos, 165 173 DWORD keyState); 166 static DWORD OLEDD_GetButtonState( );174 static DWORD OLEDD_GetButtonState(void); 167 175 168 176 #ifdef __WIN32OS2__ 169 static IDropTarget *IDropTarget_Constructor( );177 static IDropTarget *IDropTarget_Constructor(void); 170 178 171 179 HWND hwndTracker = 0; … … 174 182 /****************************************************************************** 175 183 * OleBuildVersion [OLE2.1] 176 * OleBuildVersion [OLE32. 84]184 * OleBuildVersion [OLE32.@] 177 185 */ 178 186 DWORD WINAPI OleBuildVersion(void) … … 184 192 /*********************************************************************** 185 193 * OleInitialize (OLE2.2) 186 * OleInitialize (OLE32. 108)194 * OleInitialize (OLE32.@) 187 195 */ 188 196 HRESULT WINAPI OleInitialize(LPVOID reserved) … … 198 206 199 207 /* 200 * If the CoInitializeEx call failed, the OLE libraries can't be 208 * If the CoInitializeEx call failed, the OLE libraries can't be 201 209 * initialized. 202 210 */ 203 211 if (FAILED(hr)) 204 return hr; 212 return hr; 205 213 206 214 /* … … 214 222 if (OLE_moduleLockCount==0) 215 223 { 216 /* 224 /* 217 225 * Initialize the libraries. 218 226 */ … … 238 246 * Then, we increase the lock count on the OLE module. 239 247 */ 240 OLE_moduleLockCount++; 248 OLE_moduleLockCount++; 241 249 242 250 return hr; … … 245 253 /****************************************************************************** 246 254 * CoGetCurrentProcess [COMPOBJ.34] 247 * CoGetCurrentProcess [OLE32. 18]255 * CoGetCurrentProcess [OLE32.@] 248 256 * 249 257 * NOTES … … 257 265 /****************************************************************************** 258 266 * OleUninitialize [OLE2.3] 259 * OleUninitialize [OLE32. 131]267 * OleUninitialize [OLE32.@] 260 268 */ 261 269 void WINAPI OleUninitialize(void) … … 287 295 */ 288 296 OLEDD_UnInitialize(); 289 297 290 298 /* 291 299 * OLE shared menu … … 293 301 OLEMenu_UnInitialize(); 294 302 } 295 303 296 304 /* 297 305 * Then, uninitialize the COM libraries. … … 301 309 302 310 /****************************************************************************** 303 * CoRegisterMessageFilter [OLE32. 38]311 * CoRegisterMessageFilter [OLE32.@] 304 312 */ 305 313 HRESULT WINAPI CoRegisterMessageFilter( … … 315 323 316 324 /****************************************************************************** 317 * OleInitializeWOW [OLE32. 109]325 * OleInitializeWOW [OLE32.@] 318 326 */ 319 327 HRESULT WINAPI OleInitializeWOW(DWORD x) { … … 323 331 324 332 /*********************************************************************** 325 * RegisterDragDrop (OLE2.35) 326 */ 327 HRESULT WINAPI RegisterDragDrop16( 328 HWND16 hwnd, 329 LPDROPTARGET pDropTarget 330 ) { 331 FIXME("(0x%04x,%p),stub!\n",hwnd,pDropTarget); 332 return S_OK; 333 } 334 335 /*********************************************************************** 336 * RegisterDragDrop (OLE32.139) 333 * RegisterDragDrop (OLE32.@) 337 334 */ 338 335 HRESULT WINAPI RegisterDragDrop( 339 336 HWND hwnd, 340 LPDROPTARGET pDropTarget) 337 LPDROPTARGET pDropTarget) 341 338 { 342 339 DropTargetNode* dropTargetInfo; 343 340 344 TRACE("( 0x%x,%p)\n", hwnd, pDropTarget);341 TRACE("(%p,%p)\n", hwnd, pDropTarget); 345 342 346 343 /* … … 375 372 dropTargetInfo->dropTarget = pDropTarget; 376 373 IDropTarget_AddRef(dropTargetInfo->dropTarget); 377 374 378 375 OLEDD_InsertDropTarget(dropTargetInfo); 379 376 … … 382 379 383 380 /*********************************************************************** 384 * RevokeDragDrop (OLE2.36) 385 */ 386 HRESULT WINAPI RevokeDragDrop16( 387 HWND16 hwnd 388 ) { 389 FIXME("(0x%04x),stub!\n",hwnd); 390 return S_OK; 391 } 392 393 /*********************************************************************** 394 * RevokeDragDrop (OLE32.141) 381 * RevokeDragDrop (OLE32.@) 395 382 */ 396 383 HRESULT WINAPI RevokeDragDrop( … … 399 386 DropTargetNode* dropTargetInfo; 400 387 401 TRACE("( 0x%x)\n", hwnd);388 TRACE("(%p)\n", hwnd); 402 389 403 390 /* … … 423 410 */ 424 411 IDropTarget_Release(dropTargetInfo->dropTarget); 425 HeapFree(GetProcessHeap(), 0, dropTargetInfo); 412 HeapFree(GetProcessHeap(), 0, dropTargetInfo); 426 413 427 414 return S_OK; … … 429 416 430 417 /*********************************************************************** 431 * OleRegGetUserType (OLE32. 122)418 * OleRegGetUserType (OLE32.@) 432 419 * 433 420 * This implementation of OleRegGetUserType ignores the dwFormOfType … … 436 423 * way they are registered. 437 424 */ 438 HRESULT WINAPI OleRegGetUserType( 439 REFCLSID clsid, 425 HRESULT WINAPI OleRegGetUserType( 426 REFCLSID clsid, 440 427 DWORD dwFormOfType, 441 428 LPOLESTR* pszUserType) … … 521 508 RegCloseKey(clsidKey); 522 509 523 510 524 511 if (hres!=ERROR_SUCCESS) 525 512 { … … 540 527 541 528 /*********************************************************************** 542 * DoDragDrop [OLE32. 65]529 * DoDragDrop [OLE32.@] 543 530 */ 544 531 HRESULT WINAPI DoDragDrop ( … … 557 544 * Setup the drag n drop tracking window. 558 545 */ 546 if (!IsValidInterface((LPUNKNOWN)pDropSource)) 547 return E_INVALIDARG; 548 559 549 trackerInfo.dataObject = pDataObject; 560 550 trackerInfo.dropSource = pDropSource; … … 564 554 trackerInfo.escPressed = FALSE; 565 555 trackerInfo.curDragTargetHWND = 0; 556 trackerInfo.curTargetHWND = 0; 566 557 trackerInfo.curDragTarget = 0; 567 558 … … 585 576 hwndTracker = hwndTrackWindow; 586 577 #endif 578 587 579 /* 588 580 * Capture the mouse input … … 595 587 while (!trackerInfo.trackingDone && GetMessageA(&msg, 0, 0, 0) ) 596 588 { 597 if ( (msg.message >= WM_KEYFIRST) && 589 if ( (msg.message >= WM_KEYFIRST) && 598 590 (msg.message <= WM_KEYLAST) ) 599 591 { 592 #ifdef __WIN32OS2__ 593 dprintf(("dragloop: key msg %x\n", msg.message)); 594 #endif 600 595 /* 601 596 * When keyboard messages are sent to windows on this thread, we … … 612 607 /* 613 608 * Notify the drop source. 614 */ 609 */ 615 610 OLEDD_TrackStateChange(&trackerInfo, 616 611 msg.pt, … … 619 614 else 620 615 { 616 #ifdef __WIN32OS2__ 617 dprintf(("dragloop: dispmsg %x\n", msg.message)); 618 #endif 621 619 /* 622 620 * Dispatch the messages only when it's not a keyboard message. … … 646 644 647 645 /*********************************************************************** 648 * OleQueryLinkFromData [OLE32. 118]646 * OleQueryLinkFromData [OLE32.@] 649 647 */ 650 648 HRESULT WINAPI OleQueryLinkFromData( … … 656 654 657 655 /*********************************************************************** 658 * OleRegGetMiscStatus [OLE32. 121]656 * OleRegGetMiscStatus [OLE32.@] 659 657 */ 660 658 HRESULT WINAPI OleRegGetMiscStatus( … … 701 699 &miscStatusKey); 702 700 703 701 704 702 if (result != ERROR_SUCCESS) 705 703 { … … 721 719 keyName, 722 720 &aspectKey); 723 721 724 722 if (result == ERROR_SUCCESS) 725 723 { … … 738 736 739 737 /****************************************************************************** 740 * OleSetContainedObject [OLE32. 128]738 * OleSetContainedObject [OLE32.@] 741 739 */ 742 740 HRESULT WINAPI OleSetContainedObject( 743 LPUNKNOWN pUnknown, 741 LPUNKNOWN pUnknown, 744 742 BOOL fContained) 745 743 { … … 766 764 767 765 /****************************************************************************** 768 * OleLoad [OLE32. 112]766 * OleLoad [OLE32.@] 769 767 */ 770 768 HRESULT WINAPI OleLoad( 771 LPSTORAGE pStg, 772 REFIID riid, 773 LPOLECLIENTSITE pClientSite, 769 LPSTORAGE pStg, 770 REFIID riid, 771 LPOLECLIENTSITE pClientSite, 774 772 LPVOID* ppvObj) 775 773 { … … 780 778 781 779 TRACE("(%p,%p,%p,%p)\n", pStg, riid, pClientSite, ppvObj); 782 780 783 781 /* 784 782 * TODO, Conversion ... OleDoAutoConvert … … 829 827 (void**)&persistStorage); 830 828 831 if (SUCCEEDED(hres)) 829 if (SUCCEEDED(hres)) 832 830 { 833 831 IPersistStorage_Load(persistStorage, pStg); … … 851 849 852 850 /*********************************************************************** 853 * OleSave [OLE32. 124]851 * OleSave [OLE32.@] 854 852 */ 855 853 HRESULT WINAPI OleSave( … … 884 882 STGC_DEFAULT); 885 883 } 886 884 887 885 return hres; 888 886 } … … 890 888 891 889 /****************************************************************************** 892 * OleLockRunning [OLE32. 114]893 */ 894 HRESULT WINAPI OleLockRunning(LPUNKNOWN pUnknown, BOOL fLock, BOOL fLastUnlockCloses) 890 * OleLockRunning [OLE32.@] 891 */ 892 HRESULT WINAPI OleLockRunning(LPUNKNOWN pUnknown, BOOL fLock, BOOL fLastUnlockCloses) 895 893 { 896 894 IRunnableObject* runnable = NULL; … … 943 941 * Install thread scope message hooks for WH_GETMESSAGE and WH_CALLWNDPROC 944 942 * 945 * RETURNS: TRUE if message hooks were succes fully installed943 * RETURNS: TRUE if message hooks were successfully installed 946 944 * FALSE on failure 947 945 */ … … 957 955 pHookItem->tid = tid; 958 956 pHookItem->hHeap = GetProcessHeap(); 959 957 960 958 /* Install a thread scope message hook for WH_GETMESSAGE */ 961 959 pHookItem->GetMsg_hHook = SetWindowsHookExA( WH_GETMESSAGE, OLEMenu_GetMsgProc, … … 973 971 pHookItem->next = hook_list; 974 972 hook_list = pHookItem; 975 973 976 974 return TRUE; 977 975 978 976 CLEANUP: 979 977 /* Unhook any hooks */ … … 984 982 /* Release the hook table entry */ 985 983 HeapFree(pHookItem->hHeap, 0, pHookItem ); 986 984 987 985 return FALSE; 988 986 } … … 992 990 * UnInstall thread scope message hooks for WH_GETMESSAGE and WH_CALLWNDPROC 993 991 * 994 * RETURNS: TRUE if message hooks were succes fully installed992 * RETURNS: TRUE if message hooks were successfully installed 995 993 * FALSE on failure 996 994 */ … … 1049 1047 return pHookItem; 1050 1048 } 1051 1049 1052 1050 return NULL; 1053 1051 } … … 1070 1068 { 1071 1069 HMENU hsubmenu; 1072 1070 1073 1071 /* Is the current item a submenu? */ 1074 1072 if ( (hsubmenu = GetSubMenu(hMainMenu, i)) ) … … 1117 1115 if ( !OLEMenu_FindMainMenuIndex( pOleMenuDescriptor->hmenuCombined, hmenu, &nPos ) ) 1118 1116 return FALSE; 1119 1117 1120 1118 /* The group widths array has counts for the number of elements 1121 1119 * in the groups File, Edit, Container, Object, Window, Help. … … 1150 1148 OleMenuHookItem *pHookItem = NULL; 1151 1149 WORD fuFlags; 1152 1150 1153 1151 TRACE("%i, %04x, %08x\n", code, wParam, (unsigned)lParam ); 1154 1152 … … 1156 1154 if ( HC_ACTION != code ) 1157 1155 goto NEXTHOOK; 1158 1156 1159 1157 /* Retrieve the current message being dispatched from lParam */ 1160 1158 pMsg = (LPCWPSTRUCT)lParam; … … 1186 1184 goto NEXTHOOK; 1187 1185 } 1188 1186 1189 1187 case WM_INITMENUPOPUP: 1190 1188 { … … 1193 1191 break; 1194 1192 } 1195 1193 1196 1194 case WM_MENUSELECT: 1197 1195 { … … 1206 1204 break; 1207 1205 } 1208 1206 1209 1207 case WM_DRAWITEM: 1210 1208 { … … 1226 1224 pMsg->message, pMsg->wParam, pMsg->lParam ); 1227 1225 } 1228 1226 1229 1227 NEXTHOOK: 1230 1228 if ( pOleMenuDescriptor ) 1231 1229 GlobalUnlock( hOleMenu ); 1232 1230 1233 1231 /* Lookup the hook item for the current thread */ 1234 1232 if ( !( pHookItem = OLEMenu_IsHookInstalled( GetCurrentThreadId() ) ) ) … … 1238 1236 return 0; 1239 1237 } 1240 1238 1241 1239 /* Pass on the message to the next hooker */ 1242 1240 return CallNextHookEx( pHookItem->CallWndProc_hHook, code, wParam, lParam ); … … 1255 1253 OleMenuHookItem *pHookItem = NULL; 1256 1254 WORD wCode; 1257 1255 1258 1256 TRACE("%i, %04x, %08x\n", code, wParam, (unsigned)lParam ); 1259 1257 … … 1261 1259 if ( HC_ACTION != code ) 1262 1260 goto NEXTHOOK; 1263 1261 1264 1262 /* Retrieve the current message being dispatched from lParam */ 1265 1263 pMsg = (LPMSG)lParam; … … 1300 1298 pMsg->hwnd = pOleMenuDescriptor->hwndActiveObject; 1301 1299 } 1302 1300 1303 1301 NEXTHOOK: 1304 1302 if ( pOleMenuDescriptor ) 1305 1303 GlobalUnlock( hOleMenu ); 1306 1304 1307 1305 /* Lookup the hook item for the current thread */ 1308 1306 if ( !( pHookItem = OLEMenu_IsHookInstalled( GetCurrentThreadId() ) ) ) … … 1312 1310 return FALSE; 1313 1311 } 1314 1312 1315 1313 /* Pass on the message to the next hooker */ 1316 1314 return CallNextHookEx( pHookItem->GetMsg_hHook, code, wParam, lParam ); … … 1318 1316 1319 1317 /*********************************************************************** 1320 * OleCreateMenuDescriptor [OLE32. 97]1318 * OleCreateMenuDescriptor [OLE32.@] 1321 1319 * Creates an OLE menu descriptor for OLE to use when dispatching 1322 1320 * menu messages and commands. … … 1350 1348 for ( i = 0; i < 6; i++ ) 1351 1349 pOleMenuDescriptor->mgw.width[i] = lpMenuWidths->width[i]; 1352 1350 1353 1351 pOleMenuDescriptor->hmenuCombined = hmenuCombined; 1354 1352 pOleMenuDescriptor->bIsServerItem = FALSE; 1355 1353 GlobalUnlock( hOleMenu ); 1356 1354 1357 1355 return hOleMenu; 1358 1356 } 1359 1357 1360 1358 /*********************************************************************** 1361 * OleDestroyMenuDescriptor [OLE32. 99]1359 * OleDestroyMenuDescriptor [OLE32.@] 1362 1360 * Destroy the shared menu descriptor 1363 1361 */ … … 1371 1369 1372 1370 /*********************************************************************** 1373 * OleSetMenuDescriptor [OLE32. 129]1371 * OleSetMenuDescriptor [OLE32.@] 1374 1372 * Installs or removes OLE dispatching code for the containers frame window 1375 1373 * FIXME: The lpFrame and lpActiveObject parameters are currently ignored 1376 1374 * OLE should install context sensitive help F1 filtering for the app when 1377 1375 * these are non null. 1378 * 1376 * 1379 1377 * PARAMS: 1380 1378 * hOleMenu Handle to composite menu descriptor … … 1403 1401 if ( lpFrame || lpActiveObject ) 1404 1402 { 1405 FIXME("(%x, % x, %x, %p, %p), Context sensitive help filtering not implemented!\n",1403 FIXME("(%x, %p, %p, %p, %p), Context sensitive help filtering not implemented!\n", 1406 1404 (unsigned int)hOleMenu, 1407 1405 hwndFrame, … … 1424 1422 if ( OLEMenu_IsHookInstalled( GetCurrentThreadId() ) ) 1425 1423 return E_FAIL; 1426 1424 1427 1425 /* Get the menu descriptor */ 1428 1426 pOleMenuDescriptor = (OleMenuDescriptor *) GlobalLock( hOleMenu ); … … 1436 1434 GlobalUnlock( hOleMenu ); 1437 1435 pOleMenuDescriptor = NULL; 1438 1436 1439 1437 /* Add a menu descriptor windows property to the frame window */ 1440 1438 SetPropA( hwndFrame, "PROP_OLEMenuDescriptor", hOleMenu ); … … 1449 1447 if ( !OLEMenu_UnInstallHooks( GetCurrentThreadId() ) ) 1450 1448 return E_FAIL; 1451 1449 1452 1450 /* Remove the menu descriptor property from the frame window */ 1453 1451 RemovePropA( hwndFrame, "PROP_OLEMenuDescriptor" ); 1454 1452 } 1455 1453 1456 1454 return S_OK; 1457 1455 } 1458 1456 1459 1457 /****************************************************************************** 1460 * IsAccelerator [OLE32. 75]1458 * IsAccelerator [OLE32.@] 1461 1459 * Mostly copied from controls/menu.c TranslateAccelerator implementation 1462 1460 */ … … 1475 1473 #endif 1476 1474 { 1477 WARN_(accel)("invalid accel handle=% 04x\n", hAccel);1475 WARN_(accel)("invalid accel handle=%p\n", hAccel); 1478 1476 return FALSE; 1479 1477 } … … 1484 1482 lpMsg->message != WM_CHAR)) return FALSE; 1485 1483 1486 TRACE_(accel)("hAccel=% 04x, cAccelEntries=%d,"1487 "msg->hwnd=% 04x, msg->message=%04x, wParam=%08x, lParam=%08lx\n",1484 TRACE_(accel)("hAccel=%p, cAccelEntries=%d," 1485 "msg->hwnd=%p, msg->message=%04x, wParam=%08x, lParam=%08lx\n", 1488 1486 hAccel, cAccelEntries, 1489 1487 lpMsg->hwnd, lpMsg->message, lpMsg->wParam, lpMsg->lParam); … … 1537 1535 1538 1536 /*********************************************************************** 1539 * ReleaseStgMedium [OLE32. 140]1537 * ReleaseStgMedium [OLE32.@] 1540 1538 */ 1541 1539 void WINAPI ReleaseStgMedium( … … 1546 1544 case TYMED_HGLOBAL: 1547 1545 { 1548 if ( (pmedium->pUnkForRelease==0) && 1546 if ( (pmedium->pUnkForRelease==0) && 1549 1547 (pmedium->u.hGlobal!=0) ) 1550 1548 GlobalFree(pmedium->u.hGlobal); … … 1590 1588 case TYMED_GDI: 1591 1589 { 1592 if ( (pmedium->pUnkForRelease==0) && 1590 if ( (pmedium->pUnkForRelease==0) && 1593 1591 (pmedium->u.hGlobal!=0) ) 1594 1592 DeleteObject(pmedium->u.hGlobal); … … 1599 1597 case TYMED_MFPICT: 1600 1598 { 1601 if ( (pmedium->pUnkForRelease==0) && 1599 if ( (pmedium->pUnkForRelease==0) && 1602 1600 (pmedium->u.hMetaFilePict!=0) ) 1603 1601 { … … 1613 1611 case TYMED_ENHMF: 1614 1612 { 1615 if ( (pmedium->pUnkForRelease==0) && 1613 if ( (pmedium->pUnkForRelease==0) && 1616 1614 (pmedium->u.hEnhMetaFile!=0) ) 1617 1615 { … … 1626 1624 break; 1627 1625 } 1626 pmedium->tymed=TYMED_NULL; 1628 1627 1629 1628 /* … … 1654 1653 wndClass.hbrBackground = 0; 1655 1654 wndClass.lpszClassName = OLEDD_DRAGTRACKERCLASS; 1656 1655 1657 1656 RegisterClassA (&wndClass); 1658 1657 … … 1729 1728 /* 1730 1729 * If we get here, we have found a spot for our item. The parentNodeLink 1731 * pointer points to the pointer that we have to modify. 1730 * pointer points to the pointer that we have to modify. 1732 1731 * The curNode should be NULL. We just have to establish the link and Voila! 1733 1732 */ … … 1776 1775 { 1777 1776 /* 1778 * The item was found in the list. Detach it from it's parent and 1777 * The item was found in the list. Detach it from it's parent and 1779 1778 * re-insert it's kids in the tree. 1780 1779 */ … … 1866 1865 */ 1867 1866 static LRESULT WINAPI OLEDD_DragTrackerWindowProc( 1868 HWND hwnd, 1867 HWND hwnd, 1869 1868 UINT uMsg, 1870 WPARAM wParam, 1869 WPARAM wParam, 1871 1870 LPARAM lParam) 1872 1871 { 1872 dprintf(("OLEDD_DragTrackerWindowProc(%x, %x, %x, %x)\n", hwnd, uMsg, wParam, lParam)); 1873 1873 switch (uMsg) 1874 1874 { … … 1877 1877 LPCREATESTRUCTA createStruct = (LPCREATESTRUCTA)lParam; 1878 1878 1879 SetWindowLongA(hwnd, 0, (LONG)createStruct->lpCreateParams); 1880 1881 1879 SetWindowLongA(hwnd, 0, (LONG)createStruct->lpCreateParams); 1880 1882 1881 break; 1883 1882 } … … 1897 1896 * Track the movement of the mouse. 1898 1897 */ 1898 #ifdef __WIN32OS2__ 1899 wParam = OLEDD_GetButtonState(); 1900 #endif 1899 1901 OLEDD_TrackMouseMove(trackerInfo, mousePos, wParam); 1900 1902 … … 1956 1958 DWORD keyState) 1957 1959 { 1958 HWND hwndNewTarget = 0; 1959 HRESULT hr = S_OK; 1960 HWND hwndNewTarget; 1961 HRESULT hr; 1962 1963 #ifdef __WIN32OS2__ 1964 TRACE("OLEDD_TrackMouseMove: %p, (%d,%d), %x\n", trackerInfo, mousePos.x, mousePos.y, keyState); 1965 #endif 1960 1966 1961 1967 /* … … 1978 1984 * DragOver notification 1979 1985 */ 1980 if ( (trackerInfo->curDragTarget != 0) && 1981 (trackerInfo->cur DragTargetHWND==hwndNewTarget) )1986 if ( (trackerInfo->curDragTarget != 0) && 1987 (trackerInfo->curTargetHWND == hwndNewTarget) ) 1982 1988 { 1983 1989 POINTL mousePosParam; 1984 1990 1985 1991 /* 1986 1992 * The documentation tells me that the coordinate should be in the target … … 1990 1996 mousePosParam.x = mousePos.x; 1991 1997 mousePosParam.y = mousePos.y; 1992 1998 1999 #ifdef __WIN32OS2__ 2000 hr = 2001 #endif 1993 2002 IDropTarget_DragOver(trackerInfo->curDragTarget, 1994 2003 keyState, 1995 2004 mousePosParam, 1996 2005 trackerInfo->pdwEffect); 2006 #ifdef __WIN32OS2__ 2007 TRACE("OLEDD_TrackMouseMove: IDropTarget_DragEnter -> %x, *pdwEffect=%x\n", hr, *trackerInfo->pdwEffect); 2008 #endif 1997 2009 } 1998 2010 else 1999 2011 { 2000 2012 DropTargetNode* newDropTargetNode = 0; 2001 2013 2002 2014 /* 2003 2015 * If we changed window, we have to notify our old target and check for … … 2006 2018 if (trackerInfo->curDragTarget!=0) 2007 2019 { 2020 #ifdef __WIN32OS2__ 2021 hr = 2022 #endif 2008 2023 IDropTarget_DragLeave(trackerInfo->curDragTarget); 2009 } 2010 2024 #ifdef __WIN32OS2__ 2025 TRACE("OLEDD_TrackMouseMove: IDropTarget_DragLeave -> %x\n", hr); 2026 #endif 2027 } 2028 2011 2029 /* 2012 2030 * Make sure we're hovering over a window. … … 2018 2036 */ 2019 2037 HWND nexttar = hwndNewTarget; 2038 trackerInfo->curTargetHWND = hwndNewTarget; 2039 2020 2040 do { 2021 2041 newDropTargetNode = OLEDD_FindDropTarget(nexttar); … … 2025 2045 trackerInfo->curDragTargetHWND = hwndNewTarget; 2026 2046 trackerInfo->curDragTarget = newDropTargetNode ? newDropTargetNode->dropTarget : 0; 2027 2047 2028 2048 /* 2029 2049 * If there is, notify it that we just dragged-in … … 2041 2061 mousePosParam.y = mousePos.y; 2042 2062 2063 #ifdef __WIN32OS2__ 2064 hr = 2065 #endif 2043 2066 IDropTarget_DragEnter(trackerInfo->curDragTarget, 2044 2067 trackerInfo->dataObject, … … 2046 2069 mousePosParam, 2047 2070 trackerInfo->pdwEffect); 2071 #ifdef __WIN32OS2__ 2072 TRACE("OLEDD_TrackMouseMove: IDropTarget_DragEnter -> %x, *pdwEffect=%x\n", hr, *trackerInfo->pdwEffect); 2073 #endif 2048 2074 } 2049 2075 } … … 2054 2080 */ 2055 2081 trackerInfo->curDragTargetHWND = 0; 2082 trackerInfo->curTargetHWND = 0; 2056 2083 trackerInfo->curDragTarget = 0; 2057 2084 } … … 2059 2086 2060 2087 /* 2061 * Now that we have done that, we have to tell the source to give 2062 * us feedback on the work being done by the target. If we don't 2088 * Now that we have done that, we have to tell the source to give 2089 * us feedback on the work being done by the target. If we don't 2063 2090 * have a target, simulate no effect. 2064 2091 */ … … 2070 2097 hr = IDropSource_GiveFeedback(trackerInfo->dropSource, 2071 2098 *trackerInfo->pdwEffect); 2099 #ifdef __WIN32OS2__ 2100 TRACE("OLEDD_TrackMouseMove: IDropSource_GiveFeedback *pdwEffect=%x -> %x\n", *trackerInfo->pdwEffect, hr); 2101 #endif 2072 2102 2073 2103 /* … … 2079 2109 if (hr==DRAGDROP_S_USEDEFAULTCURSORS) 2080 2110 { 2081 #ifndef __WIN32OS2__2082 //SvL: This needs to be changed. Causes mouse cursor changes when2083 // e.g. clicking on an item in the file open dialog2084 2111 if (*trackerInfo->pdwEffect & DROPEFFECT_MOVE) 2085 2112 { … … 2098 2125 SetCursor(LoadCursorA(OLE32_hInstance, MAKEINTRESOURCEA(0))); 2099 2126 } 2100 #endif 2101 } 2127 } 2102 2128 } 2103 2129 … … 2123 2149 DWORD keyState) 2124 2150 { 2151 #ifdef __WIN32OS2__ 2152 TRACE("OLEDD_TrackStateChange: %p (%d,%d) %x\n", trackerInfo, mousePos.x, mousePos.y, keyState); 2153 #endif 2154 2125 2155 /* 2126 2156 * Ask the drop source what to do with the operation. … … 2128 2158 trackerInfo->returnValue = IDropSource_QueryContinueDrag( 2129 2159 trackerInfo->dropSource, 2130 trackerInfo->escPressed, 2160 trackerInfo->escPressed, 2131 2161 keyState); 2132 2162 #ifdef __WIN32OS2__ 2163 TRACE("OLEDD_TrackStateChange: IDropSource_QueryContinueDrag -> %x\n", trackerInfo->returnValue); 2164 #endif 2165 2133 2166 /* 2134 2167 * All the return valued will stop the operation except the S_OK … … 2143 2176 2144 2177 /* 2145 * Release the mouse in case the drop target decides to show a popup 2178 * Release the mouse in case the drop target decides to show a popup 2146 2179 * or a menu or something. 2147 2180 */ 2148 2181 ReleaseCapture(); 2149 2182 2150 2183 /* 2151 * If we end-up over a target, drop the object in the target or 2184 * If we end-up over a target, drop the object in the target or 2152 2185 * inform the target that the operation was cancelled. 2153 2186 */ … … 2157 2190 { 2158 2191 /* 2159 * If the source wants us to complete the operation, we tell 2192 * If the source wants us to complete the operation, we tell 2160 2193 * the drop target that we just dropped the object in it. 2161 2194 */ … … 2165 2198 2166 2199 /* 2167 * The documentation tells me that the coordinate should be 2200 * The documentation tells me that the coordinate should be 2168 2201 * in the target window's coordinate space. However, the tests 2169 2202 * I made tell me the coordinates should be in screen coordinates. … … 2171 2204 mousePosParam.x = mousePos.x; 2172 2205 mousePosParam.y = mousePos.y; 2173 2206 2174 2207 IDropTarget_Drop(trackerInfo->curDragTarget, 2175 2208 trackerInfo->dataObject, … … 2180 2213 } 2181 2214 /* 2182 * If the source told us that we should cancel, fool the drop 2215 * If the source told us that we should cancel, fool the drop 2183 2216 * target by telling it that the mouse left it's window. 2184 * Also set the drop effect to "NONE" in case the application 2217 * Also set the drop effect to "NONE" in case the application 2185 2218 * ignores the result of DoDragDrop. 2186 2219 */ … … 2189 2222 *trackerInfo->pdwEffect = DROPEFFECT_NONE; 2190 2223 break; 2224 2225 #ifdef __WIN32OS2__ 2226 #ifdef DEBUG 2227 default: 2228 TRACE("OLEDD_TrackStateChange: unknown return value %x\n", trackerInfo->returnValue); 2229 assert(FALSE); 2230 break; 2231 #endif 2232 #endif 2191 2233 } 2192 2234 } 2193 2235 } 2236 #ifdef __WIN32OS2__ 2237 else /* Read DoDragDrop() docs. This is point 5 in the remark section. */ 2238 OLEDD_TrackMouseMove(trackerInfo, mousePos, keyState); 2239 TRACE("OLEDD_TrackStateChange: IDropSource_QueryContinueDrag -> %x\n", trackerInfo->returnValue); 2240 #endif 2194 2241 } 2195 2242 … … 2201 2248 * WM_MOUSEMOVE wParam. 2202 2249 */ 2203 static DWORD OLEDD_GetButtonState( )2250 static DWORD OLEDD_GetButtonState(void) 2204 2251 { 2205 2252 BYTE keyboardState[256]; … … 2214 2261 keyMask |= MK_CONTROL; 2215 2262 2263 #ifdef __WIN32OS2__ 2264 if ( (keyboardState[VK_MENU] & 0x80) != 0) 2265 keyMask |= MK_ALT; 2266 #endif 2267 2216 2268 if ( (keyboardState[VK_LBUTTON] & 0x80) !=0) 2217 2269 keyMask |= MK_LBUTTON; … … 2222 2274 if ( (keyboardState[VK_MBUTTON] & 0x80) !=0) 2223 2275 keyMask |= MK_MBUTTON; 2276 2224 2277 2225 2278 return keyMask; … … 2235 2288 * params: 2236 2289 * regKey - Key to read the default value from 2237 * pdwValue - Pointer to the location where the DWORD 2290 * pdwValue - Pointer to the location where the DWORD 2238 2291 * value is returned. This value is not modified 2239 2292 * if the value is not found. … … 2241 2294 2242 2295 static void OLEUTL_ReadRegistryDWORDValue( 2243 HKEY regKey, 2296 HKEY regKey, 2244 2297 DWORD* pdwValue) 2245 2298 { … … 2271 2324 } 2272 2325 } 2326 2327 2328 /****************************************************************************** 2329 * OleDraw (OLE32.@) 2330 * 2331 * The operation of this function is documented literally in the WinAPI 2332 * documentation to involve a QueryInterface for the IViewObject interface, 2333 * followed by a call to IViewObject::Draw. 2334 */ 2335 HRESULT WINAPI OleDraw( 2336 IUnknown *pUnk, 2337 DWORD dwAspect, 2338 HDC hdcDraw, 2339 LPCRECT lprcBounds) 2340 { 2341 HRESULT hres; 2342 IViewObject *viewobject; 2343 2344 hres = IUnknown_QueryInterface(pUnk, 2345 &IID_IViewObject, 2346 (void**)&viewobject); 2347 2348 if (SUCCEEDED(hres)) 2349 { 2350 RECTL rectl; 2351 2352 rectl.left = lprcBounds->left; 2353 rectl.right = lprcBounds->right; 2354 rectl.top = lprcBounds->top; 2355 rectl.bottom = lprcBounds->bottom; 2356 hres = IViewObject_Draw(viewobject, dwAspect, -1, 0, 0, 0, hdcDraw, &rectl, 0, 0, 0); 2357 2358 IViewObject_Release(viewobject); 2359 return hres; 2360 } 2361 else 2362 { 2363 return DV_E_NOIVIEWOBJECT; 2364 } 2365 } 2366 2367 /*********************************************************************** 2368 * OleTranslateAccelerator [OLE32.@] 2369 */ 2370 HRESULT WINAPI OleTranslateAccelerator (LPOLEINPLACEFRAME lpFrame, 2371 LPOLEINPLACEFRAMEINFO lpFrameInfo, LPMSG lpmsg) 2372 { 2373 WORD wID; 2374 2375 TRACE("(%p,%p,%p)\n", lpFrame, lpFrameInfo, lpmsg); 2376 2377 if (IsAccelerator(lpFrameInfo->haccel,lpFrameInfo->cAccelEntries,lpmsg,&wID)) 2378 return IOleInPlaceFrame_TranslateAccelerator(lpFrame,lpmsg,wID); 2379 2380 return S_FALSE; 2381 } 2382 2383 /****************************************************************************** 2384 * OleCreate [OLE32.@] 2385 * 2386 */ 2387 HRESULT WINAPI OleCreate( 2388 REFCLSID rclsid, 2389 REFIID riid, 2390 DWORD renderopt, 2391 LPFORMATETC pFormatEtc, 2392 LPOLECLIENTSITE pClientSite, 2393 LPSTORAGE pStg, 2394 LPVOID* ppvObj) 2395 { 2396 HRESULT hres, hres1; 2397 IUnknown * pUnk = NULL; 2398 2399 FIXME("\n\t%s\n\t%s semi-stub!\n", debugstr_guid(rclsid), debugstr_guid(riid)); 2400 2401 if (SUCCEEDED((hres = CoCreateInstance(rclsid, 0, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER|CLSCTX_LOCAL_SERVER , riid, (LPVOID*)&pUnk)))) 2402 { 2403 if (pClientSite) 2404 { 2405 IOleObject * pOE; 2406 IPersistStorage * pPS; 2407 if (SUCCEEDED((hres = IUnknown_QueryInterface( pUnk, &IID_IOleObject, (LPVOID*)&pOE)))) 2408 { 2409 TRACE("trying to set clientsite %p\n", pClientSite); 2410 hres1 = IOleObject_SetClientSite(pOE, pClientSite); 2411 TRACE("-- result 0x%08lx\n", hres1); 2412 IOleObject_Release(pOE); 2413 } 2414 if (SUCCEEDED((hres = IUnknown_QueryInterface( pUnk, &IID_IPersistStorage, (LPVOID*)&pPS)))) 2415 { 2416 TRACE("trying to set stg %p\n", pStg); 2417 hres1 = IPersistStorage_InitNew(pPS, pStg); 2418 TRACE("-- result 0x%08lx\n", hres1); 2419 IPersistStorage_Release(pPS); 2420 } 2421 } 2422 } 2423 2424 *ppvObj = pUnk; 2425 2426 TRACE("-- %p \n", pUnk); 2427 return hres; 2428 } 2429 2430 /*********************************************************************** 2431 * OLE_FreeClipDataArray [internal] 2432 * 2433 * NOTES: 2434 * frees the data associated with an array of CLIPDATAs 2435 */ 2436 static void OLE_FreeClipDataArray(ULONG count, CLIPDATA * pClipDataArray) 2437 { 2438 ULONG i; 2439 for (i = 0; i < count; i++) 2440 if (pClipDataArray[i].pClipData) 2441 CoTaskMemFree(pClipDataArray[i].pClipData); 2442 } 2443 2444 HRESULT WINAPI FreePropVariantArray(ULONG,PROPVARIANT*); 2445 2446 /*********************************************************************** 2447 * PropVariantClear [OLE32.@] 2448 */ 2449 HRESULT WINAPI PropVariantClear(PROPVARIANT * pvar) /* [in/out] */ 2450 { 2451 TRACE("(%p)\n", pvar); 2452 2453 if (!pvar) 2454 return S_OK; 2455 2456 switch(pvar->vt) 2457 { 2458 case VT_STREAM: 2459 case VT_STREAMED_OBJECT: 2460 case VT_STORAGE: 2461 case VT_STORED_OBJECT: 2462 IUnknown_Release((LPUNKNOWN)pvar->u.pStream); 2463 break; 2464 case VT_CLSID: 2465 case VT_LPSTR: 2466 case VT_LPWSTR: 2467 /* pick an arbitary typed pointer - we don't care about the type 2468 * as we are just freeing it */ 2469 CoTaskMemFree(pvar->u.puuid); 2470 break; 2471 case VT_BLOB: 2472 case VT_BLOB_OBJECT: 2473 CoTaskMemFree(pvar->u.blob.pBlobData); 2474 break; 2475 case VT_BSTR: 2476 FIXME("Need to load OLEAUT32 for SysFreeString\n"); 2477 /* SysFreeString(pvar->u.bstrVal); */ 2478 break; 2479 case VT_CF: 2480 if (pvar->u.pclipdata) 2481 { 2482 OLE_FreeClipDataArray(1, pvar->u.pclipdata); 2483 CoTaskMemFree(pvar->u.pclipdata); 2484 } 2485 break; 2486 default: 2487 if (pvar->vt & VT_ARRAY) 2488 { 2489 FIXME("Need to call SafeArrayDestroy\n"); 2490 /* SafeArrayDestroy(pvar->u.caub); */ 2491 } 2492 switch (pvar->vt & VT_VECTOR) 2493 { 2494 case VT_VARIANT: 2495 FreePropVariantArray(pvar->u.capropvar.cElems, pvar->u.capropvar.pElems); 2496 break; 2497 case VT_CF: 2498 OLE_FreeClipDataArray(pvar->u.caclipdata.cElems, pvar->u.caclipdata.pElems); 2499 break; 2500 case VT_BSTR: 2501 case VT_LPSTR: 2502 case VT_LPWSTR: 2503 FIXME("Freeing of vector sub-type not supported yet\n"); 2504 } 2505 if (pvar->vt & VT_VECTOR) 2506 { 2507 /* pick an arbitary VT_VECTOR structure - they all have the same 2508 * memory layout */ 2509 CoTaskMemFree(pvar->u.capropvar.pElems); 2510 } 2511 } 2512 2513 ZeroMemory(pvar, sizeof(*pvar)); 2514 2515 return S_OK; 2516 } 2517 2518 /*********************************************************************** 2519 * PropVariantCopy [OLE32.@] 2520 */ 2521 HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */ 2522 const PROPVARIANT *pvarSrc) /* [in] */ 2523 { 2524 ULONG len; 2525 TRACE("(%p, %p): stub:\n", pvarDest, pvarSrc); 2526 2527 /* this will deal with most cases */ 2528 CopyMemory(pvarDest, pvarSrc, sizeof(*pvarDest)); 2529 2530 switch(pvarSrc->vt) 2531 { 2532 case VT_STREAM: 2533 case VT_STREAMED_OBJECT: 2534 case VT_STORAGE: 2535 case VT_STORED_OBJECT: 2536 IUnknown_AddRef((LPUNKNOWN)pvarDest->u.pStream); 2537 break; 2538 case VT_CLSID: 2539 pvarDest->u.puuid = CoTaskMemAlloc(sizeof(CLSID)); 2540 CopyMemory(pvarDest->u.puuid, pvarSrc->u.puuid, sizeof(CLSID)); 2541 break; 2542 case VT_LPSTR: 2543 len = strlen(pvarSrc->u.pszVal); 2544 pvarDest->u.pszVal = CoTaskMemAlloc(len); 2545 CopyMemory(pvarDest->u.pszVal, pvarSrc->u.pszVal, len); 2546 break; 2547 case VT_LPWSTR: 2548 len = lstrlenW(pvarSrc->u.pwszVal); 2549 pvarDest->u.pwszVal = CoTaskMemAlloc(len); 2550 CopyMemory(pvarDest->u.pwszVal, pvarSrc->u.pwszVal, len); 2551 break; 2552 case VT_BLOB: 2553 case VT_BLOB_OBJECT: 2554 if (pvarSrc->u.blob.pBlobData) 2555 { 2556 len = pvarSrc->u.blob.cbSize; 2557 pvarDest->u.blob.pBlobData = CoTaskMemAlloc(len); 2558 CopyMemory(pvarDest->u.blob.pBlobData, pvarSrc->u.blob.pBlobData, len); 2559 } 2560 break; 2561 case VT_BSTR: 2562 FIXME("Need to copy BSTR\n"); 2563 break; 2564 case VT_CF: 2565 if (pvarSrc->u.pclipdata) 2566 { 2567 len = pvarSrc->u.pclipdata->cbSize - sizeof(pvarSrc->u.pclipdata->ulClipFmt); 2568 CoTaskMemAlloc(len); 2569 CopyMemory(pvarDest->u.pclipdata->pClipData, pvarSrc->u.pclipdata->pClipData, len); 2570 } 2571 break; 2572 default: 2573 if (pvarSrc->vt & VT_ARRAY) 2574 { 2575 FIXME("Need to call SafeArrayCopy\n"); 2576 /* SafeArrayCopy(...); */ 2577 } 2578 if (pvarSrc->vt & VT_VECTOR) 2579 { 2580 int elemSize; 2581 switch(pvarSrc->vt & VT_VECTOR) 2582 { 2583 case VT_I1: elemSize = sizeof(pvarSrc->u.cVal); break; 2584 case VT_UI1: elemSize = sizeof(pvarSrc->u.bVal); break; 2585 case VT_I2: elemSize = sizeof(pvarSrc->u.iVal); break; 2586 case VT_UI2: elemSize = sizeof(pvarSrc->u.uiVal); break; 2587 case VT_BOOL: elemSize = sizeof(pvarSrc->u.boolVal); break; 2588 case VT_I4: elemSize = sizeof(pvarSrc->u.lVal); break; 2589 case VT_UI4: elemSize = sizeof(pvarSrc->u.ulVal); break; 2590 case VT_R4: elemSize = sizeof(pvarSrc->u.fltVal); break; 2591 case VT_R8: elemSize = sizeof(pvarSrc->u.dblVal); break; 2592 case VT_ERROR: elemSize = sizeof(pvarSrc->u.scode); break; 2593 case VT_I8: elemSize = sizeof(pvarSrc->u.hVal); break; 2594 case VT_UI8: elemSize = sizeof(pvarSrc->u.uhVal); break; 2595 case VT_CY: elemSize = sizeof(pvarSrc->u.cyVal); break; 2596 case VT_DATE: elemSize = sizeof(pvarSrc->u.date); break; 2597 case VT_FILETIME: elemSize = sizeof(pvarSrc->u.filetime); break; 2598 case VT_CLSID: elemSize = sizeof(*pvarSrc->u.puuid); break; 2599 case VT_CF: elemSize = sizeof(*pvarSrc->u.pclipdata); break; 2600 2601 case VT_BSTR: 2602 case VT_LPSTR: 2603 case VT_LPWSTR: 2604 case VT_VARIANT: 2605 default: 2606 FIXME("Invalid element type: %ul\n", pvarSrc->vt & VT_VECTOR); 2607 return E_INVALIDARG; 2608 } 2609 len = pvarSrc->u.capropvar.cElems; 2610 pvarDest->u.capropvar.pElems = CoTaskMemAlloc(len * elemSize); 2611 if (pvarSrc->vt == (VT_VECTOR | VT_VARIANT)) 2612 { 2613 ULONG i; 2614 for (i = 0; i < len; i++) 2615 PropVariantCopy(&pvarDest->u.capropvar.pElems[i], &pvarSrc->u.capropvar.pElems[i]); 2616 } 2617 else if (pvarSrc->vt == (VT_VECTOR | VT_CF)) 2618 { 2619 FIXME("Copy clipformats\n"); 2620 } 2621 else if (pvarSrc->vt == (VT_VECTOR | VT_BSTR)) 2622 { 2623 FIXME("Copy BSTRs\n"); 2624 } 2625 else if (pvarSrc->vt == (VT_VECTOR | VT_LPSTR)) 2626 { 2627 FIXME("Copy LPSTRs\n"); 2628 } 2629 else if (pvarSrc->vt == (VT_VECTOR | VT_LPSTR)) 2630 { 2631 FIXME("Copy LPWSTRs\n"); 2632 } 2633 else 2634 CopyMemory(pvarDest->u.capropvar.pElems, pvarSrc->u.capropvar.pElems, len * elemSize); 2635 } 2636 } 2637 2638 return S_OK; 2639 } 2640 2641 /*********************************************************************** 2642 * FreePropVariantArray [OLE32.@] 2643 */ 2644 HRESULT WINAPI FreePropVariantArray(ULONG cVariants, /* [in] */ 2645 PROPVARIANT *rgvars) /* [in/out] */ 2646 { 2647 ULONG i; 2648 2649 TRACE("(%lu, %p)\n", cVariants, rgvars); 2650 2651 for(i = 0; i < cVariants; i++) 2652 PropVariantClear(&rgvars[i]); 2653 2654 return S_OK; 2655 } 2656 2657 2658 2273 2659 #ifdef __WIN32OS2__ 2274 2660 #include <dbglog.h> … … 2278 2664 */ 2279 2665 2280 typedef struct 2666 typedef struct 2281 2667 { 2282 2668 /* IUnknown fields */ … … 2297 2683 static HRESULT WINAPI IEnumFORMATETC_fnClone(LPENUMFORMATETC iface, LPENUMFORMATETC* ppenum); 2298 2684 2299 static struct ICOM_VTABLE(IEnumFORMATETC) efvt = 2685 static struct ICOM_VTABLE(IEnumFORMATETC) efvt = 2300 2686 { 2301 2687 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE … … 2343 2729 if(IsEqualIID(riid, &IID_IUnknown)) 2344 2730 { 2345 *ppvObj = This; 2731 *ppvObj = This; 2346 2732 } 2347 2733 else if(IsEqualIID(riid, &IID_IEnumFORMATETC)) 2348 2734 { 2349 2735 *ppvObj = (IEnumFORMATETC*)This; 2350 } 2736 } 2351 2737 2352 2738 if(*ppvObj) … … 2373 2759 TRACE("(%p)->()\n",This); 2374 2760 2375 if (!--(This->ref)) 2761 if (!--(This->ref)) 2376 2762 { 2377 2763 TRACE(" destroying IEnumFORMATETC(%p)\n",This); … … 2458 2844 * IDataObject_Constructor 2459 2845 */ 2460 static LPDATAOBJECT IDataObject_Constructor( )2846 static LPDATAOBJECT IDataObject_Constructor(void) 2461 2847 { 2462 2848 IDataObjectImpl* dto; … … 2485 2871 if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ 2486 2872 { 2487 *ppvObj = This; 2873 *ppvObj = This; 2488 2874 } 2489 2875 else if(IsEqualIID(riid, &IID_IDataObject)) /*IDataObject*/ 2490 2876 { 2491 2877 *ppvObj = (IDataObject*)This; 2492 } 2878 } 2493 2879 2494 2880 if(*ppvObj) 2495 2881 { 2496 IUnknown_AddRef((IUnknown*)*ppvObj); 2882 IUnknown_AddRef((IUnknown*)*ppvObj); 2497 2883 TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); 2498 2884 return S_OK; … … 2522 2908 dprintf(("IDataObject_fnRelease (%p)->()\n",This)); 2523 2909 2524 if (!--(This->ref)) 2910 if (!--(This->ref)) 2525 2911 { 2526 2912 TRACE(" destroying IDataObject(%p)\n",This); … … 2632 3018 memset(pfeNew, 0, sizeof(FORMATETC) * This->cDataCount); 2633 3019 memset(psmNew, 0, sizeof(STGMEDIUM) * This->cDataCount); 2634 3020 2635 3021 /* copy the existing data */ 2636 3022 if(This->pFormatEtc) … … 2642 3028 memcpy(psmNew, This->pStgMedium, sizeof(STGMEDIUM) * (This->cDataCount - 1)); 2643 3029 } 2644 3030 2645 3031 /* add the new data */ 2646 3032 pfeNew[This->cDataCount - 1] = *pformatetc; … … 2703 3089 { 2704 3090 ICOM_THIS(IDataObjectImpl,iface); 2705 3091 2706 3092 dprintf(("IDataObject_fnDUnadvise STUB")); 2707 3093 return E_NOTIMPL; … … 2710 3096 { 2711 3097 ICOM_THIS(IDataObjectImpl,iface); 2712 3098 2713 3099 dprintf(("IDataObject_fnEnumDAdvise STUB")); 2714 3100 return OLE_E_ADVISENOTSUPPORTED; 2715 3101 } 2716 3102 2717 static struct ICOM_VTABLE(IDataObject) dtovt = 3103 static struct ICOM_VTABLE(IDataObject) dtovt = 2718 3104 { 2719 3105 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE … … 2744 3130 do { 2745 3131 pTarget = OLEDD_FindDropTarget(nexttar); 2746 } 3132 } 2747 3133 while(!pTarget && (nexttar = GetParent(nexttar)) != 0); 2748 3134 … … 2768 3154 do { 2769 3155 pTarget = OLEDD_FindDropTarget(nexttar); 2770 } 3156 } 2771 3157 while(!pTarget && (nexttar = GetParent(nexttar)) != 0); 2772 3158 if(pTarget == NULL) { 2773 3159 return FALSE; 2774 3160 } 2775 3161 2776 3162 /* 2777 3163 * The documentation tells me that the coordinate should be in the target … … 2782 3168 mousePosParam.x = mousePos.x; 2783 3169 mousePosParam.y = mousePos.y; 2784 3170 2785 3171 if(GetKeyState(VK_SHIFT) & 0x8000) keyState |= MK_SHIFT; 2786 3172 if(GetKeyState(VK_CONTROL) & 0x8000) keyState |= MK_CONTROL; … … 2807 3193 do { 2808 3194 pTarget = OLEDD_FindDropTarget(nexttar); 2809 } 3195 } 2810 3196 while(!pTarget && (nexttar = GetParent(nexttar)) != 0); 2811 3197 if(pTarget == NULL) { 2812 3198 return FALSE; 2813 3199 } 2814 3200 2815 3201 /* 2816 3202 * The documentation tells me that the coordinate should be in the target … … 2821 3207 mousePosParam.x = mousePos.x; 2822 3208 mousePosParam.y = mousePos.y; 2823 3209 2824 3210 if(GetKeyState(VK_SHIFT) & 0x8000) keyState |= MK_SHIFT; 2825 3211 if(GetKeyState(VK_CONTROL) & 0x8000) keyState |= MK_CONTROL; … … 2846 3232 do { 2847 3233 pTarget = OLEDD_FindDropTarget(nexttar); 2848 } 3234 } 2849 3235 while(!pTarget && (nexttar = GetParent(nexttar)) != 0); 2850 3236 if(pTarget == NULL) { 2851 3237 return FALSE; 2852 3238 } 2853 3239 2854 3240 /* 2855 3241 * The documentation tells me that the coordinate should be in the target … … 2860 3246 mousePosParam.x = mousePos.x; 2861 3247 mousePosParam.y = mousePos.y; 2862 3248 2863 3249 if(GetKeyState(VK_SHIFT) & 0x8000) keyState |= MK_SHIFT; 2864 3250 if(GetKeyState(VK_CONTROL) & 0x8000) keyState |= MK_CONTROL; … … 2872 3258 fe.cfFormat = CF_HDROP; 2873 3259 fe.ptd = NULL; 2874 fe.dwAspect = DVASPECT_CONTENT; 3260 fe.dwAspect = DVASPECT_CONTENT; 2875 3261 fe.lindex = -1; 2876 fe.tymed = TYMED_HGLOBAL; 3262 fe.tymed = TYMED_HGLOBAL; 2877 3263 2878 3264 medium.u.hGlobal = hDrop; … … 2902 3288 do { 2903 3289 pTarget = OLEDD_FindDropTarget(nexttar); 2904 } 3290 } 2905 3291 while(!pTarget && (nexttar = GetParent(nexttar)) != 0); 2906 3292 if(pTarget == NULL) { … … 2949 3335 if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ 2950 3336 { 2951 *ppvObj = This; 3337 *ppvObj = This; 2952 3338 } 2953 3339 else if(IsEqualIID(riid, &IID_IDropTarget)) /*IDropTarget*/ 2954 3340 { 2955 3341 *ppvObj = (IDropTarget*)This; 2956 } 3342 } 2957 3343 2958 3344 if(*ppvObj) 2959 3345 { 2960 IUnknown_AddRef((IUnknown*)*ppvObj); 3346 IUnknown_AddRef((IUnknown*)*ppvObj); 2961 3347 TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); 2962 3348 return S_OK; … … 2999 3385 OSLibFreeDragStruct(This->lpDragStruct); 3000 3386 This->lpDragStruct = NULL; 3001 } 3002 } 3387 } 3388 } 3389 return S_OK; 3003 3390 } 3004 3391 /************************************************************************** … … 3022 3409 //****************************************************************************** 3023 3410 //****************************************************************************** 3024 static HRESULT WINAPI IDropTarget_fnDragEnter(IDropTarget *iface, IDataObject* pDataObject, 3411 static HRESULT WINAPI IDropTarget_fnDragEnter(IDropTarget *iface, IDataObject* pDataObject, 3025 3412 DWORD grfKeyState, POINTL pt, DWORD* pdwEffect) 3026 3413 { … … 3061 3448 #endif 3062 3449 3063 for(i=0;i<sizeof(supportedformats)/sizeof(supportedformats[0]);i++) 3450 for(i=0;i<sizeof(supportedformats)/sizeof(supportedformats[0]);i++) 3064 3451 { 3065 3452 This->format.cfFormat = supportedformats[i]; 3066 3453 This->format.ptd = NULL; 3067 This->format.dwAspect = DVASPECT_CONTENT; 3454 This->format.dwAspect = DVASPECT_CONTENT; 3068 3455 This->format.lindex = -1; 3069 This->format.tymed = TYMED_HGLOBAL; 3456 This->format.tymed = TYMED_HGLOBAL; 3070 3457 ret = IDataObject_GetData(pDataObject, &This->format, &This->medium); 3071 3458 if(ret != S_OK) { … … 3144 3531 dwEffect = OSLibDragOver(This->lpDragStruct, pt.x, pt.y); 3145 3532 break; 3146 } 3533 } 3147 3534 if(ret != S_OK) { 3148 3535 dprintf(("IDataObject_GetData failed (fatal) with %x", ret)); … … 3152 3539 *pdwEffect = dwEffect; 3153 3540 } 3154 3541 3155 3542 return S_OK; 3156 3543 } 3157 3544 //****************************************************************************** 3158 3545 //****************************************************************************** 3159 static HRESULT WINAPI IDropTarget_fnDragOver(IDropTarget *iface, DWORD grfKeyState, POINTL pt, 3546 static HRESULT WINAPI IDropTarget_fnDragOver(IDropTarget *iface, DWORD grfKeyState, POINTL pt, 3160 3547 DWORD* pdwEffect) 3161 3548 { … … 3178 3565 3179 3566 dprintf(("IDropTarget_fnDragLeave")); 3180 3567 3181 3568 OSLibDragLeave(This->lpDragStruct); 3182 3569 … … 3186 3573 //****************************************************************************** 3187 3574 //****************************************************************************** 3188 static HRESULT WINAPI IDropTarget_fnDrop(IDropTarget *iface, IDataObject* pDataObject, DWORD grfKeyState, 3575 static HRESULT WINAPI IDropTarget_fnDrop(IDropTarget *iface, IDataObject* pDataObject, DWORD grfKeyState, 3189 3576 POINTL pt, DWORD* pdwEffect) 3190 3577 { … … 3203 3590 //****************************************************************************** 3204 3591 3205 static struct ICOM_VTABLE(IDropTarget) droptarget = 3592 static struct ICOM_VTABLE(IDropTarget) droptarget = 3206 3593 { 3207 3594 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE … … 3287 3674 3288 3675 /****************************************************************************** 3289 * DllDebugObjectRPCHook (OLE32. 62)3676 * DllDebugObjectRPCHook (OLE32.@) 3290 3677 * turns on and off internal debugging, pointer is only used on macintosh 3291 3678 */ … … 3296 3683 return TRUE; 3297 3684 } 3298  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  