mirror of
https://github.com/reactos/reactos.git
synced 2024-08-08 12:18:13 +00:00
sync with trunk (r47268)
svn path=/branches/reactos-yarotows/; revision=47271
This commit is contained in:
parent
7b31d4395d
commit
3078dd3c10
|
@ -74,6 +74,9 @@
|
||||||
<directory name="inflib">
|
<directory name="inflib">
|
||||||
<xi:include href="lib/inflib/inflib.rbuild" />
|
<xi:include href="lib/inflib/inflib.rbuild" />
|
||||||
</directory>
|
</directory>
|
||||||
|
<directory name="newinflib">
|
||||||
|
<xi:include href="lib/newinflib/inflib.rbuild" />
|
||||||
|
</directory>
|
||||||
<directory name="cmlib">
|
<directory name="cmlib">
|
||||||
<xi:include href="lib/cmlib/cmlib.rbuild" />
|
<xi:include href="lib/cmlib/cmlib.rbuild" />
|
||||||
</directory>
|
</directory>
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[Section]
|
[Section]
|
||||||
Name = DOSBox
|
Name = DOSBox
|
||||||
Version = 0.73
|
Version = 0.74
|
||||||
Licence = GPL
|
Licence = GPL
|
||||||
Description = DOSBox is a DOS emulator.
|
Description = DOSBox is a DOS emulator.
|
||||||
Size = 1.4MB
|
Size = 1.4MB
|
||||||
Category = 15
|
Category = 15
|
||||||
URLSite = http://www.dosbox.com/
|
URLSite = http://www.dosbox.com/
|
||||||
URLDownload = http://ovh.dl.sourceforge.net/sourceforge/dosbox/DOSBox0.73-win32-installer.exe
|
URLDownload = http://ovh.dl.sourceforge.net/sourceforge/dosbox/DOSBox0.74-win32-installer.exe
|
||||||
CDPath = none
|
CDPath = none
|
||||||
|
|
||||||
[Section.0407]
|
[Section.0407]
|
||||||
|
|
|
@ -8,35 +8,35 @@ Description = The most popular and one of the best free Web Browsers out there.
|
||||||
Size = 5.8M
|
Size = 5.8M
|
||||||
Category = 5
|
Category = 5
|
||||||
URLSite = http://www.mozilla.com/en-US/
|
URLSite = http://www.mozilla.com/en-US/
|
||||||
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/en-US/Firefox%20Setup%202.0.0.20.exe
|
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/en-US/Firefox%20Setup%202.0.0.20.exe
|
||||||
CDPath = none
|
CDPath = none
|
||||||
|
|
||||||
[Section.0407]
|
[Section.0407]
|
||||||
Description = Der populärste und einer der besten freien Webbrowser.
|
Description = Der populärste und einer der besten freien Webbrowser.
|
||||||
Size = 5.5M
|
Size = 5.5M
|
||||||
URLSite = http://www.mozilla-europe.org/de/
|
URLSite = http://www.mozilla-europe.org/de/
|
||||||
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/de/Firefox%20Setup%202.0.0.20.exe
|
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/de/Firefox%20Setup%202.0.0.20.exe
|
||||||
|
|
||||||
[Section.040a]
|
[Section.040a]
|
||||||
Description = El más popular y uno de los mejores navegadores web gratuitos que hay.
|
Description = El más popular y uno de los mejores navegadores web gratuitos que hay.
|
||||||
Size = 5.6M
|
Size = 5.6M
|
||||||
URLSite = http://www.mozilla-europe.org/es/
|
URLSite = http://www.mozilla-europe.org/es/
|
||||||
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/es-ES/Firefox%20Setup%202.0.0.20.exe
|
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/es-ES/Firefox%20Setup%202.0.0.20.exe
|
||||||
|
|
||||||
[Section.0414]
|
[Section.0414]
|
||||||
Description = Mest populære og best også gratis nettleserene der ute.
|
Description = Mest populære og best også gratis nettleserene der ute.
|
||||||
Size = 5.6M
|
Size = 5.6M
|
||||||
URLSite = http://www.mozilla-europe.org/no/
|
URLSite = http://www.mozilla-europe.org/no/
|
||||||
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/nb-NO/Firefox%20Setup%202.0.0.20.exe
|
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/nb-NO/Firefox%20Setup%202.0.0.20.exe
|
||||||
|
|
||||||
[Section.0415]
|
[Section.0415]
|
||||||
Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych.
|
Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych.
|
||||||
Size = 6.3M
|
Size = 6.3M
|
||||||
URLSite = http://www.mozilla-europe.org/pl/
|
URLSite = http://www.mozilla-europe.org/pl/
|
||||||
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/pl/Firefox%20Setup%202.0.0.20.exe
|
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/pl/Firefox%20Setup%202.0.0.20.exe
|
||||||
|
|
||||||
[Section.0419]
|
[Section.0419]
|
||||||
Description = Один из самых популярных и лучших бесплатных браузеров.
|
Description = Один из самых популярных и лучших бесплатных браузеров.
|
||||||
Size = 6.4M
|
Size = 6.4M
|
||||||
URLSite = http://www.mozilla-europe.org/ru/
|
URLSite = http://www.mozilla-europe.org/ru/
|
||||||
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/ru/Firefox%20Setup%202.0.0.20.exe
|
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/ru/Firefox%20Setup%202.0.0.20.exe
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[Section]
|
[Section]
|
||||||
Name = IrfanView
|
Name = IrfanView
|
||||||
Version = 4.25
|
Version = 4.27
|
||||||
Licence = Freeware (for personal use)
|
Licence = Freeware (for personal use)
|
||||||
Description = Viewer for all kinds of graphics/audio files/video files.
|
Description = Viewer for all kinds of graphics/audio files/video files.
|
||||||
Size = 1.3MB
|
Size = 1.3MB
|
||||||
Category = 3
|
Category = 3
|
||||||
URLSite = http://www.irfanview.com/
|
URLSite = http://www.irfanview.com/
|
||||||
URLDownload = http://irfanview.tuwien.ac.at/iview425_setup.exe
|
URLDownload = http://irfanview.tuwien.ac.at/iview427_setup.exe
|
||||||
CDPath = none
|
CDPath = none
|
||||||
|
|
||||||
[Section.0407]
|
[Section.0407]
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[Section]
|
[Section]
|
||||||
Name = IrfanView Plugins
|
Name = IrfanView Plugins
|
||||||
Version = 4.25
|
Version = 4.27
|
||||||
Licence = Freeware (for personal use)
|
Licence = Freeware (for personal use)
|
||||||
Description = Additional Plugins for supporting more file types.
|
Description = Additional Plugins for supporting more file types.
|
||||||
Size = 7.7MB
|
Size = 7.8MB
|
||||||
Category = 3
|
Category = 3
|
||||||
URLSite = http://www.irfanview.com/
|
URLSite = http://www.irfanview.com/
|
||||||
URLDownload = http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_425_setup.exe
|
URLDownload = http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_427_setup.exe
|
||||||
CDPath = none
|
CDPath = none
|
||||||
|
|
||||||
[Section.0407]
|
[Section.0407]
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[Section]
|
[Section]
|
||||||
Name = ReactOS Build Environment
|
Name = ReactOS Build Environment
|
||||||
Version = 1.5
|
Version = 1.5.1
|
||||||
Licence = GPL
|
Licence = GPL
|
||||||
Description = Allows you to build the ReactOS Source. For more instructions see ReactOS wiki.
|
Description = Allows you to build the ReactOS Source. For more instructions see ReactOS wiki.
|
||||||
Size = 13.5MB
|
Size = 13.5MB
|
||||||
Category = 7
|
Category = 7
|
||||||
URLSite = http://reactos.org/wiki/Build_Environment/
|
URLSite = http://reactos.org/wiki/Build_Environment/
|
||||||
URLDownload = http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-1.5.exe
|
URLDownload = http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-1.5.1.exe
|
||||||
CDPath = none
|
CDPath = none
|
||||||
|
|
||||||
[Section.0407]
|
[Section.0407]
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[Section]
|
[Section]
|
||||||
Name = µTorrent
|
Name = µTorrent
|
||||||
Version = 2.0.1
|
Version = 2.0.2
|
||||||
Licence = Freeware for non-commercial uses
|
Licence = Freeware for non-commercial uses
|
||||||
Description = Small and fast BitTorrent Client.
|
Description = Small and fast BitTorrent Client.
|
||||||
Size = 314K
|
Size = 315K
|
||||||
Category = 5
|
Category = 5
|
||||||
URLSite = http://www.utorrent.com/
|
URLSite = http://www.utorrent.com/
|
||||||
URLDownload = http://download.utorrent.com/2.0.1/utorrent.exe
|
URLDownload = http://download.utorrent.com/2.0.2/utorrent.exe
|
||||||
CDPath = none
|
CDPath = none
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,13 +25,531 @@ static const TCHAR s_szFindFlagsR[] = _T("FindFlagsReactOS");
|
||||||
static HWND s_hwndAbortDialog;
|
static HWND s_hwndAbortDialog;
|
||||||
static BOOL s_bAbort;
|
static BOOL s_bAbort;
|
||||||
|
|
||||||
|
static DWORD s_dwFlags;
|
||||||
|
static TCHAR s_szName[MAX_PATH];
|
||||||
|
static DWORD s_cbName;
|
||||||
|
static const TCHAR s_empty[] = {0};
|
||||||
|
static const TCHAR s_backslash[] = {'\\', 0};
|
||||||
|
|
||||||
|
extern VOID SetValueName(HWND hwndLV, LPCTSTR pszValueName);
|
||||||
|
|
||||||
|
BOOL DoEvents(VOID)
|
||||||
|
{
|
||||||
|
MSG msg;
|
||||||
|
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||||
|
{
|
||||||
|
if (msg.message == WM_QUIT)
|
||||||
|
s_bAbort = TRUE;
|
||||||
|
if (!IsDialogMessage(s_hwndAbortDialog, &msg))
|
||||||
|
{
|
||||||
|
TranslateMessage(&msg);
|
||||||
|
DispatchMessage(&msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s_bAbort;
|
||||||
|
}
|
||||||
|
|
||||||
|
static LPTSTR lstrstri(LPCTSTR psz1, LPCTSTR psz2)
|
||||||
|
{
|
||||||
|
INT i, cch1, cch2;
|
||||||
|
|
||||||
|
cch1 = lstrlen(psz1);
|
||||||
|
cch2 = lstrlen(psz2);
|
||||||
|
for(i = 0; i <= cch1 - cch2; i++)
|
||||||
|
{
|
||||||
|
if (CompareString(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE,
|
||||||
|
psz1 + i, cch2, psz2, cch2) == 2)
|
||||||
|
return (LPTSTR) (psz1 + i);
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL CompareName(LPCTSTR pszName1, LPCTSTR pszName2)
|
||||||
|
{
|
||||||
|
if (s_dwFlags & RSF_WHOLESTRING)
|
||||||
|
{
|
||||||
|
if (s_dwFlags & RSF_MATCHCASE)
|
||||||
|
return lstrcmp(pszName1, pszName2) == 0;
|
||||||
|
else
|
||||||
|
return lstrcmpi(pszName1, pszName2) == 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (s_dwFlags & RSF_MATCHCASE)
|
||||||
|
return _tcsstr(pszName1, pszName2) != NULL;
|
||||||
|
else
|
||||||
|
return lstrstri(pszName1, pszName2) != NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL
|
||||||
|
CompareData(
|
||||||
|
DWORD dwType,
|
||||||
|
LPCTSTR psz1,
|
||||||
|
LPCTSTR psz2)
|
||||||
|
{
|
||||||
|
INT i, cch1 = lstrlen(psz1), cch2 = lstrlen(psz2);
|
||||||
|
if (dwType == REG_SZ || dwType == REG_EXPAND_SZ)
|
||||||
|
{
|
||||||
|
if (s_dwFlags & RSF_WHOLESTRING)
|
||||||
|
{
|
||||||
|
if (s_dwFlags & RSF_MATCHCASE)
|
||||||
|
return 2 == CompareString(LOCALE_SYSTEM_DEFAULT, 0,
|
||||||
|
psz1, cch1, psz2, cch2);
|
||||||
|
else
|
||||||
|
return 2 == CompareString(LOCALE_SYSTEM_DEFAULT,
|
||||||
|
NORM_IGNORECASE, psz1, cch1, psz2, cch2);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i = 0; i <= cch1 - cch2; i++)
|
||||||
|
{
|
||||||
|
if (s_dwFlags & RSF_MATCHCASE)
|
||||||
|
{
|
||||||
|
if (2 == CompareString(LOCALE_SYSTEM_DEFAULT, 0,
|
||||||
|
psz1 + i, cch2, psz2, cch2))
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (2 == CompareString(LOCALE_SYSTEM_DEFAULT,
|
||||||
|
NORM_IGNORECASE, psz1 + i, cch2, psz2, cch2))
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int compare(const void *x, const void *y)
|
||||||
|
{
|
||||||
|
const LPCTSTR *a = (const LPCTSTR *)x;
|
||||||
|
const LPCTSTR *b = (const LPCTSTR *)y;
|
||||||
|
return lstrcmpi(*a, *b);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL RegFindRecurse(
|
||||||
|
HKEY hKey,
|
||||||
|
LPCTSTR pszSubKey,
|
||||||
|
LPCTSTR pszValueName,
|
||||||
|
LPTSTR *ppszFoundSubKey,
|
||||||
|
LPTSTR *ppszFoundValueName)
|
||||||
|
{
|
||||||
|
HKEY hSubKey;
|
||||||
|
LONG lResult;
|
||||||
|
TCHAR szSubKey[MAX_PATH];
|
||||||
|
DWORD i, c, cb, type;
|
||||||
|
BOOL fPast = FALSE;
|
||||||
|
LPTSTR *ppszNames = NULL;
|
||||||
|
LPBYTE pb = NULL;
|
||||||
|
|
||||||
|
if (DoEvents())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
lstrcpy(szSubKey, pszSubKey);
|
||||||
|
hSubKey = NULL;
|
||||||
|
|
||||||
|
lResult = RegOpenKeyEx(hKey, szSubKey, 0, KEY_ALL_ACCESS, &hSubKey);
|
||||||
|
if (lResult != ERROR_SUCCESS)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (pszValueName == NULL)
|
||||||
|
pszValueName = s_empty;
|
||||||
|
|
||||||
|
lResult = RegQueryInfoKey(hSubKey, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
|
&c, NULL, NULL, NULL, NULL);
|
||||||
|
if (lResult != ERROR_SUCCESS)
|
||||||
|
goto err;
|
||||||
|
ppszNames = (LPTSTR *) malloc(c * sizeof(LPTSTR));
|
||||||
|
if (ppszNames == NULL)
|
||||||
|
goto err;
|
||||||
|
ZeroMemory(ppszNames, c * sizeof(LPTSTR));
|
||||||
|
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
{
|
||||||
|
if (DoEvents())
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
s_cbName = MAX_PATH * sizeof(TCHAR);
|
||||||
|
lResult = RegEnumValue(hSubKey, i, s_szName, &s_cbName, NULL, NULL,
|
||||||
|
NULL, &cb);
|
||||||
|
if (lResult == ERROR_NO_MORE_ITEMS)
|
||||||
|
{
|
||||||
|
c = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (lResult != ERROR_SUCCESS)
|
||||||
|
goto err;
|
||||||
|
if (s_cbName >= MAX_PATH * sizeof(TCHAR))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
ppszNames[i] = _tcsdup(s_szName);
|
||||||
|
}
|
||||||
|
|
||||||
|
qsort(ppszNames, c, sizeof(LPTSTR), compare);
|
||||||
|
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
{
|
||||||
|
if (DoEvents())
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
if (!fPast && lstrcmpi(ppszNames[i], pszValueName) == 0)
|
||||||
|
{
|
||||||
|
fPast = TRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!fPast)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((s_dwFlags & RSF_LOOKATVALUES) &&
|
||||||
|
CompareName(ppszNames[i], s_szFindWhat))
|
||||||
|
{
|
||||||
|
*ppszFoundSubKey = _tcsdup(szSubKey);
|
||||||
|
if (ppszNames[i][0] == 0)
|
||||||
|
*ppszFoundValueName = NULL;
|
||||||
|
else
|
||||||
|
*ppszFoundValueName = _tcsdup(ppszNames[i]);
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
|
||||||
|
lResult = RegQueryValueEx(hSubKey, ppszNames[i], NULL, &type,
|
||||||
|
NULL, &cb);
|
||||||
|
if (lResult != ERROR_SUCCESS)
|
||||||
|
goto err;
|
||||||
|
pb = malloc(cb);
|
||||||
|
if (pb == NULL)
|
||||||
|
goto err;
|
||||||
|
lResult = RegQueryValueEx(hSubKey, ppszNames[i], NULL, &type,
|
||||||
|
pb, &cb);
|
||||||
|
if (lResult != ERROR_SUCCESS)
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
if ((s_dwFlags & RSF_LOOKATDATA) &&
|
||||||
|
CompareData(type, (LPTSTR) pb, s_szFindWhat))
|
||||||
|
{
|
||||||
|
*ppszFoundSubKey = _tcsdup(szSubKey);
|
||||||
|
if (ppszNames[i][0] == 0)
|
||||||
|
*ppszFoundValueName = NULL;
|
||||||
|
else
|
||||||
|
*ppszFoundValueName = _tcsdup(ppszNames[i]);
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
free(pb);
|
||||||
|
pb = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ppszNames != NULL)
|
||||||
|
{
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
free(ppszNames[i]);
|
||||||
|
free(ppszNames);
|
||||||
|
}
|
||||||
|
ppszNames = NULL;
|
||||||
|
|
||||||
|
lResult = RegQueryInfoKey(hSubKey, NULL, NULL, NULL, &c, NULL, NULL,
|
||||||
|
NULL, NULL, NULL, NULL, NULL);
|
||||||
|
if (lResult != ERROR_SUCCESS)
|
||||||
|
goto err;
|
||||||
|
ppszNames = (LPTSTR *) malloc(c * sizeof(LPTSTR));
|
||||||
|
if (ppszNames == NULL)
|
||||||
|
goto err;
|
||||||
|
ZeroMemory(ppszNames, c * sizeof(LPTSTR));
|
||||||
|
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
{
|
||||||
|
if (DoEvents())
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
s_cbName = MAX_PATH * sizeof(TCHAR);
|
||||||
|
lResult = RegEnumKeyEx(hSubKey, i, s_szName, &s_cbName, NULL, NULL,
|
||||||
|
NULL, NULL);
|
||||||
|
if (lResult == ERROR_NO_MORE_ITEMS)
|
||||||
|
{
|
||||||
|
c = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (lResult != ERROR_SUCCESS)
|
||||||
|
goto err;
|
||||||
|
if (s_cbName >= MAX_PATH * sizeof(TCHAR))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
ppszNames[i] = _tcsdup(s_szName);
|
||||||
|
}
|
||||||
|
|
||||||
|
qsort(ppszNames, c, sizeof(LPTSTR), compare);
|
||||||
|
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
{
|
||||||
|
if (DoEvents())
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
if ((s_dwFlags & RSF_LOOKATKEYS) &&
|
||||||
|
CompareName(ppszNames[i], s_szFindWhat))
|
||||||
|
{
|
||||||
|
*ppszFoundSubKey = malloc(
|
||||||
|
(lstrlen(szSubKey) + lstrlen(ppszNames[i]) + 2) *
|
||||||
|
sizeof(TCHAR));
|
||||||
|
if (*ppszFoundSubKey == NULL)
|
||||||
|
goto err;
|
||||||
|
if (szSubKey[0])
|
||||||
|
{
|
||||||
|
lstrcpy(*ppszFoundSubKey, szSubKey);
|
||||||
|
lstrcatW(*ppszFoundSubKey, s_backslash);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
**ppszFoundSubKey = 0;
|
||||||
|
lstrcatW(*ppszFoundSubKey, ppszNames[i]);
|
||||||
|
*ppszFoundValueName = NULL;
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RegFindRecurse(hSubKey, ppszNames[i], NULL, ppszFoundSubKey,
|
||||||
|
ppszFoundValueName))
|
||||||
|
{
|
||||||
|
LPTSTR psz = *ppszFoundSubKey;
|
||||||
|
*ppszFoundSubKey = malloc(
|
||||||
|
(lstrlen(szSubKey) + lstrlen(psz) + 2) * sizeof(TCHAR));
|
||||||
|
if (*ppszFoundSubKey == NULL)
|
||||||
|
goto err;
|
||||||
|
if (szSubKey[0])
|
||||||
|
{
|
||||||
|
lstrcpy(*ppszFoundSubKey, szSubKey);
|
||||||
|
lstrcatW(*ppszFoundSubKey, s_backslash);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
**ppszFoundSubKey = 0;
|
||||||
|
lstrcatW(*ppszFoundSubKey, psz);
|
||||||
|
free(psz);
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
err:
|
||||||
|
if (ppszNames != NULL)
|
||||||
|
{
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
free(ppszNames[i]);
|
||||||
|
free(ppszNames);
|
||||||
|
}
|
||||||
|
free(pb);
|
||||||
|
RegCloseKey(hSubKey);
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
success:
|
||||||
|
if (ppszNames != NULL)
|
||||||
|
{
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
free(ppszNames[i]);
|
||||||
|
free(ppszNames);
|
||||||
|
}
|
||||||
|
RegCloseKey(hSubKey);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL RegFindWalk(
|
||||||
|
HKEY * phKey,
|
||||||
|
LPCTSTR pszSubKey,
|
||||||
|
LPCTSTR pszValueName,
|
||||||
|
LPTSTR *ppszFoundSubKey,
|
||||||
|
LPTSTR *ppszFoundValueName)
|
||||||
|
{
|
||||||
|
LONG lResult;
|
||||||
|
DWORD i, c;
|
||||||
|
HKEY hBaseKey, hSubKey;
|
||||||
|
TCHAR szKeyName[MAX_PATH];
|
||||||
|
TCHAR szSubKey[MAX_PATH];
|
||||||
|
LPTSTR pch;
|
||||||
|
BOOL fPast;
|
||||||
|
LPTSTR *ppszNames = NULL;
|
||||||
|
|
||||||
|
hBaseKey = *phKey;
|
||||||
|
if (RegFindRecurse(hBaseKey, pszSubKey, pszValueName, ppszFoundSubKey,
|
||||||
|
ppszFoundValueName))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (lstrlen(pszSubKey) >= MAX_PATH)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
lstrcpy(szSubKey, pszSubKey);
|
||||||
|
while(szSubKey[0] != 0)
|
||||||
|
{
|
||||||
|
if (DoEvents())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
pch = _tcsrchr(szSubKey, _T('\\'));
|
||||||
|
if (pch == NULL)
|
||||||
|
{
|
||||||
|
lstrcpy(szKeyName, szSubKey);
|
||||||
|
szSubKey[0] = 0;
|
||||||
|
hSubKey = hBaseKey;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lstrcpyn(szKeyName, pch + 1, MAX_PATH);
|
||||||
|
*pch = 0;
|
||||||
|
lResult = RegOpenKeyEx(hBaseKey, szSubKey, 0, KEY_ALL_ACCESS,
|
||||||
|
&hSubKey);
|
||||||
|
if (lResult != ERROR_SUCCESS)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
lResult = RegQueryInfoKey(hSubKey, NULL, NULL, NULL, &c, NULL, NULL,
|
||||||
|
NULL, NULL, NULL, NULL, NULL);
|
||||||
|
if (lResult != ERROR_SUCCESS)
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
ppszNames = (LPTSTR *) malloc(c * sizeof(LPTSTR));
|
||||||
|
if (ppszNames == NULL)
|
||||||
|
goto err;
|
||||||
|
ZeroMemory(ppszNames, c * sizeof(LPTSTR));
|
||||||
|
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
{
|
||||||
|
if (DoEvents())
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
s_cbName = MAX_PATH * sizeof(TCHAR);
|
||||||
|
lResult = RegEnumKeyExW(hSubKey, i, s_szName, &s_cbName,
|
||||||
|
NULL, NULL, NULL, NULL);
|
||||||
|
if (lResult == ERROR_NO_MORE_ITEMS)
|
||||||
|
{
|
||||||
|
c = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (lResult != ERROR_SUCCESS)
|
||||||
|
break;
|
||||||
|
ppszNames[i] = _tcsdup(s_szName);
|
||||||
|
}
|
||||||
|
|
||||||
|
qsort(ppszNames, c, sizeof(LPTSTR), compare);
|
||||||
|
|
||||||
|
fPast = FALSE;
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
{
|
||||||
|
if (DoEvents())
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
if (!fPast && lstrcmpi(ppszNames[i], szKeyName) == 0)
|
||||||
|
{
|
||||||
|
fPast = TRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!fPast)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((s_dwFlags & RSF_LOOKATKEYS) &&
|
||||||
|
CompareName(ppszNames[i], s_szFindWhat))
|
||||||
|
{
|
||||||
|
*ppszFoundSubKey = malloc(
|
||||||
|
(lstrlen(szSubKey) + lstrlen(ppszNames[i]) + 2) *
|
||||||
|
sizeof(TCHAR));
|
||||||
|
if (*ppszFoundSubKey == NULL)
|
||||||
|
goto err;
|
||||||
|
if (szSubKey[0])
|
||||||
|
{
|
||||||
|
lstrcpy(*ppszFoundSubKey, szSubKey);
|
||||||
|
lstrcatW(*ppszFoundSubKey, s_backslash);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
**ppszFoundSubKey = 0;
|
||||||
|
lstrcatW(*ppszFoundSubKey, ppszNames[i]);
|
||||||
|
*ppszFoundValueName = NULL;
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RegFindRecurse(hSubKey, ppszNames[i], NULL,
|
||||||
|
ppszFoundSubKey, ppszFoundValueName))
|
||||||
|
{
|
||||||
|
LPTSTR psz = *ppszFoundSubKey;
|
||||||
|
*ppszFoundSubKey = malloc(
|
||||||
|
(lstrlen(szSubKey) + lstrlen(psz) + 2) *
|
||||||
|
sizeof(TCHAR));
|
||||||
|
if (*ppszFoundSubKey == NULL)
|
||||||
|
goto err;
|
||||||
|
if (szSubKey[0])
|
||||||
|
{
|
||||||
|
lstrcpy(*ppszFoundSubKey, szSubKey);
|
||||||
|
lstrcatW(*ppszFoundSubKey, s_backslash);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
**ppszFoundSubKey = 0;
|
||||||
|
lstrcatW(*ppszFoundSubKey, psz);
|
||||||
|
free(psz);
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ppszNames != NULL)
|
||||||
|
{
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
free(ppszNames[i]);
|
||||||
|
free(ppszNames);
|
||||||
|
}
|
||||||
|
ppszNames = NULL;
|
||||||
|
|
||||||
|
if (hBaseKey != hSubKey)
|
||||||
|
RegCloseKey(hSubKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*phKey == HKEY_CLASSES_ROOT)
|
||||||
|
{
|
||||||
|
*phKey = HKEY_CURRENT_USER;
|
||||||
|
if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
|
||||||
|
ppszFoundValueName))
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*phKey == HKEY_CURRENT_USER)
|
||||||
|
{
|
||||||
|
*phKey = HKEY_LOCAL_MACHINE;
|
||||||
|
if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
|
||||||
|
ppszFoundValueName))
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*phKey == HKEY_LOCAL_MACHINE)
|
||||||
|
{
|
||||||
|
*phKey = HKEY_USERS;
|
||||||
|
if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
|
||||||
|
ppszFoundValueName))
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*phKey == HKEY_USERS)
|
||||||
|
{
|
||||||
|
*phKey = HKEY_CURRENT_CONFIG;
|
||||||
|
if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
|
||||||
|
ppszFoundValueName))
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
|
||||||
|
err:
|
||||||
|
if (ppszNames != NULL)
|
||||||
|
{
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
free(ppszNames[i]);
|
||||||
|
free(ppszNames);
|
||||||
|
}
|
||||||
|
if (hBaseKey != hSubKey)
|
||||||
|
RegCloseKey(hSubKey);
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
success:
|
||||||
|
if (ppszNames != NULL)
|
||||||
|
{
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
free(ppszNames[i]);
|
||||||
|
free(ppszNames);
|
||||||
|
}
|
||||||
|
if (hBaseKey != hSubKey)
|
||||||
|
RegCloseKey(hSubKey);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static DWORD GetFindFlags(void)
|
static DWORD GetFindFlags(void)
|
||||||
{
|
{
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
DWORD dwFlags = RSF_LOOKATKEYS;
|
|
||||||
DWORD dwType, dwValue, cbData;
|
DWORD dwType, dwValue, cbData;
|
||||||
|
DWORD dwFlags = RSF_LOOKATKEYS | RSF_LOOKATVALUES | RSF_LOOKATDATA;
|
||||||
|
|
||||||
if (RegOpenKey(HKEY_CURRENT_USER, g_szGeneralRegKey, &hKey) == ERROR_SUCCESS)
|
if (RegOpenKey(HKEY_CURRENT_USER, g_szGeneralRegKey, &hKey) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
@ -102,45 +620,54 @@ static INT_PTR CALLBACK AbortFindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL RegSearchProc(LPVOID lpParam)
|
|
||||||
{
|
|
||||||
MSG msg;
|
|
||||||
UNREFERENCED_PARAMETER(lpParam);
|
|
||||||
|
|
||||||
if (s_hwndAbortDialog && PeekMessage(&msg, s_hwndAbortDialog, 0, 0, PM_REMOVE))
|
|
||||||
{
|
|
||||||
TranslateMessage(&msg);
|
|
||||||
DispatchMessage(&msg);
|
|
||||||
}
|
|
||||||
return s_bAbort;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL FindNext(HWND hWnd)
|
BOOL FindNext(HWND hWnd)
|
||||||
{
|
{
|
||||||
HKEY hKeyRoot;
|
HKEY hKeyRoot;
|
||||||
LPCTSTR pszFindWhat;
|
|
||||||
LPCTSTR pszKeyPath;
|
LPCTSTR pszKeyPath;
|
||||||
DWORD dwFlags;
|
BOOL fSuccess;
|
||||||
LONG lResult;
|
|
||||||
TCHAR szSubKey[512];
|
|
||||||
TCHAR szError[512];
|
|
||||||
TCHAR szTitle[64];
|
|
||||||
TCHAR szFullKey[512];
|
TCHAR szFullKey[512];
|
||||||
|
LPCTSTR pszValueName;
|
||||||
|
LPTSTR pszFoundSubKey, pszFoundValueName;
|
||||||
|
|
||||||
pszFindWhat = s_szFindWhat;
|
if (_tcslen(s_szFindWhat) == 0)
|
||||||
dwFlags = GetFindFlags() & ~(RSF_LOOKATVALUES | RSF_LOOKATDATA);
|
{
|
||||||
|
FindDialog(hWnd);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
s_dwFlags = GetFindFlags();
|
||||||
|
|
||||||
pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
|
pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
|
||||||
lstrcpyn(szSubKey, pszKeyPath, sizeof(szSubKey) / sizeof(szSubKey[0]));
|
if (pszKeyPath == NULL)
|
||||||
|
{
|
||||||
|
hKeyRoot = HKEY_CLASSES_ROOT;
|
||||||
|
pszKeyPath = s_empty;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create abort find dialog */
|
/* Create abort find dialog */
|
||||||
s_hwndAbortDialog = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FINDING), hWnd, AbortFindDialogProc);
|
s_hwndAbortDialog = CreateDialog(GetModuleHandle(NULL),
|
||||||
|
MAKEINTRESOURCE(IDD_FINDING), hWnd, AbortFindDialogProc);
|
||||||
if (s_hwndAbortDialog)
|
if (s_hwndAbortDialog)
|
||||||
|
{
|
||||||
ShowWindow(s_hwndAbortDialog, SW_SHOW);
|
ShowWindow(s_hwndAbortDialog, SW_SHOW);
|
||||||
|
UpdateWindow(s_hwndAbortDialog);
|
||||||
|
}
|
||||||
s_bAbort = FALSE;
|
s_bAbort = FALSE;
|
||||||
|
|
||||||
lResult = RegSearch(hKeyRoot, szSubKey, sizeof(szSubKey) / sizeof(szSubKey[0]),
|
pszValueName = GetValueName(g_pChildWnd->hListWnd, -1);
|
||||||
pszFindWhat, 0, dwFlags, RegSearchProc, NULL);
|
|
||||||
|
EnableWindow(hFrameWnd, FALSE);
|
||||||
|
EnableWindow(g_pChildWnd->hTreeWnd, FALSE);
|
||||||
|
EnableWindow(g_pChildWnd->hListWnd, FALSE);
|
||||||
|
EnableWindow(g_pChildWnd->hAddressBarWnd, FALSE);
|
||||||
|
|
||||||
|
fSuccess = RegFindWalk(&hKeyRoot, pszKeyPath, pszValueName,
|
||||||
|
&pszFoundSubKey, &pszFoundValueName);
|
||||||
|
|
||||||
|
EnableWindow(hFrameWnd, TRUE);
|
||||||
|
EnableWindow(g_pChildWnd->hTreeWnd, TRUE);
|
||||||
|
EnableWindow(g_pChildWnd->hListWnd, TRUE);
|
||||||
|
EnableWindow(g_pChildWnd->hAddressBarWnd, TRUE);
|
||||||
|
|
||||||
if (s_hwndAbortDialog)
|
if (s_hwndAbortDialog)
|
||||||
{
|
{
|
||||||
|
@ -148,26 +675,16 @@ BOOL FindNext(HWND hWnd)
|
||||||
s_hwndAbortDialog = NULL;
|
s_hwndAbortDialog = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Did the user click "Cancel"? If so, exit without displaying an error message */
|
if (fSuccess)
|
||||||
if (lResult == ERROR_OPERATION_ABORTED)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (lResult != ERROR_SUCCESS)
|
|
||||||
{
|
{
|
||||||
LoadString(NULL, IDS_APP_TITLE, szTitle, sizeof(szTitle) / sizeof(szTitle[0]));
|
RegKeyGetName(szFullKey, COUNT_OF(szFullKey), hKeyRoot, pszFoundSubKey);
|
||||||
|
SelectNode(g_pChildWnd->hTreeWnd, szFullKey);
|
||||||
if ((lResult != ERROR_NO_MORE_ITEMS) || !LoadString(NULL, IDS_FINISHEDFIND, szError, sizeof(szError) / sizeof(szError[0])))
|
SetValueName(g_pChildWnd->hListWnd, pszFoundValueName);
|
||||||
{
|
free(pszFoundSubKey);
|
||||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, lResult, 0,
|
free(pszFoundValueName);
|
||||||
szError, sizeof(szError) / sizeof(szError[0]), NULL);
|
SetFocus(g_pChildWnd->hListWnd);
|
||||||
}
|
|
||||||
MessageBox(hWnd, szError, szTitle, MB_OK);
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
return fSuccess;
|
||||||
RegKeyGetName(szFullKey, sizeof(szFullKey) / sizeof(szFullKey[0]), hKeyRoot, szSubKey);
|
|
||||||
SelectNode(g_pChildWnd->hTreeWnd, szFullKey);
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
@ -183,26 +700,17 @@ static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
dwFlags = GetFindFlags();
|
dwFlags = GetFindFlags();
|
||||||
|
|
||||||
/* Looking at values is not yet implemented */
|
|
||||||
hControl = GetDlgItem(hDlg, IDC_LOOKAT_KEYS);
|
hControl = GetDlgItem(hDlg, IDC_LOOKAT_KEYS);
|
||||||
if (hControl)
|
if (hControl)
|
||||||
SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATKEYS) ? TRUE : FALSE, 0);
|
SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATKEYS) ? TRUE : FALSE, 0);
|
||||||
|
|
||||||
/* Looking at values is not yet implemented */
|
|
||||||
hControl = GetDlgItem(hDlg, IDC_LOOKAT_VALUES);
|
hControl = GetDlgItem(hDlg, IDC_LOOKAT_VALUES);
|
||||||
if (hControl)
|
if (hControl)
|
||||||
{
|
SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATVALUES) ? TRUE : FALSE, 0);
|
||||||
lStyle = GetWindowLongPtr(hControl, GWL_STYLE);
|
|
||||||
SetWindowLongPtr(hControl, GWL_STYLE, lStyle | WS_DISABLED);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Looking at data is not yet implemented */
|
|
||||||
hControl = GetDlgItem(hDlg, IDC_LOOKAT_DATA);
|
hControl = GetDlgItem(hDlg, IDC_LOOKAT_DATA);
|
||||||
if (hControl)
|
if (hControl)
|
||||||
{
|
SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATDATA) ? TRUE : FALSE, 0);
|
||||||
lStyle = GetWindowLongPtr(hControl, GWL_STYLE);
|
|
||||||
SetWindowLongPtr(hControl, GWL_STYLE, lStyle | WS_DISABLED);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Match whole string */
|
/* Match whole string */
|
||||||
hControl = GetDlgItem(hDlg, IDC_MATCHSTRING);
|
hControl = GetDlgItem(hDlg, IDC_MATCHSTRING);
|
||||||
|
@ -299,7 +807,14 @@ void FindDialog(HWND hWnd)
|
||||||
if (DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FIND),
|
if (DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FIND),
|
||||||
hWnd, FindDialogProc, 0) != 0)
|
hWnd, FindDialogProc, 0) != 0)
|
||||||
{
|
{
|
||||||
FindNext(hWnd);
|
if (FindNext(hWnd) == FALSE)
|
||||||
|
{
|
||||||
|
TCHAR msg[128], caption[128];
|
||||||
|
|
||||||
|
LoadString(hInst, IDS_FINISHEDFIND, msg, sizeof(msg)/sizeof(TCHAR));
|
||||||
|
LoadString(hInst, IDS_APP_TITLE, caption, sizeof(caption)/sizeof(TCHAR));
|
||||||
|
MessageBox(0, msg, caption, MB_ICONINFORMATION);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Îòêàç",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Îòêàç",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Ïðåòúðñâàíå íà ðåãèñòúðà...",IDC_STATIC,33,12,105,8
|
LTEXT "Ïðåòúðñâàíå íà ðåãèñòúðà...",IDC_STATIC,33,12,105,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "Find"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "Suchen"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Abbrechen",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Abbrechen",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Durchsuche die Registry...",IDC_STATIC,33,12,85,8
|
LTEXT "Durchsuche die Registry...",IDC_STATIC,33,12,85,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Áêýñùóç",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Áêýñùóç",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Ãßíåôáé áíáæÞôçóç óôç registry...",IDC_STATIC,33,12,83,8
|
LTEXT "Ãßíåôáé áíáæÞôçóç óôç registry...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -435,7 +435,7 @@ CAPTION "Find"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -441,7 +441,7 @@ CAPTION "Buscar"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Cancelar",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Cancelar",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Buscando en el registro...",IDC_STATIC,33,12,83,8
|
LTEXT "Buscando en el registro...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -430,7 +430,7 @@ CAPTION "Chercher"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "Annuler",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "Annuler",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Recherche dans le registre...",IDC_STATIC,33,12,83,8
|
LTEXT "Recherche dans le registre...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,7 @@ CAPTION "Find"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "Cari"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Batal",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Batal",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Mencari registri...",IDC_STATIC,33,12,83,8
|
LTEXT "Mencari registri...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -443,7 +443,7 @@ CAPTION "Trova"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Annulla",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Annulla",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Ricerca in corso nel registro...",IDC_STATIC,33,12,83,8
|
LTEXT "Ricerca in corso nel registro...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -423,9 +423,9 @@ BEGIN
|
||||||
CONTROL "データ(&D)",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX |
|
CONTROL "データ(&D)",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX |
|
||||||
WS_TABSTOP,14,60,42,8
|
WS_TABSTOP,14,60,42,8
|
||||||
CONTROL "完全に一致するものだけを検索(&W)",IDC_MATCHSTRING,"Button",
|
CONTROL "完全に一致するものだけを検索(&W)",IDC_MATCHSTRING,"Button",
|
||||||
BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13
|
BS_AUTOCHECKBOX | WS_TABSTOP,83,32,109,13
|
||||||
CONTROL "大文字と小文字を区別する(&C)",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX |
|
CONTROL "大文字と小文字を区別する(&C)",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX |
|
||||||
WS_TABSTOP,83,48,90,12
|
WS_TABSTOP,83,48,108,12
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_FINDING DIALOGEX 0, 0, 145, 50
|
IDD_FINDING DIALOGEX 0, 0, 145, 50
|
||||||
|
@ -435,7 +435,7 @@ CAPTION "
|
||||||
FONT 9, "MS UI Gothic", 400, 0, 0x1
|
FONT 9, "MS UI Gothic", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "キャンセル(&C)",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "キャンセル(&C)",IDCANCEL,93,29,45,14
|
||||||
LTEXT "レジストリの検索中...",IDC_STATIC,33,12,83,8
|
LTEXT "レジストリの検索中...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -423,7 +423,7 @@ CAPTION "ã
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "취소(&C)",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "취소(&C)",IDCANCEL,93,29,45,14
|
||||||
LTEXT "레지스트리를 검색중...",IDC_STATIC,33,12,83,8
|
LTEXT "레지스트리를 검색중...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "Find"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "S
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Avbryt",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Avbryt",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Søker i registret...",IDC_STATIC,33,12,83,8
|
LTEXT "Søker i registret...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -443,7 +443,7 @@ CAPTION "Znajd
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Anuluj",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Anuluj",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Przeszukiwanie rejestru...",IDC_STATIC,33,12,83,8
|
LTEXT "Przeszukiwanie rejestru...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,7 @@ CAPTION "Localizar"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Cancelar",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Cancelar",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Pesquisando o registro...",IDC_STATIC,33,12,83,8
|
LTEXT "Pesquisando o registro...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,7 @@ CAPTION "Find"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT, IDC_STATIC, 7, 7, 20, 20
|
ICON IDI_REGEDIT, IDC_STATIC, 7, 7, 20, 20
|
||||||
PUSHBUTTON "&Îòìåíà", IDCANCEL, 93, 29, 45, 14
|
DEFPUSHBUTTON "&Îòìåíà", IDCANCEL, 93, 29, 45, 14
|
||||||
LTEXT "Ïîèñê â ðååñòðå...", IDC_STATIC, 33, 12, 83, 8
|
LTEXT "Ïîèñê â ðååñòðå...", IDC_STATIC, 33, 12, 83, 8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -423,7 +423,7 @@ CAPTION "Find"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Zruši<C5A1>",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Zruši<C5A1>",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "Find"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -435,7 +435,7 @@ CAPTION "Find"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "Find"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "&Ñêàñóâàòè",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "&Ñêàñóâàòè",IDCANCEL,93,29,45,14
|
||||||
LTEXT "Ïîøóê ó ðåºñòð³...",IDC_STATIC,33,12,83,8
|
LTEXT "Ïîøóê ó ðåºñòð³...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ CAPTION "
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
|
||||||
PUSHBUTTON "È¡Ïû(&C)",IDCANCEL,93,29,45,14
|
DEFPUSHBUTTON "È¡Ïû(&C)",IDCANCEL,93,29,45,14
|
||||||
LTEXT "正在搜索注册表...",IDC_STATIC,33,12,83,8
|
LTEXT "正在搜索注册表...",IDC_STATIC,33,12,83,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
int Image_String = 0;
|
int Image_String = 0;
|
||||||
int Image_Bin = 0;
|
int Image_Bin = 0;
|
||||||
|
INT iListViewSelect = -1;
|
||||||
|
|
||||||
typedef struct tagLINE_INFO
|
typedef struct tagLINE_INFO
|
||||||
{
|
{
|
||||||
|
@ -76,6 +77,29 @@ LPCTSTR GetValueName(HWND hwndLV, int iStartAt)
|
||||||
return lineinfo->name;
|
return lineinfo->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID SetValueName(HWND hwndLV, LPCTSTR pszValueName)
|
||||||
|
{
|
||||||
|
INT i, c;
|
||||||
|
LV_FINDINFO fi;
|
||||||
|
|
||||||
|
c = ListView_GetItemCount(hwndLV);
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
{
|
||||||
|
ListView_SetItemState(hwndLV, i, 0, LVIS_FOCUSED | LVIS_SELECTED);
|
||||||
|
}
|
||||||
|
if (pszValueName == NULL)
|
||||||
|
i = 0;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fi.flags = LVFI_STRING;
|
||||||
|
fi.psz = pszValueName;
|
||||||
|
i = ListView_FindItem(hwndLV, -1, &fi);
|
||||||
|
}
|
||||||
|
ListView_SetItemState(hwndLV, i, LVIS_FOCUSED | LVIS_SELECTED,
|
||||||
|
LVIS_FOCUSED | LVIS_SELECTED);
|
||||||
|
iListViewSelect = i;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL IsDefaultValue(HWND hwndLV, int i)
|
BOOL IsDefaultValue(HWND hwndLV, int i)
|
||||||
{
|
{
|
||||||
PLINE_INFO lineinfo;
|
PLINE_INFO lineinfo;
|
||||||
|
@ -497,6 +521,7 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath)
|
||||||
DWORD val_count;
|
DWORD val_count;
|
||||||
HKEY hNewKey;
|
HKEY hNewKey;
|
||||||
LONG errCode;
|
LONG errCode;
|
||||||
|
INT i, c;
|
||||||
BOOL AddedDefault = FALSE;
|
BOOL AddedDefault = FALSE;
|
||||||
|
|
||||||
if (!hwndLV) return FALSE;
|
if (!hwndLV) return FALSE;
|
||||||
|
@ -552,7 +577,15 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath)
|
||||||
{
|
{
|
||||||
AddEntryToList(hwndLV, _T(""), REG_SZ, NULL, 0, 0, FALSE);
|
AddEntryToList(hwndLV, _T(""), REG_SZ, NULL, 0, 0, FALSE);
|
||||||
}
|
}
|
||||||
(void)ListView_SortItems(hwndLV, CompareFunc, (WPARAM)hwndLV);
|
ListView_SortItems(hwndLV, CompareFunc, (WPARAM)hwndLV);
|
||||||
|
c = ListView_GetItemCount(hwndLV);
|
||||||
|
for(i = 0; i < c; i++)
|
||||||
|
{
|
||||||
|
ListView_SetItemState(hwndLV, i, 0, LVIS_FOCUSED | LVIS_SELECTED);
|
||||||
|
}
|
||||||
|
ListView_SetItemState(hwndLV, iListViewSelect,
|
||||||
|
LVIS_FOCUSED | LVIS_SELECTED,
|
||||||
|
LVIS_FOCUSED | LVIS_SELECTED);
|
||||||
RegCloseKey(hNewKey);
|
RegCloseKey(hNewKey);
|
||||||
SendMessage(hwndLV, WM_SETREDRAW, TRUE, 0);
|
SendMessage(hwndLV, WM_SETREDRAW, TRUE, 0);
|
||||||
|
|
||||||
|
|
|
@ -1497,147 +1497,6 @@ done:
|
||||||
return lResult;
|
return lResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Searching
|
|
||||||
*/
|
|
||||||
|
|
||||||
static LONG RegNextKey(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength)
|
|
||||||
{
|
|
||||||
LONG lResult;
|
|
||||||
LPTSTR s;
|
|
||||||
LPCTSTR pszOriginalKey;
|
|
||||||
TCHAR szKeyName[256];
|
|
||||||
HKEY hSubKey, hBaseKey;
|
|
||||||
DWORD dwIndex = 0;
|
|
||||||
DWORD cbName;
|
|
||||||
FILETIME ft;
|
|
||||||
BOOL bFoundKey = FALSE;
|
|
||||||
|
|
||||||
/* Try accessing a subkey */
|
|
||||||
if (RegOpenKeyEx(hKey, lpSubKey, 0, KEY_ALL_ACCESS, &hSubKey) == ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
cbName = (DWORD) iSubKeyLength - _tcslen(lpSubKey) - 1;
|
|
||||||
lResult = RegEnumKeyEx(hSubKey, 0, lpSubKey + _tcslen(lpSubKey) + 1,
|
|
||||||
&cbName, NULL, NULL, NULL, &ft);
|
|
||||||
RegCloseKey(hSubKey);
|
|
||||||
|
|
||||||
if (lResult == ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
lpSubKey[_tcslen(lpSubKey)] = '\\';
|
|
||||||
bFoundKey = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bFoundKey)
|
|
||||||
{
|
|
||||||
/* Go up and find the next sibling key */
|
|
||||||
do
|
|
||||||
{
|
|
||||||
s = _tcsrchr(lpSubKey, TEXT('\\'));
|
|
||||||
if (s)
|
|
||||||
{
|
|
||||||
*s = '\0';
|
|
||||||
pszOriginalKey = s + 1;
|
|
||||||
|
|
||||||
hBaseKey = NULL;
|
|
||||||
RegOpenKeyEx(hKey, lpSubKey, 0, KEY_ALL_ACCESS, &hBaseKey);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pszOriginalKey = lpSubKey;
|
|
||||||
hBaseKey = hKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hBaseKey)
|
|
||||||
{
|
|
||||||
dwIndex = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
lResult = RegEnumKey(hBaseKey, dwIndex++, szKeyName, sizeof(szKeyName) / sizeof(szKeyName[0]));
|
|
||||||
}
|
|
||||||
while((lResult == ERROR_SUCCESS) && _tcscmp(szKeyName, pszOriginalKey));
|
|
||||||
|
|
||||||
if (lResult == ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
lResult = RegEnumKey(hBaseKey, dwIndex++, szKeyName, sizeof(szKeyName) / sizeof(szKeyName[0]));
|
|
||||||
if (lResult == ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
bFoundKey = TRUE;
|
|
||||||
_sntprintf(lpSubKey + _tcslen(lpSubKey), iSubKeyLength - _tcslen(lpSubKey), _T("\\%s"), szKeyName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RegCloseKey(hBaseKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while(!bFoundKey);
|
|
||||||
}
|
|
||||||
return bFoundKey ? ERROR_SUCCESS : ERROR_NO_MORE_ITEMS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL RegSearchCompare(LPCTSTR s1, LPCTSTR s2, DWORD dwSearchFlags)
|
|
||||||
{
|
|
||||||
BOOL bResult;
|
|
||||||
if (dwSearchFlags & RSF_WHOLESTRING)
|
|
||||||
{
|
|
||||||
if (dwSearchFlags & RSF_MATCHCASE)
|
|
||||||
bResult = !_tcscmp(s1, s2);
|
|
||||||
else
|
|
||||||
bResult = !_tcsicmp(s1, s2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (dwSearchFlags & RSF_MATCHCASE)
|
|
||||||
bResult = (_tcsstr(s1, s2) != NULL);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* My kingdom for _tcsistr() */
|
|
||||||
bResult = FALSE;
|
|
||||||
while(*s1)
|
|
||||||
{
|
|
||||||
if (!_tcsnicmp(s1, s2, _tcslen(s2)))
|
|
||||||
{
|
|
||||||
bResult = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
s1++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return bResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
LONG RegSearch(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength,
|
|
||||||
LPCTSTR pszSearchString, DWORD dwValueIndex,
|
|
||||||
DWORD dwSearchFlags, BOOL (*pfnCallback)(LPVOID), LPVOID lpParam)
|
|
||||||
{
|
|
||||||
LONG lResult;
|
|
||||||
LPCTSTR s;
|
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(dwValueIndex);
|
|
||||||
|
|
||||||
if (dwSearchFlags & (RSF_LOOKATVALUES | RSF_LOOKATDATA))
|
|
||||||
return ERROR_CALL_NOT_IMPLEMENTED; /* NYI */
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (pfnCallback)
|
|
||||||
{
|
|
||||||
if (pfnCallback(lpParam))
|
|
||||||
return ERROR_OPERATION_ABORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
lResult = RegNextKey(hKey, lpSubKey, iSubKeyLength);
|
|
||||||
if (lResult != ERROR_SUCCESS)
|
|
||||||
return lResult;
|
|
||||||
|
|
||||||
s = _tcsrchr(lpSubKey, TEXT('\\'));
|
|
||||||
s = s ? s + 1 : lpSubKey;
|
|
||||||
}
|
|
||||||
while(!(dwSearchFlags & RSF_LOOKATKEYS) || !RegSearchCompare(s, pszSearchString, dwSearchFlags));
|
|
||||||
|
|
||||||
return ERROR_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Key naming and parsing
|
* Key naming and parsing
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -92,10 +92,6 @@ LONG RegQueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPTST
|
||||||
#define RSF_LOOKATDATA 0x00000008
|
#define RSF_LOOKATDATA 0x00000008
|
||||||
#define RSF_MATCHCASE 0x00010000
|
#define RSF_MATCHCASE 0x00010000
|
||||||
|
|
||||||
LONG RegSearch(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength,
|
|
||||||
LPCTSTR pszSearchString, DWORD dwValueIndex,
|
|
||||||
DWORD dwSearchFlags, BOOL (*pfnCallback)(LPVOID), LPVOID lpParam);
|
|
||||||
|
|
||||||
BOOL RegKeyGetName(LPTSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCTSTR lpSubKey);
|
BOOL RegKeyGetName(LPTSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCTSTR lpSubKey);
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1126,4 +1126,8 @@ HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\Device\shellex\P
|
||||||
; Keyboard layout switcher
|
; Keyboard layout switcher
|
||||||
;HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","kbswitch",0x00000000,"kbswitch.exe"
|
;HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","kbswitch",0x00000000,"kbswitch.exe"
|
||||||
|
|
||||||
|
; SvcHost services
|
||||||
|
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost",,0x00000012
|
||||||
|
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost", "netsvcs",0x00010000,""
|
||||||
|
|
||||||
; EOF
|
; EOF
|
||||||
|
|
|
@ -1262,4 +1262,8 @@ HKLM,"SOFTWARE\Microsoft\Ole","EnableRemoteConnect",0x00000000,"N"
|
||||||
; Keyboard layout switcher
|
; Keyboard layout switcher
|
||||||
;HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","kbswitch",0x00000000,"kbswitch.exe"
|
;HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","kbswitch",0x00000000,"kbswitch.exe"
|
||||||
|
|
||||||
|
; SvcHost services
|
||||||
|
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost",,0x00000012
|
||||||
|
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost", "netsvcs",0x00010000,""
|
||||||
|
|
||||||
; EOF
|
; EOF
|
||||||
|
|
|
@ -973,6 +973,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Description",0x00000000,"P
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","ErrorControl",0x00010001,0x00000000
|
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","ErrorControl",0x00010001,0x00000000
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Group",0x00000000,"Audio"
|
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Group",0x00000000,"Audio"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","ImagePath",0x00020000,"%SystemRoot%\system32\audiosrv.exe"
|
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","ImagePath",0x00020000,"%SystemRoot%\system32\audiosrv.exe"
|
||||||
|
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","ObjectName",0x00000000,"LocalSystem"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Start",0x00010001,0x00000003
|
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Start",0x00010001,0x00000003
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Type",0x00010001,0x00000010
|
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Type",0x00010001,0x00000010
|
||||||
|
|
||||||
|
@ -1219,6 +1220,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","DisplayName",0x00000000,"Simpl
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","ErrorControl",0x00010001,0x00000001
|
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","ErrorControl",0x00010001,0x00000001
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Group",0x00000000,"Network"
|
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Group",0x00000000,"Network"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","ImagePath",0x00020000,"%SystemRoot%\system32\tcpsvcs.exe"
|
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","ImagePath",0x00020000,"%SystemRoot%\system32\tcpsvcs.exe"
|
||||||
|
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","ObjectName",0x00000000,"LocalSystem"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Start",0x00010001,0x00000003
|
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Start",0x00010001,0x00000003
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Type",0x00010001,0x00000020
|
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Type",0x00010001,0x00000020
|
||||||
|
|
||||||
|
@ -1228,6 +1230,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","DisplayName",0x00000000,"React
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","ErrorControl",0x00010001,0x00000001
|
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","ErrorControl",0x00010001,0x00000001
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Group",0x00000000,"Network"
|
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Group",0x00000000,"Network"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","ImagePath",0x00020000,"%SystemRoot%\system32\telnetd.exe"
|
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","ImagePath",0x00020000,"%SystemRoot%\system32\telnetd.exe"
|
||||||
|
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","ObjectName",0x00000000,"LocalSystem"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Start",0x00010001,0x00000003
|
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Start",0x00010001,0x00000003
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Type",0x00010001,0x00000020
|
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Type",0x00010001,0x00000020
|
||||||
|
|
||||||
|
@ -1308,6 +1311,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Description",0x00000000,"Con
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Group",0x00000000,"Windows Installer"
|
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Group",0x00000000,"Windows Installer"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","ErrorControl",0x00010001,0x00000001
|
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","ErrorControl",0x00010001,0x00000001
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","ImagePath",0x00020000,"system32\msiexec.exe /V"
|
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","ImagePath",0x00020000,"system32\msiexec.exe /V"
|
||||||
|
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","ObjectName",0x00000000,"LocalSystem"
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Start",0x00010001,0x00000003
|
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Start",0x00010001,0x00000003
|
||||||
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Type",0x00010001,0x00000020
|
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Type",0x00010001,0x00000020
|
||||||
|
|
||||||
|
|
|
@ -380,44 +380,53 @@ GlobalLock(HGLOBAL hMem)
|
||||||
/* Check if this was a simple allocated heap entry */
|
/* Check if this was a simple allocated heap entry */
|
||||||
if (!((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY))
|
if (!((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY))
|
||||||
{
|
{
|
||||||
/* Then simply return the pointer */
|
/* Verify and return the pointer */
|
||||||
return hMem;
|
return IsBadReadPtr(hMem, 1) ? NULL : hMem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Otherwise, lock the heap */
|
/* Otherwise, lock the heap */
|
||||||
RtlLockHeap(hProcessHeap);
|
RtlLockHeap(hProcessHeap);
|
||||||
|
|
||||||
/* Get the handle entry */
|
_SEH2_TRY
|
||||||
HandleEntry = BaseHeapGetEntry(hMem);
|
{
|
||||||
BASE_TRACE_HANDLE(HandleEntry, hMem);
|
/* Get the handle entry */
|
||||||
|
HandleEntry = BaseHeapGetEntry(hMem);
|
||||||
|
BASE_TRACE_HANDLE(HandleEntry, hMem);
|
||||||
|
|
||||||
/* Make sure it's valid */
|
/* Make sure it's valid */
|
||||||
if (!BaseHeapValidateEntry(HandleEntry))
|
if (!BaseHeapValidateEntry(HandleEntry))
|
||||||
{
|
|
||||||
/* It's not, fail */
|
|
||||||
BASE_TRACE_FAILURE();
|
|
||||||
SetLastError(ERROR_INVALID_HANDLE);
|
|
||||||
Ptr = NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Otherwise, get the pointer */
|
|
||||||
Ptr = HandleEntry->Object;
|
|
||||||
if (Ptr)
|
|
||||||
{
|
{
|
||||||
/* Increase the lock count, unless we've went too far */
|
/* It's not, fail */
|
||||||
if (HandleEntry->LockCount++ == GMEM_LOCKCOUNT)
|
BASE_TRACE_FAILURE();
|
||||||
{
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
/* In which case we simply unlock once */
|
Ptr = NULL;
|
||||||
HandleEntry->LockCount--;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* The handle is still there but the memory was already freed */
|
/* Otherwise, get the pointer */
|
||||||
SetLastError(ERROR_DISCARDED);
|
Ptr = HandleEntry->Object;
|
||||||
|
if (Ptr)
|
||||||
|
{
|
||||||
|
/* Increase the lock count, unless we've went too far */
|
||||||
|
if (HandleEntry->LockCount++ == GMEM_LOCKCOUNT)
|
||||||
|
{
|
||||||
|
/* In which case we simply unlock once */
|
||||||
|
HandleEntry->LockCount--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* The handle is still there but the memory was already freed */
|
||||||
|
SetLastError(ERROR_DISCARDED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
|
Ptr = NULL;
|
||||||
|
}
|
||||||
|
_SEH2_END
|
||||||
|
|
||||||
/* All done. Unlock the heap and return the pointer */
|
/* All done. Unlock the heap and return the pointer */
|
||||||
RtlUnlockHeap(hProcessHeap);
|
RtlUnlockHeap(hProcessHeap);
|
||||||
|
@ -702,65 +711,74 @@ GlobalSize(HGLOBAL hMem)
|
||||||
/* Lock the heap */
|
/* Lock the heap */
|
||||||
RtlLockHeap(hProcessHeap);
|
RtlLockHeap(hProcessHeap);
|
||||||
|
|
||||||
/* Check if this is a simple RTL Heap Managed block */
|
_SEH2_TRY
|
||||||
if (!((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY))
|
|
||||||
{
|
{
|
||||||
/* Then we'll query RTL Heap */
|
/* Check if this is a simple RTL Heap Managed block */
|
||||||
RtlGetUserInfoHeap(hProcessHeap, Flags, hMem, &Handle, &Flags);
|
if (!((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY))
|
||||||
BASE_TRACE_PTR(Handle, hMem);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check if RTL Heap didn't give us a handle or said that this heap
|
|
||||||
* isn't movable.
|
|
||||||
*/
|
|
||||||
if (!(Handle) || !(Flags & BASE_HEAP_FLAG_MOVABLE))
|
|
||||||
{
|
{
|
||||||
/* This implies we're not a handle heap, so use the generic call */
|
/* Then we'll query RTL Heap */
|
||||||
dwSize = RtlSizeHeap(hProcessHeap, HEAP_NO_SERIALIZE, hMem);
|
RtlGetUserInfoHeap(hProcessHeap, Flags, hMem, &Handle, &Flags);
|
||||||
|
BASE_TRACE_PTR(Handle, hMem);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if RTL Heap didn't give us a handle or said that this heap
|
||||||
|
* isn't movable.
|
||||||
|
*/
|
||||||
|
if (!(Handle) || !(Flags & BASE_HEAP_FLAG_MOVABLE))
|
||||||
|
{
|
||||||
|
/* This implies we're not a handle heap, so use the generic call */
|
||||||
|
dwSize = RtlSizeHeap(hProcessHeap, HEAP_NO_SERIALIZE, hMem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Otherwise we're a handle heap, so get the internal handle */
|
||||||
|
hMem = Handle;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
/* Make sure that this is an entry in our handle database */
|
||||||
|
if ((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY)
|
||||||
{
|
{
|
||||||
/* Otherwise we're a handle heap, so get the internal handle */
|
/* Get the entry */
|
||||||
hMem = Handle;
|
HandleEntry = BaseHeapGetEntry(hMem);
|
||||||
|
BASE_TRACE_HANDLE(HandleEntry, hMem);
|
||||||
|
|
||||||
|
/* Make sure the handle is valid */
|
||||||
|
if (!BaseHeapValidateEntry(HandleEntry))
|
||||||
|
{
|
||||||
|
/* Fail */
|
||||||
|
BASE_TRACE_FAILURE();
|
||||||
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
|
}
|
||||||
|
else if (HandleEntry->Flags & BASE_HEAP_ENTRY_FLAG_REUSE)
|
||||||
|
{
|
||||||
|
/* We've reused this block, but we've saved the size for you */
|
||||||
|
dwSize = HandleEntry->OldSize;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Otherwise, query RTL about it */
|
||||||
|
dwSize = RtlSizeHeap(hProcessHeap,
|
||||||
|
HEAP_NO_SERIALIZE,
|
||||||
|
HandleEntry->Object);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Make sure that this is an entry in our handle database */
|
/* Check if by now, we still haven't gotten any useful size */
|
||||||
if ((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY)
|
if (dwSize == MAXULONG_PTR)
|
||||||
{
|
|
||||||
/* Get the entry */
|
|
||||||
HandleEntry = BaseHeapGetEntry(hMem);
|
|
||||||
BASE_TRACE_HANDLE(HandleEntry, hMem);
|
|
||||||
|
|
||||||
/* Make sure the handle is valid */
|
|
||||||
if (!BaseHeapValidateEntry(HandleEntry))
|
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
BASE_TRACE_FAILURE();
|
BASE_TRACE_FAILURE();
|
||||||
SetLastError(ERROR_INVALID_HANDLE);
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
}
|
dwSize = 0;
|
||||||
else if (HandleEntry->Flags & BASE_HEAP_ENTRY_FLAG_REUSE)
|
|
||||||
{
|
|
||||||
/* We've reused this block, but we've saved the size for you */
|
|
||||||
dwSize = HandleEntry->OldSize;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Otherwise, query RTL about it */
|
|
||||||
dwSize = RtlSizeHeap(hProcessHeap,
|
|
||||||
HEAP_NO_SERIALIZE,
|
|
||||||
HandleEntry->Object);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
/* Check if by now, we still haven't gotten any useful size */
|
|
||||||
if (dwSize == MAXULONG_PTR)
|
|
||||||
{
|
{
|
||||||
/* Fail */
|
|
||||||
BASE_TRACE_FAILURE();
|
|
||||||
SetLastError(ERROR_INVALID_HANDLE);
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
dwSize = 0;
|
dwSize = 0;
|
||||||
}
|
}
|
||||||
|
_SEH2_END
|
||||||
|
|
||||||
/* All done! Unlock heap and return the size */
|
/* All done! Unlock heap and return the size */
|
||||||
RtlUnlockHeap(hProcessHeap);
|
RtlUnlockHeap(hProcessHeap);
|
||||||
|
@ -798,31 +816,40 @@ GlobalUnlock(HGLOBAL hMem)
|
||||||
HandleEntry = BaseHeapGetEntry(hMem);
|
HandleEntry = BaseHeapGetEntry(hMem);
|
||||||
BASE_TRACE_HANDLE(HandleEntry, hMem);
|
BASE_TRACE_HANDLE(HandleEntry, hMem);
|
||||||
|
|
||||||
/* Make sure it's valid */
|
_SEH2_TRY
|
||||||
if (!BaseHeapValidateEntry(HandleEntry))
|
|
||||||
{
|
{
|
||||||
/* It's not, fail */
|
/* Make sure it's valid */
|
||||||
BASE_TRACE_FAILURE();
|
if (!BaseHeapValidateEntry(HandleEntry))
|
||||||
SetLastError(ERROR_INVALID_HANDLE);
|
{
|
||||||
|
/* It's not, fail */
|
||||||
|
BASE_TRACE_FAILURE();
|
||||||
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
|
RetVal = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Otherwise, decrement lock count, unless we're already at 0*/
|
||||||
|
if (!HandleEntry->LockCount--)
|
||||||
|
{
|
||||||
|
/* In which case we simply lock it back and fail */
|
||||||
|
HandleEntry->LockCount++;
|
||||||
|
SetLastError(ERROR_NOT_LOCKED);
|
||||||
|
RetVal = FALSE;
|
||||||
|
}
|
||||||
|
else if (!HandleEntry->LockCount)
|
||||||
|
{
|
||||||
|
/* Nothing to unlock */
|
||||||
|
SetLastError(NO_ERROR);
|
||||||
|
RetVal = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
RetVal = FALSE;
|
RetVal = FALSE;
|
||||||
}
|
}
|
||||||
else
|
_SEH2_END
|
||||||
{
|
|
||||||
/* Otherwise, decrement lock count, unless we're already at 0*/
|
|
||||||
if (!HandleEntry->LockCount--)
|
|
||||||
{
|
|
||||||
/* In which case we simply lock it back and fail */
|
|
||||||
HandleEntry->LockCount++;
|
|
||||||
SetLastError(ERROR_NOT_LOCKED);
|
|
||||||
RetVal = FALSE;
|
|
||||||
}
|
|
||||||
else if (!HandleEntry->LockCount)
|
|
||||||
{
|
|
||||||
/* Nothing to unlock */
|
|
||||||
SetLastError(NO_ERROR);
|
|
||||||
RetVal = FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* All done. Unlock the heap and return the pointer */
|
/* All done. Unlock the heap and return the pointer */
|
||||||
RtlUnlockHeap(hProcessHeap);
|
RtlUnlockHeap(hProcessHeap);
|
||||||
|
|
|
@ -993,11 +993,11 @@ OpenConsoleW(LPCWSTR wsName,
|
||||||
ULONG CsrRequest;
|
ULONG CsrRequest;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
if (0 == _wcsicmp(wsName, L"CONIN$"))
|
if (wsName && 0 == _wcsicmp(wsName, L"CONIN$"))
|
||||||
{
|
{
|
||||||
CsrRequest = MAKE_CSR_API(GET_INPUT_HANDLE, CSR_NATIVE);
|
CsrRequest = MAKE_CSR_API(GET_INPUT_HANDLE, CSR_NATIVE);
|
||||||
}
|
}
|
||||||
else if (0 == _wcsicmp(wsName, L"CONOUT$"))
|
else if (wsName && 0 == _wcsicmp(wsName, L"CONOUT$"))
|
||||||
{
|
{
|
||||||
CsrRequest = MAKE_CSR_API(GET_OUTPUT_HANDLE, CSR_NATIVE);
|
CsrRequest = MAKE_CSR_API(GET_OUTPUT_HANDLE, CSR_NATIVE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1260,6 +1260,170 @@ IsValidCodePage(UINT CodePage)
|
||||||
return GetCPFileNameFromRegistry(CodePage, NULL, 0);
|
return GetCPFileNameFromRegistry(CodePage, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const signed char
|
||||||
|
base64inv[] =
|
||||||
|
{
|
||||||
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
|
||||||
|
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
|
||||||
|
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
||||||
|
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
|
||||||
|
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
||||||
|
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1
|
||||||
|
};
|
||||||
|
|
||||||
|
static VOID Utf7Base64Decode(BYTE *pbDest, LPCSTR pszSrc, INT cchSrc)
|
||||||
|
{
|
||||||
|
INT i, j, n;
|
||||||
|
BYTE b;
|
||||||
|
|
||||||
|
for(i = 0; i < cchSrc / 4 * 4; i += 4)
|
||||||
|
{
|
||||||
|
for(j = n = 0; j < 4; )
|
||||||
|
{
|
||||||
|
b = (BYTE) base64inv[(BYTE) *pszSrc++];
|
||||||
|
n |= (((INT) b) << ((3 - j) * 6));
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
for(j = 0; j < 3; j++)
|
||||||
|
*pbDest++ = (BYTE) ((n >> (8 * (2 - j))) & 0xFF);
|
||||||
|
}
|
||||||
|
for(j = n = 0; j < cchSrc % 4; )
|
||||||
|
{
|
||||||
|
b = (BYTE) base64inv[(BYTE) *pszSrc++];
|
||||||
|
n |= (((INT) b) << ((3 - j) * 6));
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
for(j = 0; j < ((cchSrc % 4) * 6 / 8); j++)
|
||||||
|
*pbDest++ = (BYTE) ((n >> (8 * (2 - j))) & 0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
static VOID myswab(LPVOID pv, INT cw)
|
||||||
|
{
|
||||||
|
LPBYTE pb = (LPBYTE) pv;
|
||||||
|
BYTE b;
|
||||||
|
while(cw > 0)
|
||||||
|
{
|
||||||
|
b = *pb;
|
||||||
|
*pb = pb[1];
|
||||||
|
pb[1] = b;
|
||||||
|
pb += 2;
|
||||||
|
cw--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static INT Utf7ToWideCharSize(LPCSTR pszUtf7, INT cchUtf7)
|
||||||
|
{
|
||||||
|
INT n, c, cch;
|
||||||
|
CHAR ch;
|
||||||
|
LPCSTR pch;
|
||||||
|
|
||||||
|
c = 0;
|
||||||
|
while(cchUtf7 > 0)
|
||||||
|
{
|
||||||
|
ch = *pszUtf7++;
|
||||||
|
if (ch == '+')
|
||||||
|
{
|
||||||
|
ch = *pszUtf7;
|
||||||
|
if (ch == '-')
|
||||||
|
{
|
||||||
|
c++;
|
||||||
|
pszUtf7++;
|
||||||
|
cchUtf7 -= 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
cchUtf7--;
|
||||||
|
pch = pszUtf7;
|
||||||
|
while(cchUtf7 > 0 && (BYTE) *pszUtf7 < 0x80 &&
|
||||||
|
base64inv[*pszUtf7] >= 0)
|
||||||
|
{
|
||||||
|
cchUtf7--;
|
||||||
|
pszUtf7++;
|
||||||
|
}
|
||||||
|
cch = pszUtf7 - pch;
|
||||||
|
n = (cch * 3) / 8;
|
||||||
|
c += n;
|
||||||
|
if (cchUtf7 > 0 && *pszUtf7 == '-')
|
||||||
|
{
|
||||||
|
pszUtf7++;
|
||||||
|
cchUtf7--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
c++;
|
||||||
|
cchUtf7--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
static INT Utf7ToWideChar(LPCSTR pszUtf7, INT cchUtf7, LPWSTR pszWide, INT cchWide)
|
||||||
|
{
|
||||||
|
INT n, c, cch;
|
||||||
|
CHAR ch;
|
||||||
|
LPCSTR pch;
|
||||||
|
WORD *pwsz;
|
||||||
|
|
||||||
|
c = Utf7ToWideCharSize(pszUtf7, cchUtf7);
|
||||||
|
if (cchWide == 0)
|
||||||
|
return c;
|
||||||
|
|
||||||
|
if (cchWide < c)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
while(cchUtf7 > 0)
|
||||||
|
{
|
||||||
|
ch = *pszUtf7++;
|
||||||
|
if (ch == '+')
|
||||||
|
{
|
||||||
|
if (*pszUtf7 == '-')
|
||||||
|
{
|
||||||
|
*pszWide++ = L'+';
|
||||||
|
pszUtf7++;
|
||||||
|
cchUtf7 -= 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
cchUtf7--;
|
||||||
|
pch = pszUtf7;
|
||||||
|
while(cchUtf7 > 0 && (BYTE) *pszUtf7 < 0x80 &&
|
||||||
|
base64inv[*pszUtf7] >= 0)
|
||||||
|
{
|
||||||
|
cchUtf7--;
|
||||||
|
pszUtf7++;
|
||||||
|
}
|
||||||
|
cch = pszUtf7 - pch;
|
||||||
|
n = (cch * 3) / 8;
|
||||||
|
pwsz = (WORD *) HeapAlloc(GetProcessHeap(), 0, (n + 1) * sizeof(WORD));
|
||||||
|
if (pwsz == NULL)
|
||||||
|
return 0;
|
||||||
|
ZeroMemory(pwsz, n * sizeof(WORD));
|
||||||
|
Utf7Base64Decode((BYTE *) pwsz, pch, cch);
|
||||||
|
myswab(pwsz, n);
|
||||||
|
CopyMemory(pszWide, pwsz, n * sizeof(WORD));
|
||||||
|
HeapFree(GetProcessHeap(), 0, pwsz);
|
||||||
|
pszWide += n;
|
||||||
|
if (cchUtf7 > 0 && *pszUtf7 == '-')
|
||||||
|
{
|
||||||
|
pszUtf7++;
|
||||||
|
cchUtf7--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*pszWide++ = (WCHAR) ch;
|
||||||
|
cchUtf7--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name MultiByteToWideChar
|
* @name MultiByteToWideChar
|
||||||
*
|
*
|
||||||
|
@ -1325,8 +1489,13 @@ MultiByteToWideChar(UINT CodePage,
|
||||||
WideCharCount);
|
WideCharCount);
|
||||||
|
|
||||||
case CP_UTF7:
|
case CP_UTF7:
|
||||||
DPRINT1("MultiByteToWideChar for CP_UTF7 is not implemented!\n");
|
if (Flags)
|
||||||
return 0;
|
{
|
||||||
|
SetLastError(ERROR_INVALID_FLAGS);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return Utf7ToWideChar(MultiByteString, MultiByteCount,
|
||||||
|
WideCharString, WideCharCount);
|
||||||
|
|
||||||
case CP_SYMBOL:
|
case CP_SYMBOL:
|
||||||
return IntMultiByteToWideCharSYMBOL(Flags,
|
return IntMultiByteToWideCharSYMBOL(Flags,
|
||||||
|
@ -1344,6 +1513,162 @@ MultiByteToWideChar(UINT CodePage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char mustshift[] =
|
||||||
|
{
|
||||||
|
0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0,
|
||||||
|
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
|
||||||
|
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char base64[] =
|
||||||
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
|
||||||
|
static INT WideCharToUtf7Size(LPCWSTR pszWide, INT cchWide)
|
||||||
|
{
|
||||||
|
WCHAR wch;
|
||||||
|
INT c = 0;
|
||||||
|
BOOL fShift = FALSE;
|
||||||
|
|
||||||
|
while(cchWide > 0)
|
||||||
|
{
|
||||||
|
wch = *pszWide;
|
||||||
|
if (wch < 0x80 && !mustshift[wch])
|
||||||
|
{
|
||||||
|
c++;
|
||||||
|
cchWide--;
|
||||||
|
pszWide++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (wch == L'+')
|
||||||
|
{
|
||||||
|
c++;
|
||||||
|
c++;
|
||||||
|
cchWide--;
|
||||||
|
pszWide++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!fShift)
|
||||||
|
{
|
||||||
|
c++;
|
||||||
|
fShift = TRUE;
|
||||||
|
}
|
||||||
|
pszWide++;
|
||||||
|
cchWide--;
|
||||||
|
c += 3;
|
||||||
|
if (cchWide > 0 && (*pszWide >= 0x80 || mustshift[*pszWide]))
|
||||||
|
{
|
||||||
|
pszWide++;
|
||||||
|
cchWide--;
|
||||||
|
c += 3;
|
||||||
|
if (cchWide > 0 && (*pszWide >= 0x80 || mustshift[*pszWide]))
|
||||||
|
{
|
||||||
|
pszWide++;
|
||||||
|
cchWide--;
|
||||||
|
c += 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (cchWide > 0 && *pszWide < 0x80 && !mustshift[*pszWide])
|
||||||
|
{
|
||||||
|
c++;
|
||||||
|
fShift = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fShift)
|
||||||
|
c++;
|
||||||
|
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
static INT WideCharToUtf7(LPCWSTR pszWide, INT cchWide, LPSTR pszUtf7, INT cchUtf7)
|
||||||
|
{
|
||||||
|
WCHAR wch;
|
||||||
|
INT c, n;
|
||||||
|
WCHAR wsz[3];
|
||||||
|
BOOL fShift = FALSE;
|
||||||
|
|
||||||
|
c = WideCharToUtf7Size(pszWide, cchWide);
|
||||||
|
if (cchUtf7 == 0)
|
||||||
|
return c;
|
||||||
|
|
||||||
|
if (cchUtf7 < c)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
while(cchWide > 0)
|
||||||
|
{
|
||||||
|
wch = *pszWide;
|
||||||
|
if (wch < 0x80 && !mustshift[wch])
|
||||||
|
{
|
||||||
|
*pszUtf7++ = (CHAR) wch;
|
||||||
|
cchWide--;
|
||||||
|
pszWide++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (wch == L'+')
|
||||||
|
{
|
||||||
|
*pszUtf7++ = '+';
|
||||||
|
*pszUtf7++ = '-';
|
||||||
|
cchWide--;
|
||||||
|
pszWide++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!fShift)
|
||||||
|
{
|
||||||
|
*pszUtf7++ = '+';
|
||||||
|
fShift = TRUE;
|
||||||
|
}
|
||||||
|
wsz[0] = *pszWide++;
|
||||||
|
cchWide--;
|
||||||
|
n = 1;
|
||||||
|
if (cchWide > 0 && (*pszWide >= 0x80 || mustshift[*pszWide]))
|
||||||
|
{
|
||||||
|
wsz[1] = *pszWide++;
|
||||||
|
cchWide--;
|
||||||
|
n++;
|
||||||
|
if (cchWide > 0 && (*pszWide >= 0x80 || mustshift[*pszWide]))
|
||||||
|
{
|
||||||
|
wsz[2] = *pszWide++;
|
||||||
|
cchWide--;
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*pszUtf7++ = base64[wsz[0] >> 10];
|
||||||
|
*pszUtf7++ = base64[(wsz[0] >> 4) & 0x3F];
|
||||||
|
*pszUtf7++ = base64[(wsz[0] << 2 | wsz[1] >> 14) & 0x3F];
|
||||||
|
if (n >= 2)
|
||||||
|
{
|
||||||
|
*pszUtf7++ = base64[(wsz[1] >> 8) & 0x3F];
|
||||||
|
*pszUtf7++ = base64[(wsz[1] >> 2) & 0x3F];
|
||||||
|
*pszUtf7++ = base64[(wsz[1] << 4 | wsz[2] >> 12) & 0x3F];
|
||||||
|
if (n >= 3)
|
||||||
|
{
|
||||||
|
*pszUtf7++ = base64[(wsz[2] >> 6) & 0x3F];
|
||||||
|
*pszUtf7++ = base64[wsz[2] & 0x3F];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (cchWide > 0 && *pszWide < 0x80 && !mustshift[*pszWide])
|
||||||
|
{
|
||||||
|
*pszUtf7++ = '-';
|
||||||
|
fShift = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fShift)
|
||||||
|
*pszUtf7 = '-';
|
||||||
|
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name WideCharToMultiByte
|
* @name WideCharToMultiByte
|
||||||
*
|
*
|
||||||
|
@ -1423,8 +1748,18 @@ WideCharToMultiByte(UINT CodePage,
|
||||||
UsedDefaultChar);
|
UsedDefaultChar);
|
||||||
|
|
||||||
case CP_UTF7:
|
case CP_UTF7:
|
||||||
DPRINT1("WideCharToMultiByte for CP_UTF7 is not implemented!\n");
|
if (DefaultChar != NULL || UsedDefaultChar != NULL)
|
||||||
return 0;
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (Flags)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_FLAGS);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return WideCharToUtf7(WideCharString, WideCharCount,
|
||||||
|
MultiByteString, MultiByteCount);
|
||||||
|
|
||||||
case CP_SYMBOL:
|
case CP_SYMBOL:
|
||||||
if ((DefaultChar!=NULL) || (UsedDefaultChar!=NULL))
|
if ((DefaultChar!=NULL) || (UsedDefaultChar!=NULL))
|
||||||
|
|
|
@ -364,7 +364,7 @@ BasepInitializeContext(IN PCONTEXT Context,
|
||||||
}
|
}
|
||||||
else if (ContextType == 2) /* For Fibers */
|
else if (ContextType == 2) /* For Fibers */
|
||||||
{
|
{
|
||||||
//Context->Eip = (ULONG)BaseFiberStartup;
|
Context->Eip = (ULONG)BaseFiberStartup;
|
||||||
}
|
}
|
||||||
else /* For first thread in a Process */
|
else /* For first thread in a Process */
|
||||||
{
|
{
|
||||||
|
|
|
@ -146,9 +146,8 @@ CreateFiberEx(SIZE_T dwStackCommitSize,
|
||||||
PFIBER pfCurFiber;
|
PFIBER pfCurFiber;
|
||||||
NTSTATUS nErrCode;
|
NTSTATUS nErrCode;
|
||||||
INITIAL_TEB usFiberInitialTeb;
|
INITIAL_TEB usFiberInitialTeb;
|
||||||
CONTEXT ctxFiberContext;
|
|
||||||
PVOID ActivationContextStack = NULL;
|
PVOID ActivationContextStack = NULL;
|
||||||
DPRINT1("Creating Fiber\n");
|
DPRINT("Creating Fiber\n");
|
||||||
|
|
||||||
#ifdef SXS_SUPPORT_ENABLED
|
#ifdef SXS_SUPPORT_ENABLED
|
||||||
/* Allocate the Activation Context Stack */
|
/* Allocate the Activation Context Stack */
|
||||||
|
@ -203,7 +202,7 @@ CreateFiberEx(SIZE_T dwStackCommitSize,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize the context for the fiber */
|
/* initialize the context for the fiber */
|
||||||
BasepInitializeContext(&ctxFiberContext,
|
BasepInitializeContext(&pfCurFiber->Context,
|
||||||
lpParameter,
|
lpParameter,
|
||||||
lpStartAddress,
|
lpStartAddress,
|
||||||
usFiberInitialTeb.StackBase,
|
usFiberInitialTeb.StackBase,
|
||||||
|
@ -253,10 +252,10 @@ WINAPI
|
||||||
BaseFiberStartup(VOID)
|
BaseFiberStartup(VOID)
|
||||||
{
|
{
|
||||||
#ifdef _M_IX86
|
#ifdef _M_IX86
|
||||||
PFIBER Fiber = GetFiberData();
|
PFIBER Fiber = GetCurrentFiber();
|
||||||
|
|
||||||
/* Call the Thread Startup Routine */
|
/* Call the Thread Startup Routine */
|
||||||
DPRINT1("Starting Fiber\n");
|
DPRINT("Starting Fiber\n");
|
||||||
BaseThreadStartup((LPTHREAD_START_ROUTINE)Fiber->Context.Eax,
|
BaseThreadStartup((LPTHREAD_START_ROUTINE)Fiber->Context.Eax,
|
||||||
(LPVOID)Fiber->Context.Ebx);
|
(LPVOID)Fiber->Context.Ebx);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -24,7 +24,11 @@ _SwitchToFiber@4:
|
||||||
mov [eax+FIBER_CONTEXT_ESI], esi
|
mov [eax+FIBER_CONTEXT_ESI], esi
|
||||||
mov [eax+FIBER_CONTEXT_EDI], edi
|
mov [eax+FIBER_CONTEXT_EDI], edi
|
||||||
mov [eax+FIBER_CONTEXT_EBP], ebp
|
mov [eax+FIBER_CONTEXT_EBP], ebp
|
||||||
|
|
||||||
|
/* Save the return address */
|
||||||
|
mov ebx, [esp]
|
||||||
|
mov [eax+FIBER_CONTEXT_EIP], ebx
|
||||||
|
|
||||||
/* Check if we're to save FPU State */
|
/* Check if we're to save FPU State */
|
||||||
cmp dword ptr [eax+FIBER_CONTEXT_FLAGS], CONTEXT_FULL | CONTEXT_FLOATING_POINT
|
cmp dword ptr [eax+FIBER_CONTEXT_FLAGS], CONTEXT_FULL | CONTEXT_FLOATING_POINT
|
||||||
jnz NoFpuStateSave
|
jnz NoFpuStateSave
|
||||||
|
@ -115,7 +119,7 @@ NoFpuStateRestore:
|
||||||
mov eax, [ecx+FIBER_FLS_DATA]
|
mov eax, [ecx+FIBER_FLS_DATA]
|
||||||
mov [edx+TEB_FLS_DATA], eax
|
mov [edx+TEB_FLS_DATA], eax
|
||||||
|
|
||||||
/* Return */
|
/* Jump to new fiber */
|
||||||
ret 4
|
jmp [ecx+FIBER_CONTEXT_EIP]
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -12,5 +12,5 @@ HKCR,"AppID\BITS","AppID",,"%CLSID_BackgroundCopyQMgr%"
|
||||||
HKCR,"AppID\%CLSID_BackgroundCopyQMgr%","LocalService",,"BITS"
|
HKCR,"AppID\%CLSID_BackgroundCopyQMgr%","LocalService",,"BITS"
|
||||||
HKCR,"CLSID\%CLSID_BackgroundCopyManager%","AppID",,"%CLSID_BackgroundCopyQMgr%"
|
HKCR,"CLSID\%CLSID_BackgroundCopyManager%","AppID",,"%CLSID_BackgroundCopyQMgr%"
|
||||||
|
|
||||||
HKLM,"Software\Microsoft\Windows NT\CurrentVersion\SvcHost","netsvcs",0x00010000,"BITS"
|
HKLM,"Software\Microsoft\Windows NT\CurrentVersion\SvcHost","netsvcs",0x00010008,"BITS"
|
||||||
HKLM,"System\CurrentControlSet\Services\BITS\Parameters","ServiceDll",0x00020000,"qmgr.dll"
|
HKLM,"System\CurrentControlSet\Services\BITS\Parameters","ServiceDll",0x00020000,"qmgr.dll"
|
||||||
|
|
|
@ -250,7 +250,7 @@ static void append_multi_sz_value( HKEY hkey, const WCHAR *value, const WCHAR *s
|
||||||
if (total != size)
|
if (total != size)
|
||||||
{
|
{
|
||||||
TRACE( "setting value %s to %s\n", debugstr_w(value), debugstr_w(buffer) );
|
TRACE( "setting value %s to %s\n", debugstr_w(value), debugstr_w(buffer) );
|
||||||
RegSetValueExW( hkey, value, 0, REG_MULTI_SZ, (BYTE *)buffer, total );
|
RegSetValueExW( hkey, value, 0, REG_MULTI_SZ, (BYTE *)buffer, total + sizeof(WCHAR) );
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
HeapFree( GetProcessHeap(), 0, buffer );
|
HeapFree( GetProcessHeap(), 0, buffer );
|
||||||
|
|
|
@ -2206,8 +2206,8 @@ DrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font)
|
||||||
|
|
||||||
SelectObject(DC, GetStockObject(DC_PEN));
|
SelectObject(DC, GetStockObject(DC_PEN));
|
||||||
SetDCPenColor(DC, GetSysColor(COLOR_3DFACE));
|
SetDCPenColor(DC, GetSysColor(COLOR_3DFACE));
|
||||||
MoveToEx(DC, Rect->left, Rect->bottom, NULL);
|
MoveToEx(DC, Rect->left, Rect->bottom - 1, NULL);
|
||||||
LineTo(DC, Rect->right, Rect->bottom);
|
LineTo(DC, Rect->right, Rect->bottom - 1);
|
||||||
|
|
||||||
if (0 == MenuInfo.MenuItemCount)
|
if (0 == MenuInfo.MenuItemCount)
|
||||||
{
|
{
|
||||||
|
|
|
@ -287,6 +287,18 @@ CreateWindowExA(DWORD dwExStyle,
|
||||||
POINT mPos[2];
|
POINT mPos[2];
|
||||||
UINT id = 0;
|
UINT id = 0;
|
||||||
HWND top_child;
|
HWND top_child;
|
||||||
|
PWND WndParent;
|
||||||
|
PCLS pcls;
|
||||||
|
|
||||||
|
if(!(WndParent = ValidateHwnd(hWndParent)) ||
|
||||||
|
!(pcls = DesktopPtrToUser(WndParent->pcls)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (pcls->fnid != FNID_MDICLIENT)
|
||||||
|
{
|
||||||
|
ERR("WS_EX_MDICHILD, but parent %p is not MDIClient\n", hWndParent);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* lpParams of WM_[NC]CREATE is different for MDI children.
|
/* lpParams of WM_[NC]CREATE is different for MDI children.
|
||||||
* MDICREATESTRUCT members have the originally passed values.
|
* MDICREATESTRUCT members have the originally passed values.
|
||||||
|
@ -399,6 +411,24 @@ CreateWindowExW(DWORD dwExStyle,
|
||||||
POINT mPos[2];
|
POINT mPos[2];
|
||||||
UINT id = 0;
|
UINT id = 0;
|
||||||
HWND top_child;
|
HWND top_child;
|
||||||
|
PWND WndParent;
|
||||||
|
PCLS pcls;
|
||||||
|
|
||||||
|
WndParent = ValidateHwnd(hWndParent);
|
||||||
|
|
||||||
|
if(!WndParent)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
pcls = DesktopPtrToUser(WndParent->pcls);
|
||||||
|
|
||||||
|
if(!pcls)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (pcls->fnid != FNID_MDICLIENT)
|
||||||
|
{
|
||||||
|
ERR("WS_EX_MDICHILD, but parent %p is not MDIClient\n", hWndParent);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* lpParams of WM_[NC]CREATE is different for MDI children.
|
/* lpParams of WM_[NC]CREATE is different for MDI children.
|
||||||
* MDICREATESTRUCT members have the originally passed values.
|
* MDICREATESTRUCT members have the originally passed values.
|
||||||
|
|
|
@ -44,5 +44,5 @@ BEGIN
|
||||||
IDS_HISTORY "Lokale Einstellungen\\Verlauf"
|
IDS_HISTORY "Lokale Einstellungen\\Verlauf"
|
||||||
IDS_COOKIES "Cookies"
|
IDS_COOKIES "Cookies"
|
||||||
IDS_PROGRAMFILES "%SystemDrive%\\Programme"
|
IDS_PROGRAMFILES "%SystemDrive%\\Programme"
|
||||||
IDS_COMMONFILES "Common Files"
|
IDS_COMMONFILES "Gemeinsame Dateien"
|
||||||
END
|
END
|
||||||
|
|
|
@ -44,5 +44,5 @@ BEGIN
|
||||||
IDS_HISTORY "Local Settings\\Historique"
|
IDS_HISTORY "Local Settings\\Historique"
|
||||||
IDS_COOKIES "Cookies"
|
IDS_COOKIES "Cookies"
|
||||||
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
|
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
|
||||||
IDS_COMMONFILES "Common Files"
|
IDS_COMMONFILES "Fichiers communs"
|
||||||
END
|
END
|
||||||
|
|
|
@ -187,7 +187,7 @@ static NTSTATUS ReceiveActivity( PAFD_FCB FCB, PIRP Irp ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !FCB->Recv.Content ) {
|
if( FCB->Recv.Content ) {
|
||||||
FCB->PollState |= AFD_EVENT_RECEIVE;
|
FCB->PollState |= AFD_EVENT_RECEIVE;
|
||||||
} else
|
} else
|
||||||
FCB->PollState &= ~AFD_EVENT_RECEIVE;
|
FCB->PollState &= ~AFD_EVENT_RECEIVE;
|
||||||
|
|
|
@ -37,15 +37,15 @@
|
||||||
</if>
|
</if>
|
||||||
<if property="ARCH" value="amd64">
|
<if property="ARCH" value="amd64">
|
||||||
<define name="_X86BIOS_" />
|
<define name="_X86BIOS_" />
|
||||||
<include base="x86emu">.</include>
|
<!-- include base="x86emu">.</include -->
|
||||||
<directory name="amd64">
|
<directory name="amd64">
|
||||||
<file>x86bios.c</file>
|
<file>x86bios.c</file>
|
||||||
<file>halinit.c</file>
|
<!-- file>halinit.c</file -->
|
||||||
<file>irq.S</file>
|
<!-- file>irq.S</file -->
|
||||||
<file>misc.c</file>
|
<!-- file>misc.c</file -->
|
||||||
<file>apic.c</file>
|
<!-- file>apic.c</file -->
|
||||||
<file>systimer.S</file>
|
<file>systimer.S</file>
|
||||||
<file>usage.c</file>
|
<!-- file>usage.c</file -->
|
||||||
</directory>
|
</directory>
|
||||||
</if>
|
</if>
|
||||||
</directory>
|
</directory>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<library>hal_generic</library>
|
<library>hal_generic</library>
|
||||||
<library>hal_generic_acpi</library>
|
<library>hal_generic_acpi</library>
|
||||||
<library>ntoskrnl</library>
|
<library>ntoskrnl</library>
|
||||||
<library>x86emu</library>
|
<!-- library>x86emu</library -->
|
||||||
|
|
||||||
<directory name="generic">
|
<directory name="generic">
|
||||||
<file>spinlock.c</file>
|
<file>spinlock.c</file>
|
||||||
|
|
|
@ -478,6 +478,7 @@ Author:
|
||||||
#define FIBER_CONTEXT_ESI FIBER_CONTEXT + CONTEXT_ESI
|
#define FIBER_CONTEXT_ESI FIBER_CONTEXT + CONTEXT_ESI
|
||||||
#define FIBER_CONTEXT_EDI FIBER_CONTEXT + CONTEXT_EDI
|
#define FIBER_CONTEXT_EDI FIBER_CONTEXT + CONTEXT_EDI
|
||||||
#define FIBER_CONTEXT_EBP FIBER_CONTEXT + CONTEXT_EBP
|
#define FIBER_CONTEXT_EBP FIBER_CONTEXT + CONTEXT_EBP
|
||||||
|
#define FIBER_CONTEXT_EIP FIBER_CONTEXT + CONTEXT_EIP
|
||||||
#define FIBER_CONTEXT_ESP FIBER_CONTEXT + CONTEXT_ESP
|
#define FIBER_CONTEXT_ESP FIBER_CONTEXT + CONTEXT_ESP
|
||||||
#define FIBER_CONTEXT_DR6 FIBER_CONTEXT + CONTEXT_DR6
|
#define FIBER_CONTEXT_DR6 FIBER_CONTEXT + CONTEXT_DR6
|
||||||
#define FIBER_CONTEXT_FLOAT_SAVE_STATUS_WORD FIBER_CONTEXT + CONTEXT_FLOAT_SAVE_STATUS_WORD
|
#define FIBER_CONTEXT_FLOAT_SAVE_STATUS_WORD FIBER_CONTEXT + CONTEXT_FLOAT_SAVE_STATUS_WORD
|
||||||
|
|
|
@ -26,11 +26,14 @@
|
||||||
#define ConsoleInputUnicodeCharToAnsiChar(Console, dChar, sWChar) \
|
#define ConsoleInputUnicodeCharToAnsiChar(Console, dChar, sWChar) \
|
||||||
WideCharToMultiByte((Console)->CodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL)
|
WideCharToMultiByte((Console)->CodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL)
|
||||||
|
|
||||||
|
#define ConsoleInputAnsiCharToUnicodeChar(Console, dWChar, sChar) \
|
||||||
|
MultiByteToWideChar((Console)->CodePage, 0, (sChar), 1, (dWChar), 1)
|
||||||
|
|
||||||
#define ConsoleUnicodeCharToAnsiChar(Console, dChar, sWChar) \
|
#define ConsoleUnicodeCharToAnsiChar(Console, dChar, sWChar) \
|
||||||
WideCharToMultiByte((Console)->OutputCodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL)
|
WideCharToMultiByte((Console)->OutputCodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL)
|
||||||
|
|
||||||
#define ConsoleAnsiCharToUnicodeChar(Console, sWChar, dChar) \
|
#define ConsoleAnsiCharToUnicodeChar(Console, dWChar, sChar) \
|
||||||
MultiByteToWideChar((Console)->OutputCodePage, 0, (dChar), 1, (sWChar), 1)
|
MultiByteToWideChar((Console)->OutputCodePage, 0, (sChar), 1, (dWChar), 1)
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
@ -616,7 +619,7 @@ CSR_API(CsrReadConsole)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(Request->Data.ReadConsoleRequest.Unicode)
|
if(Request->Data.ReadConsoleRequest.Unicode)
|
||||||
UnicodeBuffer[i] = Input->InputEvent.Event.KeyEvent.uChar.AsciiChar; /* FIXME */
|
ConsoleInputAnsiCharToUnicodeChar(Console, &UnicodeBuffer[i], &Input->InputEvent.Event.KeyEvent.uChar.AsciiChar);
|
||||||
else
|
else
|
||||||
Buffer[i] = Input->InputEvent.Event.KeyEvent.uChar.AsciiChar;
|
Buffer[i] = Input->InputEvent.Event.KeyEvent.uChar.AsciiChar;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,3 +56,7 @@ RECTL_bIntersectRect(RECTL *prclDst, const RECTL *prcl1, const RECTL *prcl2);
|
||||||
VOID
|
VOID
|
||||||
FASTCALL
|
FASTCALL
|
||||||
RECTL_vMakeWellOrdered(RECTL *prcl);
|
RECTL_vMakeWellOrdered(RECTL *prcl);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
RECTL_vInflateRect(RECTL *rect, INT dx, INT dy);
|
||||||
|
|
|
@ -1296,15 +1296,6 @@ IntCleanupMenus(struct _EPROCESS *Process, PPROCESSINFO Win32Process)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID APIENTRY
|
|
||||||
co_InflateRect(RECTL *rect, int dx, int dy)
|
|
||||||
{
|
|
||||||
rect->left -= dx;
|
|
||||||
rect->top -= dy;
|
|
||||||
rect->right += dx;
|
|
||||||
rect->bottom += dy;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOLEAN APIENTRY
|
BOOLEAN APIENTRY
|
||||||
intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
|
intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
|
||||||
{
|
{
|
||||||
|
@ -1334,17 +1325,17 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
|
||||||
if (HAS_THICKFRAME( dwStyle, dwExStyle ))
|
if (HAS_THICKFRAME( dwStyle, dwExStyle ))
|
||||||
{
|
{
|
||||||
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXFRAME) and UserGetSystemMetrics(SM_CYFRAME) */
|
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXFRAME) and UserGetSystemMetrics(SM_CYFRAME) */
|
||||||
co_InflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXFRAME), -UserGetSystemMetrics(SM_CYFRAME) );
|
RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXFRAME), -UserGetSystemMetrics(SM_CYFRAME) );
|
||||||
}
|
}
|
||||||
else if (HAS_DLGFRAME( dwStyle, dwExStyle ))
|
else if (HAS_DLGFRAME( dwStyle, dwExStyle ))
|
||||||
{
|
{
|
||||||
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXDLGFRAME) and UserGetSystemMetrics(SM_CYDLGFRAME) */
|
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXDLGFRAME) and UserGetSystemMetrics(SM_CYDLGFRAME) */
|
||||||
co_InflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXDLGFRAME), -UserGetSystemMetrics(SM_CYDLGFRAME));
|
RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXDLGFRAME), -UserGetSystemMetrics(SM_CYDLGFRAME));
|
||||||
}
|
}
|
||||||
else if (HAS_THINFRAME( dwStyle, dwExStyle))
|
else if (HAS_THINFRAME( dwStyle, dwExStyle))
|
||||||
{
|
{
|
||||||
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */
|
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */
|
||||||
co_InflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER) );
|
RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We have additional border information if the window
|
/* We have additional border information if the window
|
||||||
|
@ -1355,13 +1346,13 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
|
||||||
if (dwExStyle & WS_EX_CLIENTEDGE)
|
if (dwExStyle & WS_EX_CLIENTEDGE)
|
||||||
{
|
{
|
||||||
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXEDGE) and UserGetSystemMetrics(SM_CYEDGE) */
|
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXEDGE) and UserGetSystemMetrics(SM_CYEDGE) */
|
||||||
co_InflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXEDGE), -UserGetSystemMetrics(SM_CYEDGE));
|
RECTL_vInflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXEDGE), -UserGetSystemMetrics(SM_CYEDGE));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dwExStyle & WS_EX_STATICEDGE)
|
if (dwExStyle & WS_EX_STATICEDGE)
|
||||||
{
|
{
|
||||||
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */
|
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */
|
||||||
co_InflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER));
|
RECTL_vInflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -368,7 +368,8 @@ ProcessTimers(VOID)
|
||||||
{
|
{
|
||||||
if (pTmr->cmsCountdown < 0)
|
if (pTmr->cmsCountdown < 0)
|
||||||
{
|
{
|
||||||
if (!(pTmr->flags & TMRF_READY))
|
ASSERT(pTmr->pti);
|
||||||
|
if ((!(pTmr->flags & TMRF_READY)) && (!(pTmr->pti->TIF_flags & TIF_INCLEANUP)))
|
||||||
{
|
{
|
||||||
if (pTmr->flags & TMRF_ONESHOT)
|
if (pTmr->flags & TMRF_ONESHOT)
|
||||||
pTmr->flags |= TMRF_WAITING;
|
pTmr->flags |= TMRF_WAITING;
|
||||||
|
@ -384,8 +385,8 @@ ProcessTimers(VOID)
|
||||||
// Set thread message queue for this timer.
|
// Set thread message queue for this timer.
|
||||||
if (pTmr->pti->MessageQueue)
|
if (pTmr->pti->MessageQueue)
|
||||||
{ // Wakeup thread
|
{ // Wakeup thread
|
||||||
if (pTmr->pti->MessageQueue->WakeMask & QS_POSTMESSAGE)
|
ASSERT(pTmr->pti->MessageQueue->NewMessages != NULL);
|
||||||
KeSetEvent(pTmr->pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
|
KeSetEvent(pTmr->pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1998,14 +1998,16 @@ AllocErr:
|
||||||
else
|
else
|
||||||
dwExStyle &= ~WS_EX_WINDOWEDGE;
|
dwExStyle &= ~WS_EX_WINDOWEDGE;
|
||||||
|
|
||||||
|
Wnd->style = dwStyle & ~WS_VISIBLE;
|
||||||
|
|
||||||
/* Correct the window style. */
|
/* Correct the window style. */
|
||||||
if (!(dwStyle & WS_CHILD))
|
if ((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
|
||||||
{
|
{
|
||||||
dwStyle |= WS_CLIPSIBLINGS;
|
Wnd->style |= WS_CLIPSIBLINGS;
|
||||||
DPRINT("3: Style is now %lx\n", dwStyle);
|
DPRINT("3: Style is now %lx\n", dwStyle);
|
||||||
if (!(dwStyle & WS_POPUP))
|
if (!(Wnd->style & WS_POPUP))
|
||||||
{
|
{
|
||||||
dwStyle |= WS_CAPTION;
|
Wnd->style |= WS_CAPTION;
|
||||||
Window->state |= WINDOWOBJECT_NEED_SIZE;
|
Window->state |= WINDOWOBJECT_NEED_SIZE;
|
||||||
DPRINT("4: Style is now %lx\n", dwStyle);
|
DPRINT("4: Style is now %lx\n", dwStyle);
|
||||||
}
|
}
|
||||||
|
@ -2066,7 +2068,6 @@ AllocErr:
|
||||||
Size.cy = nHeight;
|
Size.cy = nHeight;
|
||||||
|
|
||||||
Wnd->ExStyle = dwExStyle;
|
Wnd->ExStyle = dwExStyle;
|
||||||
Wnd->style = dwStyle & ~WS_VISIBLE;
|
|
||||||
|
|
||||||
/* call hook */
|
/* call hook */
|
||||||
Cs.lpCreateParams = lpParam;
|
Cs.lpCreateParams = lpParam;
|
||||||
|
@ -2099,6 +2100,8 @@ AllocErr:
|
||||||
y = Cs.y;
|
y = Cs.y;
|
||||||
nWidth = Cs.cx;
|
nWidth = Cs.cx;
|
||||||
nHeight = Cs.cy;
|
nHeight = Cs.cy;
|
||||||
|
|
||||||
|
Cs.style = dwStyle;
|
||||||
// FIXME: Need to set the Z order in the window link list if the hook callback changed it!
|
// FIXME: Need to set the Z order in the window link list if the hook callback changed it!
|
||||||
// hwndInsertAfter = CbtCreate.hwndInsertAfter;
|
// hwndInsertAfter = CbtCreate.hwndInsertAfter;
|
||||||
|
|
||||||
|
@ -2246,11 +2249,6 @@ AllocErr:
|
||||||
/* FIXME: Initialize the window menu. */
|
/* FIXME: Initialize the window menu. */
|
||||||
|
|
||||||
/* Send a NCCREATE message. */
|
/* Send a NCCREATE message. */
|
||||||
Cs.cx = Size.cx;
|
|
||||||
Cs.cy = Size.cy;
|
|
||||||
Cs.x = Pos.x;
|
|
||||||
Cs.y = Pos.y;
|
|
||||||
|
|
||||||
DPRINT("[win32k.window] IntCreateWindowEx style %d, exstyle %d, parent %d\n", Cs.style, Cs.dwExStyle, Cs.hwndParent);
|
DPRINT("[win32k.window] IntCreateWindowEx style %d, exstyle %d, parent %d\n", Cs.style, Cs.dwExStyle, Cs.hwndParent);
|
||||||
DPRINT("IntCreateWindowEx(): (%d,%d-%d,%d)\n", x, y, Size.cx, Size.cy);
|
DPRINT("IntCreateWindowEx(): (%d,%d-%d,%d)\n", x, y, Size.cx, Size.cy);
|
||||||
DPRINT("IntCreateWindowEx(): About to send NCCREATE message.\n");
|
DPRINT("IntCreateWindowEx(): About to send NCCREATE message.\n");
|
||||||
|
|
|
@ -400,36 +400,120 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
|
||||||
return(SwpFlags);
|
return(SwpFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
UserHasWindowEdge(DWORD Style, DWORD ExStyle)
|
||||||
|
{
|
||||||
|
if (Style & WS_MINIMIZE)
|
||||||
|
return TRUE;
|
||||||
|
if (ExStyle & WS_EX_DLGMODALFRAME)
|
||||||
|
return TRUE;
|
||||||
|
if (ExStyle & WS_EX_STATICEDGE)
|
||||||
|
return FALSE;
|
||||||
|
if (Style & WS_THICKFRAME)
|
||||||
|
return TRUE;
|
||||||
|
Style &= WS_CAPTION;
|
||||||
|
if (Style == WS_DLGFRAME || Style == WS_CAPTION)
|
||||||
|
return TRUE;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
UserGetWindowBorders(DWORD Style, DWORD ExStyle, SIZE *Size, BOOL WithClient)
|
||||||
|
{
|
||||||
|
DWORD Border = 0;
|
||||||
|
|
||||||
|
if (UserHasWindowEdge(Style, ExStyle))
|
||||||
|
Border += 2;
|
||||||
|
else if (ExStyle & WS_EX_STATICEDGE)
|
||||||
|
Border += 1;
|
||||||
|
if ((ExStyle & WS_EX_CLIENTEDGE) && WithClient)
|
||||||
|
Border += 2;
|
||||||
|
if (Style & WS_CAPTION || ExStyle & WS_EX_DLGMODALFRAME)
|
||||||
|
Border ++;
|
||||||
|
Size->cx = Size->cy = Border;
|
||||||
|
if ((Style & WS_THICKFRAME) && !(Style & WS_MINIMIZE))
|
||||||
|
{
|
||||||
|
Size->cx += UserGetSystemMetrics(SM_CXFRAME) - UserGetSystemMetrics(SM_CXDLGFRAME);
|
||||||
|
Size->cy += UserGetSystemMetrics(SM_CYFRAME) - UserGetSystemMetrics(SM_CYDLGFRAME);
|
||||||
|
}
|
||||||
|
Size->cx *= UserGetSystemMetrics(SM_CXBORDER);
|
||||||
|
Size->cy *= UserGetSystemMetrics(SM_CYBORDER);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI
|
||||||
|
UserAdjustWindowRectEx(LPRECT lpRect,
|
||||||
|
DWORD dwStyle,
|
||||||
|
BOOL bMenu,
|
||||||
|
DWORD dwExStyle)
|
||||||
|
{
|
||||||
|
SIZE BorderSize;
|
||||||
|
|
||||||
|
if (bMenu)
|
||||||
|
{
|
||||||
|
lpRect->top -= UserGetSystemMetrics(SM_CYMENU);
|
||||||
|
}
|
||||||
|
if ((dwStyle & WS_CAPTION) == WS_CAPTION)
|
||||||
|
{
|
||||||
|
if (dwExStyle & WS_EX_TOOLWINDOW)
|
||||||
|
lpRect->top -= UserGetSystemMetrics(SM_CYSMCAPTION);
|
||||||
|
else
|
||||||
|
lpRect->top -= UserGetSystemMetrics(SM_CYCAPTION);
|
||||||
|
}
|
||||||
|
UserGetWindowBorders(dwStyle, dwExStyle, &BorderSize, TRUE);
|
||||||
|
RECTL_vInflateRect(
|
||||||
|
lpRect,
|
||||||
|
BorderSize.cx,
|
||||||
|
BorderSize.cy);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
WinPosFillMinMaxInfoStruct(PWINDOW_OBJECT Window, MINMAXINFO *Info)
|
WinPosFillMinMaxInfoStruct(PWINDOW_OBJECT Window, MINMAXINFO *Info)
|
||||||
{
|
{
|
||||||
UINT XInc, YInc;
|
INT xinc, yinc;
|
||||||
RECTL WorkArea;
|
LONG style = Window->Wnd->style;
|
||||||
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
LONG adjustedStyle;
|
||||||
PDESKTOP Desktop = pti->rpdesk; /* Or rather get it from the window? */
|
LONG exstyle = Window->Wnd->ExStyle;
|
||||||
|
RECT rc;
|
||||||
|
|
||||||
IntGetDesktopWorkArea(Desktop, &WorkArea);
|
/* Compute default values */
|
||||||
|
|
||||||
/* Get default values. */
|
rc = Window->Wnd->rcWindow;
|
||||||
Info->ptMinTrackSize.x = UserGetSystemMetrics(SM_CXMINTRACK);
|
Info->ptReserved.x = rc.left;
|
||||||
Info->ptMinTrackSize.y = UserGetSystemMetrics(SM_CYMINTRACK);
|
Info->ptReserved.y = rc.top;
|
||||||
|
|
||||||
IntGetWindowBorderMeasures(Window, &XInc, &YInc);
|
if ((style & WS_CAPTION) == WS_CAPTION)
|
||||||
Info->ptMaxSize.x = WorkArea.right - WorkArea.left + 2 * XInc;
|
adjustedStyle = style & ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
|
||||||
Info->ptMaxSize.y = WorkArea.bottom - WorkArea.top + 2 * YInc;
|
else
|
||||||
Info->ptMaxTrackSize.x = Info->ptMaxSize.x;
|
adjustedStyle = style;
|
||||||
Info->ptMaxTrackSize.y = Info->ptMaxSize.y;
|
|
||||||
|
|
||||||
if (Window->Wnd->InternalPosInitialized)
|
if(Window->Wnd->spwndParent)
|
||||||
{
|
IntGetClientRect(Window->spwndParent, &rc);
|
||||||
Info->ptMaxPosition = Window->Wnd->InternalPos.MaxPos;
|
UserAdjustWindowRectEx(&rc, adjustedStyle, ((style & WS_POPUP) && Window->Wnd->IDMenu), exstyle);
|
||||||
}
|
|
||||||
else
|
xinc = -rc.left;
|
||||||
{
|
yinc = -rc.top;
|
||||||
Info->ptMaxPosition.x = WorkArea.left - XInc;
|
|
||||||
Info->ptMaxPosition.y = WorkArea.top - YInc;
|
Info->ptMaxSize.x = rc.right - rc.left;
|
||||||
}
|
Info->ptMaxSize.y = rc.bottom - rc.top;
|
||||||
|
if (style & (WS_DLGFRAME | WS_BORDER))
|
||||||
|
{
|
||||||
|
Info->ptMinTrackSize.x = UserGetSystemMetrics(SM_CXMINTRACK);
|
||||||
|
Info->ptMinTrackSize.y = UserGetSystemMetrics(SM_CYMINTRACK);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info->ptMinTrackSize.x = 2 * xinc;
|
||||||
|
Info->ptMinTrackSize.y = 2 * yinc;
|
||||||
|
}
|
||||||
|
Info->ptMaxTrackSize.x = UserGetSystemMetrics(SM_CXMAXTRACK);
|
||||||
|
Info->ptMaxTrackSize.y = UserGetSystemMetrics(SM_CYMAXTRACK);
|
||||||
|
Info->ptMaxPosition.x = -xinc;
|
||||||
|
Info->ptMaxPosition.y = -yinc;
|
||||||
|
|
||||||
|
//if (!EMPTYPOINT(win->max_pos)) MinMax.ptMaxPosition = win->max_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT FASTCALL
|
UINT FASTCALL
|
||||||
|
|
|
@ -102,5 +102,14 @@ RECTL_vMakeWellOrdered(RECTL *prcl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
RECTL_vInflateRect(RECTL *rect, INT dx, INT dy)
|
||||||
|
{
|
||||||
|
rect->left -= dx;
|
||||||
|
rect->top -= dy;
|
||||||
|
rect->right += dx;
|
||||||
|
rect->bottom += dy;
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue