ReactOS  0.4.15-dev-5500-g82cf6c2
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_Name
Definition: registry.h:35
ATL::CStringW m_Value
Definition: registry.h:34
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406

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
ATL::CStringW m_Name
Definition: registry.h:35

◆ 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 CloseHandle
Definition: compat.h:739
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
void WINAPI PathRemoveArgsW(LPWSTR lpszPath)
Definition: path.c:779
#define SEE_MASK_NOCLOSEPROCESS
Definition: shellapi.h:31
#define TRUE
Definition: types.h:120
static BOOLEAN bSuccess
Definition: drive.cpp:433
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
ATL::CStringW m_Value
Definition: registry.h:34
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2335
_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 SW_SHOWNORMAL
Definition: winuser.h:764
LPWSTR WINAPI PathGetArgsW(LPCWSTR lpszPath)
Definition: path.c:506
CAtlStringW CStringW
Definition: atlstr.h:130
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define INFINITE
Definition: serial.h:102

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 }
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
ATL::CStringW m_Name
Definition: registry.h:35
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

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: