ReactOS  0.4.15-dev-1070-ge1a01de
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 {
22  HANDLE hFile;
26  {
28  return TRUE;
29  }
30  return FALSE;
31 }
#define CloseHandle
Definition: compat.h:487
#define INVALID_HANDLE_VALUE
Definition: compat.h:479
#define FILE_SHARE_READ
Definition: compat.h:136
#define FALSE
Definition: types.h:117
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
return TRUE
Definition: mydocs.cpp:113
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
_In_ HANDLE hFile
Definition: mswsock.h:90
#define CREATE_ALWAYS
Definition: disk.h:72
#define CreateFileW
Definition: compat.h:489

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 E_FAIL
Definition: ddrawi.h:102
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
#define CSIDL_MYDOCUMENTS
Definition: shlobj.h:2024
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:389
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
static const WCHAR L[]
Definition: oid.c:1250
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:51
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:2709
static BOOL CreateEmptyFile(LPCWSTR pszFile)
Definition: mydocs.cpp:20
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166

Referenced by DllRegisterServer().

◆ DllCanUnloadNow()

STDAPI DllCanUnloadNow ( void  )

Definition at line 60 of file mydocs.cpp.

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

◆ 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 hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: atlbase.h:935
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
CComModule gModule
Definition: mydocs.cpp:16

◆ 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))
87  CreateSendToMyDocuments(szSendTo);
88 
89  return S_OK;
90 }
HRESULT DllRegisterServer(BOOL bRegTypeLib=TRUE)
Definition: atlbase.h:940
HRESULT hr
Definition: shlfolder.c:183
#define FALSE
Definition: types.h:117
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:34
static HRESULT GetDefaultUserSendTo(LPWSTR pszPath)
Definition: mydocs.cpp:54
static HRESULT CreateSendToMyDocuments(LPCWSTR pszSendTo)
Definition: mydocs.cpp:34
#define S_OK
Definition: intsafe.h:51
CComModule gModule
Definition: mydocs.cpp:16
#define SUCCEEDED(hr)
Definition: intsafe.h:49

◆ DllUnregisterServer()

STDAPI DllUnregisterServer ( void  )

Definition at line 92 of file mydocs.cpp.

93 {
96  return hr;
97 
98  return S_OK;
99 }
HRESULT hr
Definition: shlfolder.c:183
#define FALSE
Definition: types.h:117
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define S_OK
Definition: intsafe.h:51
CComModule gModule
Definition: mydocs.cpp:16
HRESULT DllUnregisterServer(BOOL bUnRegTypeLib=TRUE)
Definition: atlbase.h:945

◆ GetDefaultUserSendTo()

static HRESULT GetDefaultUserSendTo ( LPWSTR  pszPath)
static

Definition at line 54 of file mydocs.cpp.

55 {
57  SHGFP_TYPE_DEFAULT, pszPath);
58 }
#define INVALID_HANDLE_VALUE
Definition: compat.h:479
smooth NULL
Definition: ftsmooth.c:416
#define CSIDL_SENDTO
Definition: shlobj.h:2021
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2208

Referenced by DllRegisterServer().

◆ if()

Definition at line 104 of file mydocs.cpp.

105  {
106  gModule.Init(ObjectMap, hInstance, NULL);
108  }
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
HRESULT Init(_ATL_OBJMAP_ENTRY *p, HINSTANCE, const GUID *plibid)
Definition: atlbase.h:797
HINSTANCE hInstance
Definition: charmap.c:20
smooth NULL
Definition: ftsmooth.c:416
CComModule gModule
Definition: mydocs.cpp:16

◆ 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
HINSTANCE hInstance
Definition: charmap.c:20
DWORD dwReason
Definition: mydocs.cpp:101
#define TRACE(s)
Definition: solgame.cpp:4

Definition at line 102 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().