97 if(
'0' <=
c &&
c <=
'9')
return c -
'0';
98 if(
'a' <=
c &&
c <=
'f')
return c -
'a' + 10;
99 if(
'A' <=
c &&
c <=
'F')
return c -
'A' + 10;
105 LPCOLESTR iter, iter2 = *
str;
118 if(*iter ==
'}' || *iter ==
'=') {
120 }
else if(*iter ==
'\'') {
124 iter =
wcschr(iter,
'\'');
126 WARN(
"Unexpected end of script\n");
130 if (iter[1] !=
'\'')
break;
150 LPCOLESTR iter, iter2 =
data;
160 iter =
wcschr(iter2,
'%');
167 for(rep_iter =
This->rep; rep_iter; rep_iter = rep_iter->
next) {
168 if(rep_iter->
key_len == iter-iter2
173 WARN(
"Could not find replacement: %s\n",
debugstr_wn(iter2, iter-iter2));
212 while(
buf->str[1] ||
buf->str[0] !=
'}') {
217 key_type = FORCE_REMOVE;
221 key_type = DO_DELETE;
231 if(key_type == IS_VAL) {
234 }
else if(key_type == DO_DELETE) {
238 if(key_type == FORCE_REMOVE)
242 WARN(
"Could not create(open) key: %08lx\n", lres);
247 }
else if(key_type != IS_VAL && key_type != DO_DELETE) {
254 if(key_type != DO_DELETE && *iter ==
'=') {
265 switch(
buf->str[0]) {
273 WARN(
"Could set value of key: %08lx\n", lres);
287 WARN(
"Could set value of key: %08lx\n", lres);
312 bytes[
i] = (d1 << 4) | d2;
318 WARN(
"Could not set value of key: 0x%08lx\n", lres);
338 }
else if(key_type == IS_VAL) {
339 WARN(
"value not set!\n");
344 if(key_type != IS_VAL && key_type != DO_DELETE && *iter ==
'{' &&
iswspace(iter[1])) {
353 TRACE(
"%x %x\n", do_register, key_type);
354 if(!do_register && (key_type ==
NORMAL || key_type == FORCE_REMOVE)) {
359 if(hkey && key_type != IS_VAL)
370 if(hkey && key_type != IS_VAL)
378 LPCOLESTR iter =
data;
390 WARN(
"ward.len == 0, failed\n");
406 if(
buf.str[1] ||
buf.str[0] !=
'{') {
413 WARN(
"Processing key failed: %08lx\n",
hres);
436 WARN(
"preprocessing failed!\n");
450 LPCOLESTR szID, LPCOLESTR szType,
BOOL do_register)
469 regstrw[
len-1] =
'\0';
475 WARN(
"could not load resource\n");
479 WARN(
"Could not find source\n");
484 WARN(
"Could not load resource file\n");
502 regstra =
malloc(filelen);
507 regstrw[
len-1] =
'\0';
533 IRegistrar_AddRef(iface);
555 IRegistrar_ClearReplacements(iface);
569 new_rep =
malloc(
sizeof(*new_rep));
609 LPCOLESTR szID, LPCOLESTR szType)
617 LPCOLESTR szID, LPCOLESTR szType)
653 UINT nID, LPCOLESTR szType)
661 UINT nID, LPCOLESTR szType)
691 registrar =
calloc(1,
sizeof(*registrar));
714 FIXME(
"hinst %p: did not get module name\n", inst);
729 IRegistrar_AddReplacement(registrar,
L"MODULE",
module_name);
731 for (iter = pMapEntries; iter && iter->
szKey; iter++)
732 IRegistrar_AddReplacement(registrar, iter->
szKey, iter->
szData);
739 if(registrar != pReg)
740 IRegistrar_Release(registrar);
static unsigned char bytes[4]
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define RegCloseKey(hKey)
IRegistrar IRegistrar_iface
LSTATUS WINAPI RegDeleteTreeW(_In_ HKEY, _In_opt_ LPCWSTR)
static LPCWSTR LPCWSTR module_name
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
static HRESULT WINAPI Registrar_QueryInterface(IRegistrar *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI Registrar_StringRegister(IRegistrar *iface, LPCOLESTR data)
static HRESULT do_preprocess(const Registrar *This, LPCOLESTR data, strbuf *buf)
static const IRegistrarVtbl RegistrarVtbl
static HRESULT WINAPI Registrar_ResourceUnregisterSz(IRegistrar *iface, LPCOLESTR resFileName, LPCOLESTR szID, LPCOLESTR szType)
static HRESULT resource_register(Registrar *This, LPCOLESTR resFileName, LPCOLESTR szID, LPCOLESTR szType, BOOL do_register)
static HRESULT WINAPI Registrar_FileRegister(IRegistrar *iface, LPCOLESTR fileName)
static HRESULT WINAPI Registrar_StringUnregister(IRegistrar *iface, LPCOLESTR data)
static void strbuf_write(LPCOLESTR str, strbuf *buf, int len)
static int xdigit_to_int(WCHAR c)
HRESULT WINAPI AtlUpdateRegistryFromResourceD(HINSTANCE inst, LPCOLESTR res, BOOL bRegister, struct _ATL_REGMAP_ENTRY *pMapEntries, IRegistrar *pReg)
static ULONG WINAPI Registrar_AddRef(IRegistrar *iface)
static const struct @316 root_keys[]
struct rep_list_str rep_list
static Registrar * impl_from_IRegistrar(IRegistrar *iface)
static HRESULT string_register(Registrar *This, LPCOLESTR data, BOOL do_register)
static HRESULT do_process_root_key(LPCOLESTR data, BOOL do_register)
static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOOL do_register)
static HRESULT WINAPI Registrar_ClearReplacements(IRegistrar *iface)
HRESULT WINAPI AtlCreateRegistrar(IRegistrar **ret)
static ULONG WINAPI Registrar_Release(IRegistrar *iface)
static HRESULT WINAPI Registrar_FileUnregister(IRegistrar *iface, LPCOLESTR fileName)
static HRESULT WINAPI Registrar_AddReplacement(IRegistrar *iface, LPCOLESTR Key, LPCOLESTR item)
static HRESULT WINAPI Registrar_ResourceRegister(IRegistrar *iface, LPCOLESTR resFileName, UINT nID, LPCOLESTR szType)
static void strbuf_init(strbuf *buf)
static HRESULT file_register(Registrar *This, LPCOLESTR fileName, BOOL do_register)
static HRESULT WINAPI Registrar_ResourceRegisterSz(IRegistrar *iface, LPCOLESTR resFileName, LPCOLESTR szID, LPCOLESTR szType)
static HRESULT WINAPI Registrar_ResourceUnregister(IRegistrar *iface, LPCOLESTR resFileName, UINT nID, LPCOLESTR szType)
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define MultiByteToWideChar
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
_ACRTIMP __msvcrt_ulong __cdecl wcstoul(const wchar_t *, wchar_t **, int)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
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
REFIID LPVOID DWORD_PTR dw
#define memcpy(s1, s2, n)
static DWORD LPDWORD reslen
#define IsEqualGUID(rguid1, rguid2)
struct rep_list_str * next
#define CONTAINING_RECORD(address, type, field)
DWORD WINAPI GetLastError(void)
#define LOAD_LIBRARY_AS_DATAFILE
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_CONFIG
#define HKEY_CURRENT_USER
#define HKEY_PERFORMANCE_DATA
#define HKEY_CLASSES_ROOT
#define MAKEINTRESOURCEW(i)