Author: winesync
Date: Thu Nov 29 13:48:50 2007
New Revision: 30870
URL:
http://svn.reactos.org/svn/reactos?rev=30870&view=rev
Log:
Autosyncing with Wine HEAD
Modified:
trunk/reactos/dll/win32/mlang/mlang.c
trunk/reactos/dll/win32/mlang/mlang.rbuild
trunk/reactos/dll/win32/mlang/regsvr.c
Modified: trunk/reactos/dll/win32/mlang/mlang.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mlang/mlang.c?re…
==============================================================================
--- trunk/reactos/dll/win32/mlang/mlang.c (original)
+++ trunk/reactos/dll/win32/mlang/mlang.c Thu Nov 29 13:48:50 2007
@@ -530,7 +530,7 @@
*pcDstSize = MultiByteToWideChar(dwEncoding, 0, pSrcStr, *pcSrcSize, NULL,
0);
break;
}
-
+
if (!*pcDstSize)
return E_FAIL;
@@ -634,10 +634,9 @@
pDstStrW = HeapAlloc(GetProcessHeap(), 0, cDstSizeW * sizeof(WCHAR));
hr = ConvertINetMultiByteToUnicode(pdwMode, dwSrcEncoding, pSrcStr, pcSrcSize,
pDstStrW, &cDstSizeW);
- if (hr != S_OK)
- return hr;
-
- hr = ConvertINetUnicodeToMultiByte(pdwMode, dwDstEncoding, pDstStrW,
&cDstSizeW, pDstStr, pcDstSize);
+ if (hr == S_OK)
+ hr = ConvertINetUnicodeToMultiByte(pdwMode, dwDstEncoding, pDstStrW,
&cDstSizeW, pDstStr, pcDstSize);
+
HeapFree(GetProcessHeap(), 0, pDstStrW);
return hr;
}
@@ -694,7 +693,7 @@
if (n)
{
rfc1766[n - 1] = '-';
- n += GetLocaleInfoA( lcid, LOCALE_SISO3166CTRYNAME, rfc1766 + n, len - n ) + 1;
+ n += GetLocaleInfoA( lcid, LOCALE_SISO3166CTRYNAME, rfc1766 + n, len - n );
LCMapStringA( LOCALE_USER_DEFAULT, LCMAP_LOWERCASE, rfc1766, n, rfc1766, len );
return n;
}
@@ -707,7 +706,7 @@
if (n)
{
rfc1766[n - 1] = '-';
- n += GetLocaleInfoW( lcid, LOCALE_SISO3166CTRYNAME, rfc1766 + n, len - n ) + 1;
+ n += GetLocaleInfoW( lcid, LOCALE_SISO3166CTRYNAME, rfc1766 + n, len - n );
LCMapStringW( LOCALE_USER_DEFAULT, LCMAP_LOWERCASE, rfc1766, n, rfc1766, len );
return n;
}
@@ -830,7 +829,7 @@
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
HRESULT hres;
LPUNKNOWN punk;
-
+
TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
*ppobj = NULL;
@@ -1217,6 +1216,7 @@
if (ref == 0)
{
TRACE("Destroying %p\n", This);
+ HeapFree(GetProcessHeap(), 0, This->script_info);
HeapFree(GetProcessHeap(), 0, This);
}
@@ -1384,7 +1384,7 @@
{
ICOM_THIS_MULTI(MLang_impl, vtbl_IMLangFontLink, iface);
CHARSETINFO cs;
- BOOL rc;
+ BOOL rc;
TRACE("(%p) Seeking %u\n",This, uCodePage);
memset(&cs, 0, sizeof(cs));
@@ -1412,7 +1412,7 @@
DWORD mask = 0x00000000;
UINT i;
CHARSETINFO cs;
- BOOL rc;
+ BOOL rc;
TRACE("(%p) scanning 0x%x default page %u\n",This, dwCodePages,
uDefaultCodePage);
@@ -1420,7 +1420,7 @@
*puCodePage = 0x00000000;
rc = TranslateCharsetInfo((DWORD*)uDefaultCodePage, &cs, TCI_SRCCODEPAGE);
-
+
if (rc && (dwCodePages & cs.fs.fsCsb[0]))
{
TRACE("Found Default Codepage\n");
@@ -1428,7 +1428,7 @@
return S_OK;
}
-
+
for (i = 0; i < 32; i++)
{
@@ -1862,7 +1862,7 @@
info->wszLocaleName[0] = 0;
GetLocaleInfoW(info->lcid, LOCALE_SLANGUAGE, info->wszLocaleName,
MAX_LOCALE_NAME);
TRACE("ISO639: %s SLANGUAGE: %s\n", wine_dbgstr_w(info->wszRfc1766),
wine_dbgstr_w(info->wszLocaleName));
-
+
data->total++;
return TRUE;
@@ -1885,7 +1885,11 @@
data.total = 0;
data.allocated = 32;
data.info = HeapAlloc(GetProcessHeap(), 0, data.allocated * sizeof(RFC1766INFO));
- if (!data.info) return S_FALSE;
+ if (!data.info)
+ {
+ HeapFree(GetProcessHeap(), 0, rfc);
+ return S_FALSE;
+ }
TlsSetValue(MLANG_tls_index, &data);
EnumSystemLocalesW(enum_locales_proc, 0/*LOCALE_SUPPORTED*/);
@@ -1893,7 +1897,12 @@
TRACE("enumerated %d rfc1766 structures\n", data.total);
- if (!data.total) return FALSE;
+ if (!data.total)
+ {
+ HeapFree(GetProcessHeap(), 0, data.info);
+ HeapFree(GetProcessHeap(), 0, rfc);
+ return FALSE;
+ }
rfc->info = data.info;
rfc->total = data.total;
@@ -2298,7 +2307,7 @@
*
* PARAMS
* see ConvertStringToUnicode
- * dwFlag
+ * dwFlag
* lpFallBack if dwFlag contains MLCONVCHARF_USEDEFCHAR, lpFallBack string used
* instead unconvertible characters.
*
Modified: trunk/reactos/dll/win32/mlang/mlang.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mlang/mlang.rbui…
==============================================================================
--- trunk/reactos/dll/win32/mlang/mlang.rbuild (original)
+++ trunk/reactos/dll/win32/mlang/mlang.rbuild Thu Nov 29 13:48:50 2007
@@ -1,14 +1,13 @@
+<?xml version="1.0"?>
+<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="mlang" type="win32dll"
baseaddress="${BASEADDRESS_MLANG}" installbase="system32"
installname="mlang.dll" allowwarnings="true">
<autoregister infsection="OleControlDlls"
type="DllRegisterServer" />
<importlibrary definition="mlang.spec.def" />
<include base="mlang">.</include>
<include base="ReactOS">include/reactos/wine</include>
- <define name="__REACTOS__" />
<define name="__WINESRC__" />
- <define name="__USE_W32API" />
- <define name="_WIN32_IE">0x600</define>
- <define name="_WIN32_WINNT">0x501</define>
- <define name="WINVER">0x501</define>
+ <define name="WINVER">0x600</define>
+ <define name="_WIN32_WINNT">0x600</define>
<library>wine</library>
<library>ole32</library>
<library>user32</library>
Modified: trunk/reactos/dll/win32/mlang/regsvr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mlang/regsvr.c?r…
==============================================================================
--- trunk/reactos/dll/win32/mlang/regsvr.c (original)
+++ trunk/reactos/dll/win32/mlang/regsvr.c Thu Nov 29 13:48:50 2007
@@ -121,9 +121,6 @@
static LONG register_progid(WCHAR const *clsid,
char const *progid, char const *curver_progid,
char const *name, char const *extra);
-static LONG recursive_delete_key(HKEY key);
-static LONG recursive_delete_keyA(HKEY base, char const *name);
-static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
@@ -212,7 +209,8 @@
WCHAR buf[39];
StringFromGUID2(list->iid, buf, 39);
- res = recursive_delete_keyW(interface_key, buf);
+ res = RegDeleteTreeW(interface_key, buf);
+ if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
}
RegCloseKey(interface_key);
@@ -319,16 +317,19 @@
WCHAR buf[39];
StringFromGUID2(list->clsid, buf, 39);
- res = recursive_delete_keyW(coclass_key, buf);
+ res = RegDeleteTreeW(coclass_key, buf);
+ if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
if (list->progid) {
- res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->progid);
+ res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid);
+ if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
}
if (list->viprogid) {
- res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->viprogid);
+ res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid);
+ if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
}
}
@@ -437,70 +438,6 @@
error_close_progid_key:
RegCloseKey(progid_key);
- return res;
-}
-
-/***********************************************************************
- * recursive_delete_key
- */
-static LONG recursive_delete_key(HKEY key)
-{
- LONG res;
- WCHAR subkey_name[MAX_PATH];
- DWORD cName;
- HKEY subkey;
-
- for (;;) {
- cName = sizeof(subkey_name) / sizeof(WCHAR);
- res = RegEnumKeyExW(key, 0, subkey_name, &cName,
- NULL, NULL, NULL, NULL);
- if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) {
- res = ERROR_SUCCESS; /* presumably we're done enumerating */
- break;
- }
- res = RegOpenKeyExW(key, subkey_name, 0,
- KEY_READ | KEY_WRITE, &subkey);
- if (res == ERROR_FILE_NOT_FOUND) continue;
- if (res != ERROR_SUCCESS) break;
-
- res = recursive_delete_key(subkey);
- RegCloseKey(subkey);
- if (res != ERROR_SUCCESS) break;
- }
-
- if (res == ERROR_SUCCESS) res = RegDeleteKeyW(key, 0);
- return res;
-}
-
-/***********************************************************************
- * recursive_delete_keyA
- */
-static LONG recursive_delete_keyA(HKEY base, char const *name)
-{
- LONG res;
- HKEY key;
-
- res = RegOpenKeyExA(base, name, 0, KEY_READ | KEY_WRITE, &key);
- if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
- if (res != ERROR_SUCCESS) return res;
- res = recursive_delete_key(key);
- RegCloseKey(key);
- return res;
-}
-
-/***********************************************************************
- * recursive_delete_keyW
- */
-static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
-{
- LONG res;
- HKEY key;
-
- res = RegOpenKeyExW(base, name, 0, KEY_READ | KEY_WRITE, &key);
- if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
- if (res != ERROR_SUCCESS) return res;
- res = recursive_delete_key(key);
- RegCloseKey(key);
return res;
}