#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winnls.h"
#include "winerror.h"
#include "winuser.h"
#include "winternl.h"
#include "advpub.h"
#include "wine/debug.h"
Go to the source code of this file.
|
| | WINE_DEFAULT_DEBUG_CHANNEL (advpack) |
| |
| static BOOL | get_temp_ini_path (LPWSTR name) |
| |
| static BOOL | create_tmp_ini_file (HMODULE hm, WCHAR *ini_file) |
| |
| static void | strentry_atow (const STRENTRYA *aentry, STRENTRYW *wentry) |
| |
| static STRTABLEW * | strtable_atow (const STRTABLEA *atable) |
| |
| static void | free_strtable (STRTABLEW *wtable) |
| |
| HRESULT WINAPI | RegInstallA (HMODULE hm, LPCSTR pszSection, const STRTABLEA *pstTable) |
| |
| static HRESULT | write_predefined_strings (HMODULE hm, LPCWSTR ini_path) |
| |
| HRESULT WINAPI | RegInstallW (HMODULE hm, LPCWSTR pszSection, const STRTABLEW *pstTable) |
| |
| HRESULT WINAPI | RegRestoreAllA (HWND hWnd, LPSTR pszTitleString, HKEY hkBackupKey) |
| |
| HRESULT WINAPI | RegRestoreAllW (HWND hWnd, LPWSTR pszTitleString, HKEY hkBackupKey) |
| |
| HRESULT WINAPI | RegSaveRestoreA (HWND hWnd, LPCSTR pszTitleString, HKEY hkBackupKey, LPCSTR pcszRootKey, LPCSTR pcszSubKey, LPCSTR pcszValueName, DWORD dwFlags) |
| |
| HRESULT WINAPI | RegSaveRestoreW (HWND hWnd, LPCWSTR pszTitleString, HKEY hkBackupKey, LPCWSTR pcszRootKey, LPCWSTR pcszSubKey, LPCWSTR pcszValueName, DWORD dwFlags) |
| |
| HRESULT WINAPI | RegSaveRestoreOnINFA (HWND hWnd, LPCSTR pszTitle, LPCSTR pszINF, LPCSTR pszSection, HKEY hHKLMBackKey, HKEY hHKCUBackKey, DWORD dwFlags) |
| |
| HRESULT WINAPI | RegSaveRestoreOnINFW (HWND hWnd, LPCWSTR pszTitle, LPCWSTR pszINF, LPCWSTR pszSection, HKEY hHKLMBackKey, HKEY hHKCUBackKey, DWORD dwFlags) |
| |
◆ create_tmp_ini_file()
Definition at line 46 of file reg.c.
47{
48 HRSRC hrsrc;
50 DWORD rsrc_size, bytes_written;
53
55 ERR(
"Can't get temp ini file path\n");
57 }
58
60 ERR(
"Can't find REGINST resource\n");
62 }
63
67
68 if(!rsrc_data || !rsrc_size) {
69 ERR(
"Can't load REGINST resource\n");
71 }
72
75 ERR(
"Unable to create temp ini file\n");
77 }
78 if(!
WriteFile(hf, rsrc_data, rsrc_size, &bytes_written,
NULL) || rsrc_size != bytes_written) {
79 ERR(
"Write failed\n");
81 }
89}
static BOOL get_temp_ini_path(LPWSTR name)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
BOOL WINAPI FreeResource(HGLOBAL handle)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Referenced by RegInstallW().
◆ free_strtable()
Definition at line 120 of file reg.c.
121{
123
125 {
128 }
129
132}
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 GLint GLint j
Referenced by RegInstallA().
◆ get_temp_ini_path()
Definition at line 34 of file reg.c.
35{
37
40
44}
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Referenced by create_tmp_ini_file().
◆ RegInstallA()
Definition at line 139 of file reg.c.
140{
144
146
147 if (pstTable)
149 else
151
153
155
156 if (pstTable)
158
160
162}
HRESULT WINAPI RegInstallW(HMODULE hm, LPCWSTR pszSection, const STRTABLEW *pstTable)
static void free_strtable(STRTABLEW *wtable)
static STRTABLEW * strtable_atow(const STRTABLEA *atable)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
Referenced by register_iexplore().
◆ RegInstallW()
Definition at line 212 of file reg.c.
213{
218
220
223
225 goto done;
226
227
228 if (pstTable)
229 {
231 {
233
234 tmp_value[0] = '\"';
237
239 }
240 }
241
242
244
245
247 cabinfo.
pszInf = tmp_ini_path;
250
252
253done:
254
256
258}
HRESULT WINAPI ExecuteCabW(HWND hwnd, CABINFOW *pCab, LPVOID pReserved)
static HRESULT write_predefined_strings(HMODULE hm, LPCWSTR ini_path)
static BOOL create_tmp_ini_file(HMODULE hm, WCHAR *ini_file)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
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
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Referenced by RegInstallA().
◆ RegRestoreAllA()
Definition at line 265 of file reg.c.
266{
269
271
273
275
277
279}
HRESULT WINAPI RegRestoreAllW(HWND hWnd, LPWSTR pszTitleString, HKEY hkBackupKey)
◆ RegRestoreAllW()
◆ RegSaveRestoreA()
Definition at line 310 of file reg.c.
313{
316
320
325
328
333
335}
HRESULT WINAPI RegSaveRestoreW(HWND hWnd, LPCWSTR pszTitleString, HKEY hkBackupKey, LPCWSTR pcszRootKey, LPCWSTR pcszSubKey, LPCWSTR pcszValueName, DWORD dwFlags)
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
◆ RegSaveRestoreOnINFA()
Definition at line 374 of file reg.c.
377{
380
383 hHKLMBackKey, hHKCUBackKey,
dwFlags);
384
388
390 hHKLMBackKey, hHKCUBackKey,
dwFlags);
391
395
397}
HRESULT WINAPI RegSaveRestoreOnINFW(HWND hWnd, LPCWSTR pszTitle, LPCWSTR pszINF, LPCWSTR pszSection, HKEY hHKLMBackKey, HKEY hHKCUBackKey, DWORD dwFlags)
◆ RegSaveRestoreOnINFW()
◆ RegSaveRestoreW()
◆ strentry_atow()
Definition at line 91 of file reg.c.
92{
93 DWORD name_len, val_len;
94
97
100
103}
#define MultiByteToWideChar
Referenced by strtable_atow().
◆ strtable_atow()
Definition at line 105 of file reg.c.
106{
109
113
116
117 return wtable;
118}
static void strentry_atow(const STRENTRYA *aentry, STRENTRYW *wentry)
Referenced by RegInstallA().
◆ WINE_DEFAULT_DEBUG_CHANNEL()
| WINE_DEFAULT_DEBUG_CHANNEL |
( |
advpack |
| ) |
|
◆ write_predefined_strings()
Definition at line 164 of file reg.c.
165{
169
170 *mod_path = '\"';
173
176
177 *sys_root = '\0';
179
181 {
182 *sys_mod_path = '\"';
183 lstrcpyW(sys_mod_path + 1,
L"%SystemRoot%");
185 }
186 else
187 {
188 FIXME(
"SYS_MOD_PATH needs more work\n");
190 }
191
193
195}
#define GetEnvironmentVariableW(x, y, z)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Referenced by RegInstallW().