ReactOS  0.4.15-dev-5499-g1341c38
iernonce.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS system libraries
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: ReactOS Extended RunOnce processing with UI.
5  * COPYRIGHT: Copyright 2013-2016 Robert Naumann
6  * Copyright 2021 He Yang <1160386205@qq.com>
7  */
8 
9 #include "iernonce.h"
10 
13 
14 BOOL
15 WINAPI
19 {
20  switch (dwReason)
21  {
22  case DLL_PROCESS_ATTACH:
23  DisableThreadLibraryCalls(hinstDLL);
24  break;
25  case DLL_PROCESS_DETACH:
26  break;
27  }
28 
29  return TRUE;
30 }
31 
32 extern "C" VOID WINAPI
35  _In_ LPCSTR pszCmdLine,
36  _In_ int nCmdShow)
37 {
38  // iernonce may use shell32 API.
40  if (Result != S_OK && Result != S_FALSE)
41  {
42  return;
43  }
44 
46  for (UINT i = 0; i < _countof(RootKeys); ++i)
47  {
49  Instance.Run(g_bSilence);
50  }
51 
53 }
54 
55 extern "C" VOID WINAPI
57  _In_ BOOL bSilence)
58 {
60  g_bSilence = bSilence;
61 }
#define TRUE
Definition: types.h:120
#define HKEY_CURRENT_USER
Definition: winreg.h:11
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
ROOT_KEY RootKeys[]
Definition: registry.c:70
DWORD dwReason
Definition: misc.cpp:154
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
r reserved
Definition: btrfs.c:3006
#define S_FALSE
Definition: winerror.h:2357
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
#define _In_
Definition: ms_sal.h:308
BOOL WINAPI DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD dwReason, _In_ LPVOID reserved)
Definition: iernonce.cpp:16
const char * LPCSTR
Definition: xmlstorage.h:183
#define DLL_PROCESS_DETACH
Definition: compat.h:130
LONG HRESULT
Definition: typedefs.h:79
#define _countof(array)
Definition: sndvol32.h:68
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL g_bSilence
Definition: iernonce.cpp:12
VOID WINAPI RunOnceExProcess(_In_ HWND hwnd, _In_ HINSTANCE hInst, _In_ LPCSTR pszCmdLine, _In_ int nCmdShow)
Definition: iernonce.cpp:33
VOID(CALLBACK * RUNONCEEX_CALLBACK)(_In_ UINT CompleteCnt, _In_ UINT TotalCnt, _In_ DWORD_PTR dwReserved)
Definition: iernonce_undoc.h:9
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:456
#define S_OK
Definition: intsafe.h:52
HINSTANCE hInst
Definition: dxdiag.c:13
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
RUNONCEEX_CALLBACK g_Callback
Definition: iernonce.cpp:11
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
VOID WINAPI InitCallback(_In_ RUNONCEEX_CALLBACK Callback, _In_ BOOL bSilence)
Definition: iernonce.cpp:56
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
IN PVOID Instance
Definition: pci.h:361
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12