ReactOS 0.4.16-dev-319-g6cf4263
CCopyAsPathMenu.cpp File Reference
#include "precomp.h"
Include dependency graph for CCopyAsPathMenu.cpp:

Go to the source code of this file.

Macros

#define IDC_COPYASPATH   0
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static DWORD SetClipboard (UINT cf, const void *data, SIZE_T size)
 
static DWORD SetClipboardFromString (LPCWSTR str)
 
static void AppendToPathList (CStringW &paths, LPCWSTR path, DWORD index)
 

Macro Definition Documentation

◆ IDC_COPYASPATH

#define IDC_COPYASPATH   0

Definition at line 13 of file CCopyAsPathMenu.cpp.

Function Documentation

◆ AppendToPathList()

static void AppendToPathList ( CStringW paths,
LPCWSTR  path,
DWORD  index 
)
static

Definition at line 61 of file CCopyAsPathMenu.cpp.

62{
63 if (index)
64 paths += L"\r\n";
65 LPCWSTR quote = StrChrW(path, L' ');
66 if (quote)
67 paths += L'\"';
68 paths += path;
69 if (quote)
70 paths += L'\"';
71}
static const WCHAR quote[]
Definition: reg.c:40
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
Definition: string.c:464
GLuint index
Definition: glext.h:6031
GLsizei const GLuint * paths
Definition: glext.h:11717
#define L(x)
Definition: ntvdm.h:50
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by CCopyAsPathMenu::DoCopyAsPath().

◆ SetClipboard()

static DWORD SetClipboard ( UINT  cf,
const void data,
SIZE_T  size 
)
static

Definition at line 24 of file CCopyAsPathMenu.cpp.

25{
26 BOOL succ = FALSE;
28 if (handle)
29 {
30 LPVOID clipdata = GlobalLock(handle);
31 if (clipdata)
32 {
33 CopyMemory(clipdata, data, size);
36 {
38 succ = SetClipboardData(cf, handle) != NULL;
40 }
41 }
42 if (!succ)
43 {
45 }
46 }
47 return succ ? ERROR_SUCCESS : GetLastError();
48}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CopyMemory
Definition: winbase.h:1735
#define GMEM_MOVEABLE
Definition: winbase.h:320
#define GMEM_SHARE
Definition: winbase.h:331
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190

Referenced by DECLARE_INTERFACE_(), and SetClipboardFromString().

◆ SetClipboardFromString()

static DWORD SetClipboardFromString ( LPCWSTR  str)
static

Definition at line 51 of file CCopyAsPathMenu.cpp.

52{
53 SIZE_T cch = lstrlenW(str) + 1, size = cch * sizeof(WCHAR);
54 if (size > cch)
56 else
58}
static DWORD SetClipboard(UINT cf, const void *data, SIZE_T size)
#define CF_UNICODETEXT
Definition: constants.h:408
#define lstrlenW
Definition: compat.h:750
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
const WCHAR * str
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CCopyAsPathMenu::DoCopyAsPath().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )