ReactOS 0.4.17-dev-806-gffa4164
advpack_private.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

HRESULT do_ocx_reg (HMODULE hocx, BOOL do_reg, const WCHAR *flags, const WCHAR *param)
 
LPWSTR get_parameter (LPWSTR *params, WCHAR separator, BOOL quoted)
 
void set_ldids (HINF hInf, LPCWSTR pszInstallSection, LPCWSTR pszWorkingDir)
 
HRESULT launch_exe (LPCWSTR cmd, LPCWSTR dir, HANDLE *phEXE)
 
static charstrdupWtoA (const WCHAR *str)
 

Function Documentation

◆ do_ocx_reg()

HRESULT do_ocx_reg ( HMODULE  hocx,
BOOL  do_reg,
const WCHAR flags,
const WCHAR param 
)

Definition at line 427 of file advpack.c.

428{
429 DLLREGISTER reg_func;
430
431 if (do_reg)
432 reg_func = (DLLREGISTER)GetProcAddress(hocx, "DllRegisterServer");
433 else
434 reg_func = (DLLREGISTER)GetProcAddress(hocx, "DllUnregisterServer");
435
436 if (!reg_func)
437 return E_FAIL;
438
439 reg_func();
440 return S_OK;
441}
#define E_FAIL
Definition: ddrawi.h:102
HRESULT(WINAPI * DLLREGISTER)(void)
Definition: advpack.c:38
#define GetProcAddress(x, y)
Definition: compat.h:753
#define S_OK
Definition: intsafe.h:52

Referenced by register_ocxs_callback(), and RegisterOCX().

◆ get_parameter()

LPWSTR get_parameter ( LPWSTR params,
WCHAR  separator,
BOOL  quoted 
)

Definition at line 178 of file install.c.

179{
181
182 if (!*params)
183 return NULL;
184
185 if (quoted && *token == '"')
186 {
187 WCHAR *end = wcschr(token + 1, '"');
188 if (end)
189 {
190 *end = 0;
191 *params = end + 1;
192 token = token + 1;
193 }
194 }
195
197 if (*params)
198 *(*params)++ = '\0';
199
200 if (!*token)
201 return NULL;
202
203 return token;
204}
#define NULL
Definition: types.h:112
#define wcschr
Definition: compat.h:17
static const WCHAR separator[]
Definition: asmname.c:65
GLuint GLuint end
Definition: gl.h:1545
GLenum const GLfloat * params
Definition: glext.h:5645
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 token
Definition: glfuncs.h:210
short WCHAR
Definition: pedump.c:58
uint16_t * LPWSTR
Definition: typedefs.h:56

Referenced by DelNodeRunDLL32W(), LaunchINFSectionExW(), LaunchINFSectionW(), RegisterOCX(), and set_ldids().

◆ launch_exe()

HRESULT launch_exe ( LPCWSTR  cmd,
LPCWSTR  dir,
HANDLE phEXE 
)

Definition at line 850 of file install.c.

851{
854
855 if (phEXE) *phEXE = NULL;
856
857 ZeroMemory(&pi, sizeof(pi));
858 ZeroMemory(&si, sizeof(si));
859 si.cb = sizeof(si);
860
863 NULL, dir, &si, &pi))
864 {
866 }
867
869
870 if (phEXE)
871 {
872 *phEXE = pi.hProcess;
873 return S_ASYNCHRONOUS;
874 }
875
876 /* wait for the child process to finish */
879
880 return S_OK;
881}
#define S_ASYNCHRONOUS
Definition: urlmon.idl:2172
unsigned int dir
Definition: maze.c:112
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4491
#define INFINITE
Definition: serial.h:102
#define ZeroMemory
Definition: minwinbase.h:31
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
static SYSTEM_INFO si
Definition: virtual.c:39
Definition: ftp_var.h:139
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CREATE_DEFAULT_ERROR_MODE
Definition: winbase.h:216
#define CREATE_NEW_PROCESS_GROUP
Definition: winbase.h:190
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210

Referenced by run_setup_commands_callback(), RunSetupCommandW(), and UserInstStubWrapperW().

◆ set_ldids()

void set_ldids ( HINF  hInf,
LPCWSTR  pszInstallSection,
LPCWSTR  pszWorkingDir 
)

Definition at line 100 of file advpack.c.

101{
106 DWORD size;
107 int ldid;
108
109 if (!SetupGetLineTextW(NULL, hInf, pszInstallSection, L"CustomDestination",
111 return;
112
113 if (!SetupFindFirstLineW(hInf, field, NULL, &context))
114 return;
115
116 do
117 {
118 LPWSTR value, ptr, key, key_copy = NULL;
119 DWORD flags = 0;
120
123
124 /* SetupGetLineTextW returns the value if there is only one key, but
125 * returns the whole line if there is more than one key
126 */
127 if (!(value = wcschr(line, '=')))
128 {
130 key = malloc(size * sizeof(WCHAR));
131 key_copy = key;
133 value = line;
134 }
135 else
136 {
137 key = line;
138 *(value++) = '\0';
139 }
140
141 /* remove leading whitespace from the value */
142 while (*value == ' ')
143 value++;
144
145 /* Extract the flags */
146 ptr = wcschr(value, ',');
147 if (ptr) {
148 *ptr = '\0';
149 flags = wcstol(ptr+1, NULL, 10);
150 }
151
152 /* set dest to pszWorkingDir if key is SourceDir */
153 if (pszWorkingDir && !lstrcmpiW(value, L"SourceDir"))
154 lstrcpynW(dest, pszWorkingDir, MAX_PATH);
155 else
157
158 /* If prompting required, provide dialog to request path */
159 if (flags & 0x04)
160 FIXME("Need to support changing paths - default will be used\n");
161
162 /* set all ldids to dest */
163 while ((ptr = get_parameter(&key, ',', FALSE)))
164 {
165 ldid = wcstol(ptr, NULL, 10);
166 SetupSetDirectoryIdW(hInf, ldid, dest);
167 }
168 free(key_copy);
169 } while (SetupFindNextLine(&context, &context));
170}
LPWSTR get_parameter(LPWSTR *params, WCHAR separator, BOOL quoted)
Definition: install.c:178
#define FIXME(fmt,...)
Definition: precomp.h:53
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
BOOL WINAPI SetupSetDirectoryIdW(HINF hinf, DWORD id, PCWSTR dir)
Definition: dirid.c:256
#define MAX_FIELD_LENGTH
Definition: advpack.c:40
static void get_dest_dir(HINF hInf, PCWSTR pszSection, PWSTR pszBuffer, DWORD dwSize)
Definition: advpack.c:62
#define MAX_PATH
Definition: compat.h:34
#define lstrcpynW
Definition: compat.h:738
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2752
BOOL WINAPI SetupGetLineTextW(PINFCONTEXT context, HINF hinf, PCWSTR section_name, PCWSTR key_name, PWSTR buffer, DWORD size, PDWORD required)
Definition: parser.c:1763
#define L(x)
Definition: resources.c:13
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLbitfield flags
Definition: glext.h:7161
static PVOID ptr
Definition: dispmode.c:27
static char * dest
Definition: rtl.c:149
Definition: http.c:7252
Definition: parser.c:44
Definition: copy.c:22
Definition: parser.c:49
Definition: pdh_main.c:96
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:186
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:56
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:82

Referenced by install_init(), OpenINFEngineW(), and TranslateInfStringW().

◆ strdupWtoA()

static char * strdupWtoA ( const WCHAR str)
inlinestatic

Definition at line 30 of file advpack_private.h.

31{
32 char *ret = NULL;
33
34 if(str) {
35 size_t size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
36 ret = malloc(size);
37 if(ret)
39 }
40
41 return ret;
42}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
return ret
Definition: mutex.c:147
const WCHAR * str

Referenced by cabinet_next_cabinet(), ExtractFilesW(), ITERATE_BindImage(), s_remote_GetActionInfo(), scrolltext_add_text(), and wintypeWtoA().