ReactOS 0.4.16-dev-755-g88f105e
CFSDropTarget.cpp File Reference
#include <precomp.h>
Include dependency graph for CFSDropTarget.cpp:

Go to the source code of this file.

Macros

#define D_NONE   DROPEFFECT_NONE
 
#define D_COPY   DROPEFFECT_COPY
 
#define D_MOVE   DROPEFFECT_MOVE
 
#define D_LINK   DROPEFFECT_LINK
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static void SHELL_StripIllegalFsNameCharacters (_Inout_ LPWSTR Buf)
 
static bool PathIsSameDrive (LPCWSTR Path1, LPCWSTR Path2)
 
static bool PathIsDriveRoot (LPCWSTR Path)
 
static HRESULT SHELL_LimitDropEffectToItemAttributes (_In_ IDataObject *pDataObject, _Inout_ PDWORD pdwEffect)
 
static void GetDefaultCopyMoveEffect ()
 
HRESULT CFSDropTarget_CreateInstance (LPWSTR sPathTarget, REFIID riid, LPVOID *ppvOut)
 

Macro Definition Documentation

◆ D_COPY

#define D_COPY   DROPEFFECT_COPY

Definition at line 28 of file CFSDropTarget.cpp.

◆ D_LINK

#define D_LINK   DROPEFFECT_LINK

Definition at line 30 of file CFSDropTarget.cpp.

◆ D_MOVE

#define D_MOVE   DROPEFFECT_MOVE

Definition at line 29 of file CFSDropTarget.cpp.

◆ D_NONE

#define D_NONE   DROPEFFECT_NONE

Definition at line 27 of file CFSDropTarget.cpp.

Function Documentation

◆ CFSDropTarget_CreateInstance()

HRESULT CFSDropTarget_CreateInstance ( LPWSTR  sPathTarget,
REFIID  riid,
LPVOID ppvOut 
)

Definition at line 772 of file CFSDropTarget.cpp.

773{
774 return ShellObjectCreatorInit<CFSDropTarget>(sPathTarget, riid, ppvOut);
775}
REFIID riid
Definition: atlbase.h:39

Referenced by CFSFolder::CreateViewObject(), and CFSFolder::GetUIObjectOf().

◆ GetDefaultCopyMoveEffect()

static void GetDefaultCopyMoveEffect ( )
static

Definition at line 68 of file CFSDropTarget.cpp.

69{
70 // FIXME: When the source is on a different volume than the target, change default from move to copy
71}

Referenced by CFSDropTarget::_GetEffectFromMenu(), and CFSDropTarget::_QueryDrop().

◆ PathIsDriveRoot()

static bool PathIsDriveRoot ( LPCWSTR  Path)
static

Definition at line 52 of file CFSDropTarget.cpp.

53{
55}
PRTL_UNICODE_STRING_BUFFER Path
int WINAPI PathGetDriveNumberW(const WCHAR *path)
Definition: path.c:553
BOOL WINAPI PathIsRootW(LPCWSTR lpszPath)
Definition: path.c:1648

Referenced by CFSDropTarget::DragEnter().

◆ PathIsSameDrive()

static bool PathIsSameDrive ( LPCWSTR  Path1,
LPCWSTR  Path2 
)
static

Definition at line 46 of file CFSDropTarget.cpp.

47{
48 int d1 = PathGetDriveNumberW(Path1), d2 = PathGetDriveNumberW(Path2);
49 return d1 == d2 && d2 >= 0;
50}

Referenced by CFSDropTarget::DragEnter().

◆ SHELL_LimitDropEffectToItemAttributes()

static HRESULT SHELL_LimitDropEffectToItemAttributes ( _In_ IDataObject pDataObject,
_Inout_ PDWORD  pdwEffect 
)
static

Definition at line 58 of file CFSDropTarget.cpp.

59{
60 DWORD att = *pdwEffect & (SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_CANLINK); // DROPEFFECT maps perfectly to these SFGAO bits
61 HRESULT hr = SHGetAttributesFromDataObject(pDataObject, att, &att, NULL);
62 if (FAILED(hr))
63 return S_FALSE;
64 *pdwEffect &= ~(SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_CANLINK) | att;
65 return hr;
66}
#define NULL
Definition: types.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FAILED(hr)
Definition: intsafe.h:51
EXTERN_C HRESULT WINAPI SHGetAttributesFromDataObject(IDataObject *pDataObject, DWORD dwAttributeMask, DWORD *pdwAttributes, UINT *pcItems)
HRESULT hr
Definition: shlfolder.c:183
#define S_FALSE
Definition: winerror.h:2357

Referenced by CFSDropTarget::_GetEffectFromMenu(), and CFSDropTarget::DragEnter().

◆ SHELL_StripIllegalFsNameCharacters()

static void SHELL_StripIllegalFsNameCharacters ( _Inout_ LPWSTR  Buf)
static

Definition at line 32 of file CFSDropTarget.cpp.

33{
34 for (LPWSTR src = Buf, dst = src;;)
35 {
36 *dst = *src;
37 if (!*dst)
38 break;
40 src = CharNextW(src);
41 else
42 ++src, ++dst;
43 }
44}
#define wcschr
Definition: compat.h:17
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
#define INVALID_FILETITLE_CHARACTERSW
Definition: undocshell.h:984
LPWSTR WINAPI CharNextW(_In_ LPCWSTR)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CFSDropTarget::_DoDrop().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )