ReactOS 0.4.15-dev-7918-g2a2556c
RunOnceExEntry Class Reference

#include <registry.h>

Collaboration diagram for RunOnceExEntry:

Public Member Functions

 RunOnceExEntry (_In_ const ATL::CStringW &Name, _In_ const ATL::CStringW &Value)
 
BOOL Delete (_In_ CRegKeyEx &hParentKey)
 
BOOL Exec () const
 

Private Attributes

ATL::CStringW m_Value
 
ATL::CStringW m_Name
 

Friends

int RunOnceExEntryCmp (_In_ const void *a, _In_ const void *b)
 

Detailed Description

Definition at line 31 of file registry.h.

Constructor & Destructor Documentation

◆ RunOnceExEntry()

RunOnceExEntry::RunOnceExEntry ( _In_ const ATL::CStringW Name,
_In_ const ATL::CStringW Value 
)

Definition at line 21 of file registry.cpp.

23 :
25{ ; }
ATL::CStringW m_Value
Definition: registry.h:34
ATL::CStringW m_Name
Definition: registry.h:35
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Member Function Documentation

◆ Delete()

BOOL RunOnceExEntry::Delete ( _In_ CRegKeyEx hParentKey)

Definition at line 27 of file registry.cpp.

29{
30 return hParentKey.DeleteValue(m_Name) == ERROR_SUCCESS;
31}
#define ERROR_SUCCESS
Definition: deptool.c:10

◆ Exec()

BOOL RunOnceExEntry::Exec ( ) const

Definition at line 33 of file registry.cpp.

34{
35 CStringW CommandLine;
36 if (wcsncmp(m_Value, L"||", 2) == 0)
37 {
38 // Remove the prefix.
39 CommandLine = (LPCWSTR)m_Value + 2;
40 }
41 else
42 {
43 CommandLine = m_Value;
44 }
45
46 // FIXME: SHEvaluateSystemCommandTemplate is not implemented
47 // using PathGetArgsW, PathRemoveArgsW as a workaround.
48 LPWSTR szCommandLine = CommandLine.GetBuffer();
49 LPCWSTR szParam = PathGetArgsW(szCommandLine);
50 PathRemoveArgsW(szCommandLine);
51
52 SHELLEXECUTEINFOW Info = { 0 };
53 Info.cbSize = sizeof(Info);
55 Info.lpFile = szCommandLine;
56 Info.lpParameters = szParam;
57 Info.nShow = SW_SHOWNORMAL;
58
60
61 CommandLine.ReleaseBuffer();
62
63 if (!bSuccess)
64 {
65 return FALSE;
66 }
67
68 if (Info.hProcess)
69 {
71 CloseHandle(Info.hProcess);
72 }
73
74 return TRUE;
75}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
void WINAPI PathRemoveArgsW(LPWSTR lpszPath)
Definition: path.c:779
LPWSTR WINAPI PathGetArgsW(LPCWSTR lpszPath)
Definition: path.c:506
static BOOLEAN bSuccess
Definition: drive.cpp:433
#define INFINITE
Definition: serial.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
CAtlStringW CStringW
Definition: atlstr.h:130
#define L(x)
Definition: ntvdm.h:50
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define SEE_MASK_NOCLOSEPROCESS
Definition: shellapi.h:31
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2391
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
#define SW_SHOWNORMAL
Definition: winuser.h:770
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Friends And Related Function Documentation

◆ RunOnceExEntryCmp

int RunOnceExEntryCmp ( _In_ const void a,
_In_ const void b 
)
friend

Definition at line 77 of file registry.cpp.

80{
81 return lstrcmpW(((RunOnceExEntry *)a)->m_Name,
82 ((RunOnceExEntry *)b)->m_Name);
83}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170

Member Data Documentation

◆ m_Name

ATL::CStringW RunOnceExEntry::m_Name
private

Definition at line 35 of file registry.h.

Referenced by Delete().

◆ m_Value

ATL::CStringW RunOnceExEntry::m_Value
private

Definition at line 34 of file registry.h.

Referenced by Exec().


The documentation for this class was generated from the following files: