ReactOS 0.4.15-dev-8079-g5db69da
advpack_private.h File Reference
#include "wine/heap.h"
Include dependency graph for advpack_private.h:
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) DECLSPEC_HIDDEN
 
LPWSTR get_parameter (LPWSTR *params, WCHAR separator, BOOL quoted) DECLSPEC_HIDDEN
 
void set_ldids (HINF hInf, LPCWSTR pszInstallSection, LPCWSTR pszWorkingDir) DECLSPEC_HIDDEN
 
HRESULT launch_exe (LPCWSTR cmd, LPCWSTR dir, HANDLE *phEXE) DECLSPEC_HIDDEN
 
static charheap_strdupWtoA (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 442 of file advpack.c.

443{
444 DLLREGISTER reg_func;
445
446 if (do_reg)
447 reg_func = (DLLREGISTER)GetProcAddress(hocx, "DllRegisterServer");
448 else
449 reg_func = (DLLREGISTER)GetProcAddress(hocx, "DllUnregisterServer");
450
451 if (!reg_func)
452 return E_FAIL;
453
454 reg_func();
455 return S_OK;
456}
#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 200 of file install.c.

201{
203
204 if (!*params)
205 return NULL;
206
207 if (quoted && *token == '"')
208 {
209 WCHAR *end = wcschr(token + 1, '"');
210 if (end)
211 {
212 *end = 0;
213 *params = end + 1;
214 token = token + 1;
215 }
216 }
217
219 if (*params)
220 *(*params)++ = '\0';
221
222 if (!*token)
223 return NULL;
224
225 return token;
226}
#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
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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

◆ heap_strdupWtoA()

static char * heap_strdupWtoA ( const WCHAR str)
inlinestatic

Definition at line 32 of file advpack_private.h.

33{
34 char *ret = NULL;
35
36 if(str) {
37 size_t size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
39 if(ret)
41 }
42
43 return ret;
44}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
GLsizeiptr size
Definition: glext.h:5919
const WCHAR * str
int ret

Referenced by CommitUrlCacheEntryW(), exec_fontname(), ExtractFilesW(), FindFirstUrlCacheEntryW(), FTP_SendCommand(), get_channel_http_header(), get_doc_string(), INTERNET_SendCallback(), is_supported_doc_mime(), nsChannel_AsyncOpen(), nsChannelBSC_on_progress(), query_global_option(), read_stream_data(), save_persistent_cookie(), and visit_http_headers().

◆ launch_exe()

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

Definition at line 894 of file install.c.

895{
896 STARTUPINFOW si;
898
899 if (phEXE) *phEXE = NULL;
900
901 ZeroMemory(&pi, sizeof(pi));
902 ZeroMemory(&si, sizeof(si));
903 si.cb = sizeof(si);
904
907 NULL, dir, &si, &pi))
908 {
910 }
911
912 CloseHandle(pi.hThread);
913
914 if (phEXE)
915 {
916 *phEXE = pi.hProcess;
917 return S_ASYNCHRONOUS;
918 }
919
920 /* wait for the child process to finish */
922 CloseHandle(pi.hProcess);
923
924 return S_OK;
925}
#define S_ASYNCHRONOUS
Definition: urlmon.idl:2120
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:4592
#define INFINITE
Definition: serial.h:102
static refpint_t pi[]
Definition: server.c:96
DWORD cb
Definition: winbase.h:852
Definition: ftp_var.h:139
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CREATE_DEFAULT_ERROR_MODE
Definition: winbase.h:194
#define CREATE_NEW_PROCESS_GROUP
Definition: winbase.h:185
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

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

◆ set_ldids()

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

Definition at line 109 of file advpack.c.

110{
115 DWORD size;
116 int ldid;
117
118 static const WCHAR source_dir[] = {'S','o','u','r','c','e','D','i','r',0};
119
120 static const WCHAR custDestW[] = {
121 'C','u','s','t','o','m','D','e','s','t','i','n','a','t','i','o','n',0
122 };
123
124 if (!SetupGetLineTextW(NULL, hInf, pszInstallSection, custDestW,
126 return;
127
128 if (!SetupFindFirstLineW(hInf, field, NULL, &context))
129 return;
130
131 do
132 {
133 LPWSTR value, ptr, key, key_copy = NULL;
134 DWORD flags = 0;
135
138
139 /* SetupGetLineTextW returns the value if there is only one key, but
140 * returns the whole line if there is more than one key
141 */
142 if (!(value = wcschr(line, '=')))
143 {
145 key = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
146 key_copy = key;
148 value = line;
149 }
150 else
151 {
152 key = line;
153 *(value++) = '\0';
154 }
155
156 /* remove leading whitespace from the value */
157 while (*value == ' ')
158 value++;
159
160 /* Extract the flags */
161 ptr = wcschr(value, ',');
162 if (ptr) {
163 *ptr = '\0';
164 flags = wcstol(ptr+1, NULL, 10);
165 }
166
167 /* set dest to pszWorkingDir if key is SourceDir */
168 if (pszWorkingDir && !lstrcmpiW(value, source_dir))
169 lstrcpynW(dest, pszWorkingDir, MAX_PATH);
170 else
172
173 /* If prompting required, provide dialog to request path */
174 if (flags & 0x04)
175 FIXME("Need to support changing paths - default will be used\n");
176
177 /* set all ldids to dest */
178 while ((ptr = get_parameter(&key, ',', FALSE)))
179 {
180 ldid = wcstol(ptr, NULL, 10);
181 SetupSetDirectoryIdW(hInf, ldid, dest);
182 }
183 HeapFree(GetProcessHeap(), 0, key_copy);
184 } while (SetupFindNextLine(&context, &context));
185}
LPWSTR get_parameter(LPWSTR *params, WCHAR separator, BOOL quoted) DECLSPEC_HIDDEN
Definition: install.c:200
#define FIXME(fmt,...)
Definition: debug.h:114
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:68
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define lstrcpynW
Definition: compat.h:738
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
BOOL WINAPI SetupGetLineTextW(PINFCONTEXT context, HINF hinf, PCWSTR section_name, PCWSTR key_name, PWSTR buffer, DWORD size, PDWORD required)
Definition: parser.c:1756
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
static PVOID ptr
Definition: dispmode.c:27
static char * dest
Definition: rtl.c:135
Definition: http.c:7252
Definition: parser.c:44
Definition: copy.c:22
Definition: parser.c:49
Definition: pdh_main.c:94
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().