ReactOS 0.4.15-dev-8131-g4988de4
ACPPage.cpp File Reference
#include "precomp.h"
#include <shellutils.h>
Include dependency graph for ACPPage.cpp:

Go to the source code of this file.

Classes

class  CLayerUIPropPageModule
 

Functions

EXTERN_C BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
 
STDAPI DllCanUnloadNow ()
 
STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
STDAPI DllRegisterServer ()
 
STDAPI DllUnregisterServer ()
 
EXTERN_C BOOL WINAPI GetExeFromLnk (PCWSTR pszLnk, PWSTR pszExe, size_t cchSize)
 

Variables

HMODULE g_hModule = NULL
 
LONG g_ModuleRefCnt = 0
 
CLayerUIPropPageModule gModule
 

Function Documentation

◆ DllCanUnloadNow()

STDAPI DllCanUnloadNow ( void  )

Definition at line 44 of file ACPPage.cpp.

45{
47 return S_FALSE;
48 return gModule.DllCanUnloadNow();
49}
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
CLayerUIPropPageModule gModule
Definition: ACPPage.cpp:24
HRESULT DllCanUnloadNow()
Definition: atlbase.h:1030
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 51 of file ACPPage.cpp.

52{
53 return gModule.DllGetClassObject(rclsid, riid, ppv);
54}
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

◆ DllMain()

EXTERN_C BOOL WINAPI DllMain ( HINSTANCE  hInstance,
DWORD  dwReason,
LPVOID  lpReserved 
)

Definition at line 27 of file ACPPage.cpp.

28{
29 switch (dwReason)
30 {
34 gModule.Init(ObjectMap, hInstance, NULL);
35 break;
37 gModule.Term();
38 break;
39 }
40
41 return(TRUE);
42}
HMODULE g_hModule
Definition: ACPPage.cpp:12
DWORD dwReason
Definition: misc.cpp:154
HINSTANCE hInstance
Definition: charmap.c:19
void Term()
Definition: atlbase.h:916
HRESULT Init(_ATL_OBJMAP_ENTRY *p, HINSTANCE, const GUID *plibid)
Definition: atlbase.h:886
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85

◆ DllRegisterServer()

STDAPI DllRegisterServer ( void  )

Definition at line 56 of file ACPPage.cpp.

57{
58 HRESULT hr;
59
61 if (FAILED(hr))
62 return hr;
63
64 return S_OK;
65}
HRESULT DllRegisterServer(BOOL bRegTypeLib=TRUE)
Definition: atlbase.h:1042
#define FALSE
Definition: types.h:117
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183

◆ DllUnregisterServer()

STDAPI DllUnregisterServer ( void  )

Definition at line 67 of file ACPPage.cpp.

68{
69 HRESULT hr;
70
72 if (FAILED(hr))
73 return hr;
74
75 return S_OK;
76}
HRESULT DllUnregisterServer(BOOL bUnRegTypeLib=TRUE)
Definition: atlbase.h:1047

◆ GetExeFromLnk()

EXTERN_C BOOL WINAPI GetExeFromLnk ( PCWSTR  pszLnk,
PWSTR  pszExe,
size_t  cchSize 
)

Definition at line 79 of file ACPPage.cpp.

80{
81 CCoInit init;
83 return FALSE;
84
85 CComPtr<IShellLinkW> spShellLink;
86 if (FAILED_UNEXPECTEDLY(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IShellLinkW, &spShellLink))))
87 return FALSE;
88
89 CComPtr<IPersistFile> spPersistFile;
90 if (FAILED_UNEXPECTEDLY(spShellLink->QueryInterface(IID_PPV_ARG(IPersistFile, &spPersistFile))))
91 return FALSE;
92
93 if (FAILED_UNEXPECTEDLY(spPersistFile->Load(pszLnk, STGM_READ)) || FAILED_UNEXPECTEDLY(spShellLink->Resolve(NULL, SLR_NO_UI | SLR_NOUPDATE | SLR_NOSEARCH)))
94 return FALSE;
95
96 return !FAILED_UNEXPECTEDLY(spShellLink->GetPath(pszExe, cchSize, NULL, SLGP_RAWPATH));
97}
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define STGM_READ
Definition: objbase.h:917
static int init
Definition: wintirpc.c:33
#define IID_PPV_ARG(Itype, ppType)

Referenced by CLayerUIPropPage::InitFile().

Variable Documentation

◆ g_hModule

◆ g_ModuleRefCnt

◆ gModule