ReactOS 0.4.15-dev-7681-g776c3a3
mydocs.cpp File Reference
#include "precomp.hpp"
Include dependency graph for mydocs.cpp:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (mydocs)
 
static BOOL CreateEmptyFile (LPCWSTR pszFile)
 
static HRESULT CreateSendToMyDocuments (LPCWSTR pszSendTo)
 
static HRESULT GetDefaultUserSendTo (LPWSTR pszPath)
 
STDAPI DllCanUnloadNow (void)
 
STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
STDAPI DllRegisterServer (void)
 
STDAPI DllUnregisterServer (void)
 
 STDAPI_ (BOOL) DllMain(HINSTANCE hInstance
 
 if (dwReason==DLL_PROCESS_ATTACH)
 

Variables

CComModule gModule
 
LONG g_ModuleRefCnt = 0
 
DWORD dwReason
 
DWORD LPVOID fImpLoad
 
return TRUE
 

Function Documentation

◆ CreateEmptyFile()

static BOOL CreateEmptyFile ( LPCWSTR  pszFile)
static

Definition at line 20 of file mydocs.cpp.

21{
26 {
28 return TRUE;
29 }
30 return FALSE;
31}
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
#define CREATE_ALWAYS
Definition: disk.h:72
_In_ HANDLE hFile
Definition: mswsock.h:90
return TRUE
Definition: mydocs.cpp:113
#define GENERIC_WRITE
Definition: nt_native.h:90

Referenced by CreateSendToMyDocuments().

◆ CreateSendToMyDocuments()

static HRESULT CreateSendToMyDocuments ( LPCWSTR  pszSendTo)
static

Definition at line 34 of file mydocs.cpp.

35{
36 WCHAR szTarget[MAX_PATH], szSendToFile[MAX_PATH];
37
39
40 StringCbCopyW(szSendToFile, sizeof(szSendToFile), pszSendTo);
41 PathAppendW(szSendToFile, PathFindFileNameW(szTarget));
42 StringCbCatW(szSendToFile, sizeof(szSendToFile), L".mydocs");
43
44 if (!CreateEmptyFile(szSendToFile))
45 {
46 ERR("CreateEmptyFile(%S, %S) failed!\n", szSendToFile, szTarget);
47 return E_FAIL;
48 }
49
50 return S_OK;
51}
#define ERR(fmt,...)
Definition: debug.h:110
#define E_FAIL
Definition: ddrawi.h:102
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:3061
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
#define S_OK
Definition: intsafe.h:52
static BOOL CreateEmptyFile(LPCWSTR pszFile)
Definition: mydocs.cpp:20
#define L(x)
Definition: ntvdm.h:50
#define PathAppendW
Definition: pathcch.h:309
#define CSIDL_MYDOCUMENTS
Definition: shlobj.h:2103
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DllRegisterServer().

◆ DllCanUnloadNow()

STDAPI DllCanUnloadNow ( void  )

Definition at line 60 of file mydocs.cpp.

61{
63 return S_FALSE;
64 return gModule.DllCanUnloadNow();
65}
HRESULT DllCanUnloadNow()
Definition: atlbase.h:1030
LONG g_ModuleRefCnt
Definition: mydocs.cpp:17
CComModule gModule
Definition: mydocs.cpp:16
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

STDAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 67 of file mydocs.cpp.

68{
69 TRACE("CLSID:%s,IID:%s\n", wine_dbgstr_guid(&rclsid), wine_dbgstr_guid(&riid));
70
72
73 TRACE("-- pointer to class factory: %p\n", *ppv);
74
75 return hr;
76}
HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: atlbase.h:1037
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4

◆ DllRegisterServer()

STDAPI DllRegisterServer ( void  )

Definition at line 78 of file mydocs.cpp.

79{
82 return hr;
83
84 WCHAR szSendTo[MAX_PATH];
85 hr = GetDefaultUserSendTo(szSendTo);
86 if (SUCCEEDED(hr))
88
89 return S_OK;
90}
HRESULT DllRegisterServer(BOOL bRegTypeLib=TRUE)
Definition: atlbase.h:1042
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static HRESULT CreateSendToMyDocuments(LPCWSTR pszSendTo)
Definition: mydocs.cpp:34
static HRESULT GetDefaultUserSendTo(LPWSTR pszPath)
Definition: mydocs.cpp:54

◆ DllUnregisterServer()

STDAPI DllUnregisterServer ( void  )

Definition at line 92 of file mydocs.cpp.

93{
96 return hr;
97
98 return S_OK;
99}
HRESULT DllUnregisterServer(BOOL bUnRegTypeLib=TRUE)
Definition: atlbase.h:1047

◆ GetDefaultUserSendTo()

static HRESULT GetDefaultUserSendTo ( LPWSTR  pszPath)
static

Definition at line 54 of file mydocs.cpp.

55{
57 SHGFP_TYPE_DEFAULT, pszPath);
58}
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2558
#define CSIDL_SENDTO
Definition: shlobj.h:2100
@ SHGFP_TYPE_DEFAULT
Definition: shlobj.h:2068

Referenced by DllRegisterServer().

◆ if()

Definition at line 104 of file mydocs.cpp.

105 {
106 gModule.Init(ObjectMap, hInstance, NULL);
108 }
HINSTANCE hInstance
Definition: charmap.c:19
HRESULT Init(_ATL_OBJMAP_ENTRY *p, HINSTANCE, const GUID *plibid)
Definition: atlbase.h:886
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85

◆ STDAPI_()

STDAPI_ ( BOOL  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( mydocs  )

Variable Documentation

◆ dwReason

DWORD dwReason

Definition at line 101 of file mydocs.cpp.

◆ fImpLoad

DWORD LPVOID fImpLoad
Initial value:
{
TRACE("%p 0x%x %p\n", hInstance, dwReason, fImpLoad)
DWORD LPVOID fImpLoad
Definition: mydocs.cpp:102
DWORD dwReason
Definition: mydocs.cpp:101

Definition at line 101 of file mydocs.cpp.

◆ g_ModuleRefCnt

LONG g_ModuleRefCnt = 0

Definition at line 17 of file mydocs.cpp.

Referenced by DllCanUnloadNow().

◆ gModule

CComModule gModule

◆ TRUE

return TRUE

Definition at line 113 of file mydocs.cpp.

Referenced by CreateEmptyFile().