[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/*
|
|
|
|
* Resources
|
|
|
|
*
|
|
|
|
* Copyright 1993 Robert J. Amstadt
|
|
|
|
* Copyright 1995, 2003 Alexandre Julliard
|
|
|
|
* Copyright 2006 Mike McCormack
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2000-04-14 01:50:38 +00:00
|
|
|
*
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-04-14 01:50:38 +00:00
|
|
|
*/
|
|
|
|
|
2013-12-22 18:10:41 +00:00
|
|
|
#include <k32.h>
|
|
|
|
|
|
|
|
#include <wine/list.h>
|
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
DEBUG_CHANNEL(resource);
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
/* retrieve the resource name to pass to the ntdll functions */
|
|
|
|
static NTSTATUS get_res_nameA( LPCSTR name, UNICODE_STRING *str )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (IS_INTRESOURCE(name))
|
|
|
|
{
|
|
|
|
str->Buffer = ULongToPtr(LOWORD(name));
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
if (name[0] == '#')
|
|
|
|
{
|
|
|
|
ULONG value;
|
|
|
|
if (RtlCharToInteger( name + 1, 10, &value ) != STATUS_SUCCESS || HIWORD(value))
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
str->Buffer = ULongToPtr(value);
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
RtlCreateUnicodeStringFromAsciiz( str, name );
|
|
|
|
RtlUpcaseUnicodeString( str, str, FALSE );
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/* retrieve the resource name to pass to the ntdll functions */
|
|
|
|
static NTSTATUS get_res_nameW( LPCWSTR name, UNICODE_STRING *str )
|
|
|
|
{
|
|
|
|
if (IS_INTRESOURCE(name))
|
|
|
|
{
|
|
|
|
str->Buffer = ULongToPtr(LOWORD(name));
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
if (name[0] == '#')
|
|
|
|
{
|
|
|
|
ULONG value;
|
|
|
|
RtlInitUnicodeString( str, name + 1 );
|
|
|
|
if (RtlUnicodeStringToInteger( str, 10, &value ) != STATUS_SUCCESS || HIWORD(value))
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
str->Buffer = ULongToPtr(value);
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
RtlCreateUnicodeString( str, name );
|
|
|
|
RtlUpcaseUnicodeString( str, str, FALSE );
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/* implementation of FindResourceExA */
|
|
|
|
static HRSRC find_resourceA( HMODULE hModule, LPCSTR type, LPCSTR name, WORD lang )
|
|
|
|
{
|
|
|
|
NTSTATUS status;
|
|
|
|
UNICODE_STRING nameW, typeW;
|
|
|
|
LDR_RESOURCE_INFO info;
|
2013-12-22 18:10:41 +00:00
|
|
|
IMAGE_RESOURCE_DATA_ENTRY *entry = NULL;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
nameW.Buffer = NULL;
|
|
|
|
typeW.Buffer = NULL;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
__TRY
|
|
|
|
{
|
|
|
|
if ((status = get_res_nameA( name, &nameW )) != STATUS_SUCCESS) goto done;
|
|
|
|
if ((status = get_res_nameA( type, &typeW )) != STATUS_SUCCESS) goto done;
|
|
|
|
info.Type = (ULONG_PTR)typeW.Buffer;
|
|
|
|
info.Name = (ULONG_PTR)nameW.Buffer;
|
|
|
|
info.Language = lang;
|
|
|
|
status = LdrFindResource_U( hModule, &info, 3, &entry );
|
|
|
|
done:
|
|
|
|
if (status != STATUS_SUCCESS) SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
}
|
|
|
|
__EXCEPT_PAGE_FAULT
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
}
|
|
|
|
__ENDTRY
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!IS_INTRESOURCE(nameW.Buffer)) HeapFree( GetProcessHeap(), 0, nameW.Buffer );
|
|
|
|
if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
|
|
|
|
return (HRSRC)entry;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* implementation of FindResourceExW */
|
|
|
|
static HRSRC find_resourceW( HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD lang )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
NTSTATUS status;
|
|
|
|
UNICODE_STRING nameW, typeW;
|
|
|
|
LDR_RESOURCE_INFO info;
|
2013-12-22 18:10:41 +00:00
|
|
|
IMAGE_RESOURCE_DATA_ENTRY *entry = NULL;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
nameW.Buffer = typeW.Buffer = NULL;
|
|
|
|
|
|
|
|
__TRY
|
|
|
|
{
|
|
|
|
if ((status = get_res_nameW( name, &nameW )) != STATUS_SUCCESS) goto done;
|
|
|
|
if ((status = get_res_nameW( type, &typeW )) != STATUS_SUCCESS) goto done;
|
|
|
|
info.Type = (ULONG_PTR)typeW.Buffer;
|
|
|
|
info.Name = (ULONG_PTR)nameW.Buffer;
|
|
|
|
info.Language = lang;
|
|
|
|
status = LdrFindResource_U( hModule, &info, 3, &entry );
|
|
|
|
done:
|
|
|
|
if (status != STATUS_SUCCESS) SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
}
|
|
|
|
__EXCEPT_PAGE_FAULT
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
}
|
|
|
|
__ENDTRY
|
|
|
|
|
|
|
|
if (!IS_INTRESOURCE(nameW.Buffer)) HeapFree( GetProcessHeap(), 0, nameW.Buffer );
|
|
|
|
if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
|
|
|
|
return (HRSRC)entry;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* FindResourceExA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
HRSRC WINAPI FindResourceExA( HMODULE hModule, LPCSTR type, LPCSTR name, WORD lang )
|
|
|
|
{
|
|
|
|
TRACE( "%p %s %s %04x\n", hModule, debugstr_a(type), debugstr_a(name), lang );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!hModule) hModule = GetModuleHandleW(0);
|
|
|
|
return find_resourceA( hModule, type, name, lang );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* FindResourceA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
HRSRC WINAPI FindResourceA( HMODULE hModule, LPCSTR name, LPCSTR type )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
return FindResourceExA( hModule, type, name, MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) );
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* FindResourceExW (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
HRSRC WINAPI FindResourceExW( HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD lang )
|
|
|
|
{
|
|
|
|
TRACE( "%p %s %s %04x\n", hModule, debugstr_w(type), debugstr_w(name), lang );
|
|
|
|
|
|
|
|
if (!hModule) hModule = GetModuleHandleW(0);
|
|
|
|
return find_resourceW( hModule, type, name, lang );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* FindResourceW (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
HRSRC WINAPI FindResourceW( HINSTANCE hModule, LPCWSTR name, LPCWSTR type )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
return FindResourceExW( hModule, type, name, MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) );
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* EnumResourceTypesA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumResourceTypesA( HMODULE hmod, ENUMRESTYPEPROCA lpfun, LONG_PTR lparam )
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
BOOL ret = FALSE;
|
|
|
|
LPSTR type = NULL;
|
|
|
|
DWORD len = 0, newlen;
|
|
|
|
NTSTATUS status;
|
2013-12-22 18:10:41 +00:00
|
|
|
IMAGE_RESOURCE_DIRECTORY *resdir;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
|
|
|
const IMAGE_RESOURCE_DIR_STRING_U *str;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE( "%p %p %lx\n", hmod, lpfun, lparam );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!hmod) hmod = GetModuleHandleA( NULL );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if ((status = LdrFindResourceDirectory_U( hmod, NULL, 0, &resdir )) != STATUS_SUCCESS)
|
|
|
|
{
|
|
|
|
SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
|
|
|
|
for (i = 0; i < resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries; i++)
|
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
if (et[i].NameIsString)
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const BYTE *)resdir + et[i].NameOffset);
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
newlen = WideCharToMultiByte( CP_ACP, 0, str->NameString, str->Length, NULL, 0, NULL, NULL);
|
|
|
|
if (newlen + 1 > len)
|
|
|
|
{
|
|
|
|
len = newlen + 1;
|
|
|
|
HeapFree( GetProcessHeap(), 0, type );
|
|
|
|
if (!(type = HeapAlloc( GetProcessHeap(), 0, len ))) return FALSE;
|
|
|
|
}
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, str->NameString, str->Length, type, len, NULL, NULL);
|
|
|
|
type[newlen] = 0;
|
|
|
|
ret = lpfun(hmod,type,lparam);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
ret = lpfun( hmod, UIntToPtr(et[i].Id), lparam );
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
}
|
|
|
|
if (!ret) break;
|
|
|
|
}
|
|
|
|
HeapFree( GetProcessHeap(), 0, type );
|
|
|
|
return ret;
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* EnumResourceTypesW (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumResourceTypesW( HMODULE hmod, ENUMRESTYPEPROCW lpfun, LONG_PTR lparam )
|
|
|
|
{
|
|
|
|
int i, len = 0;
|
|
|
|
BOOL ret = FALSE;
|
|
|
|
LPWSTR type = NULL;
|
|
|
|
NTSTATUS status;
|
2013-12-22 18:10:41 +00:00
|
|
|
IMAGE_RESOURCE_DIRECTORY *resdir;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
|
|
|
const IMAGE_RESOURCE_DIR_STRING_U *str;
|
|
|
|
|
|
|
|
TRACE( "%p %p %lx\n", hmod, lpfun, lparam );
|
|
|
|
|
|
|
|
if (!hmod) hmod = GetModuleHandleW( NULL );
|
|
|
|
|
|
|
|
if ((status = LdrFindResourceDirectory_U( hmod, NULL, 0, &resdir )) != STATUS_SUCCESS)
|
|
|
|
{
|
|
|
|
SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
|
|
|
|
for (i = 0; i < resdir->NumberOfNamedEntries + resdir->NumberOfIdEntries; i++)
|
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
if (et[i].NameIsString)
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const BYTE *)resdir + et[i].NameOffset);
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (str->Length + 1 > len)
|
|
|
|
{
|
|
|
|
len = str->Length + 1;
|
|
|
|
HeapFree( GetProcessHeap(), 0, type );
|
|
|
|
if (!(type = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return FALSE;
|
|
|
|
}
|
|
|
|
memcpy(type, str->NameString, str->Length * sizeof (WCHAR));
|
|
|
|
type[str->Length] = 0;
|
|
|
|
ret = lpfun(hmod,type,lparam);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
ret = lpfun( hmod, UIntToPtr(et[i].Id), lparam );
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
}
|
|
|
|
if (!ret) break;
|
|
|
|
}
|
|
|
|
HeapFree( GetProcessHeap(), 0, type );
|
|
|
|
return ret;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* EnumResourceNamesA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumResourceNamesA( HMODULE hmod, LPCSTR type, ENUMRESNAMEPROCA lpfun, LONG_PTR lparam )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
int i;
|
|
|
|
BOOL ret = FALSE;
|
|
|
|
DWORD len = 0, newlen;
|
|
|
|
LPSTR name = NULL;
|
|
|
|
NTSTATUS status;
|
|
|
|
UNICODE_STRING typeW;
|
|
|
|
LDR_RESOURCE_INFO info;
|
2013-12-22 18:10:41 +00:00
|
|
|
IMAGE_RESOURCE_DIRECTORY *basedir, *resdir;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
|
|
|
const IMAGE_RESOURCE_DIR_STRING_U *str;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE( "%p %s %p %lx\n", hmod, debugstr_a(type), lpfun, lparam );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!hmod) hmod = GetModuleHandleA( NULL );
|
|
|
|
typeW.Buffer = NULL;
|
|
|
|
if ((status = LdrFindResourceDirectory_U( hmod, NULL, 0, &basedir )) != STATUS_SUCCESS)
|
|
|
|
goto done;
|
|
|
|
if ((status = get_res_nameA( type, &typeW )) != STATUS_SUCCESS)
|
|
|
|
goto done;
|
|
|
|
info.Type = (ULONG_PTR)typeW.Buffer;
|
|
|
|
if ((status = LdrFindResourceDirectory_U( hmod, &info, 1, &resdir )) != STATUS_SUCCESS)
|
|
|
|
goto done;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
|
|
|
|
__TRY
|
|
|
|
{
|
|
|
|
for (i = 0; i < resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries; i++)
|
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
if (et[i].NameIsString)
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const BYTE *)basedir + et[i].NameOffset);
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
newlen = WideCharToMultiByte(CP_ACP, 0, str->NameString, str->Length, NULL, 0, NULL, NULL);
|
|
|
|
if (newlen + 1 > len)
|
|
|
|
{
|
|
|
|
len = newlen + 1;
|
|
|
|
HeapFree( GetProcessHeap(), 0, name );
|
|
|
|
if (!(name = HeapAlloc(GetProcessHeap(), 0, len + 1 )))
|
|
|
|
{
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, str->NameString, str->Length, name, len, NULL, NULL );
|
|
|
|
name[newlen] = 0;
|
|
|
|
ret = lpfun(hmod,type,name,lparam);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
ret = lpfun( hmod, type, UIntToPtr(et[i].Id), lparam );
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
}
|
|
|
|
if (!ret) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
__EXCEPT_PAGE_FAULT
|
|
|
|
{
|
|
|
|
ret = FALSE;
|
|
|
|
status = STATUS_ACCESS_VIOLATION;
|
|
|
|
}
|
2011-12-20 21:02:53 +00:00
|
|
|
__ENDTRY;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
done:
|
|
|
|
HeapFree( GetProcessHeap(), 0, name );
|
|
|
|
if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
|
|
|
|
if (status != STATUS_SUCCESS) SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
return ret;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* EnumResourceNamesW (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumResourceNamesW( HMODULE hmod, LPCWSTR type, ENUMRESNAMEPROCW lpfun, LONG_PTR lparam )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
int i, len = 0;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
BOOL ret = FALSE;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
LPWSTR name = NULL;
|
|
|
|
NTSTATUS status;
|
|
|
|
UNICODE_STRING typeW;
|
|
|
|
LDR_RESOURCE_INFO info;
|
2013-12-22 18:10:41 +00:00
|
|
|
IMAGE_RESOURCE_DIRECTORY *basedir, *resdir;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
|
|
|
const IMAGE_RESOURCE_DIR_STRING_U *str;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE( "%p %s %p %lx\n", hmod, debugstr_w(type), lpfun, lparam );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!hmod) hmod = GetModuleHandleW( NULL );
|
|
|
|
typeW.Buffer = NULL;
|
|
|
|
if ((status = LdrFindResourceDirectory_U( hmod, NULL, 0, &basedir )) != STATUS_SUCCESS)
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
goto done;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if ((status = get_res_nameW( type, &typeW )) != STATUS_SUCCESS)
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
goto done;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
info.Type = (ULONG_PTR)typeW.Buffer;
|
|
|
|
if ((status = LdrFindResourceDirectory_U( hmod, &info, 1, &resdir )) != STATUS_SUCCESS)
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
goto done;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
|
|
|
|
__TRY
|
|
|
|
{
|
|
|
|
for (i = 0; i < resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries; i++)
|
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
if (et[i].NameIsString)
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const BYTE *)basedir + et[i].NameOffset);
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (str->Length + 1 > len)
|
|
|
|
{
|
|
|
|
len = str->Length + 1;
|
|
|
|
HeapFree( GetProcessHeap(), 0, name );
|
|
|
|
if (!(name = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
|
|
|
|
{
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
memcpy(name, str->NameString, str->Length * sizeof (WCHAR));
|
|
|
|
name[str->Length] = 0;
|
|
|
|
ret = lpfun(hmod,type,name,lparam);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
ret = lpfun( hmod, type, UIntToPtr(et[i].Id), lparam );
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
}
|
|
|
|
if (!ret) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
__EXCEPT_PAGE_FAULT
|
|
|
|
{
|
|
|
|
ret = FALSE;
|
|
|
|
status = STATUS_ACCESS_VIOLATION;
|
|
|
|
}
|
|
|
|
__ENDTRY
|
|
|
|
done:
|
|
|
|
HeapFree( GetProcessHeap(), 0, name );
|
|
|
|
if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
|
|
|
|
if (status != STATUS_SUCCESS) SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
return ret;
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* EnumResourceLanguagesA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumResourceLanguagesA( HMODULE hmod, LPCSTR type, LPCSTR name,
|
|
|
|
ENUMRESLANGPROCA lpfun, LONG_PTR lparam )
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
BOOL ret = FALSE;
|
|
|
|
NTSTATUS status;
|
|
|
|
UNICODE_STRING typeW, nameW;
|
|
|
|
LDR_RESOURCE_INFO info;
|
2013-12-22 18:10:41 +00:00
|
|
|
IMAGE_RESOURCE_DIRECTORY *basedir, *resdir;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
|
|
|
|
|
|
|
TRACE( "%p %s %s %p %lx\n", hmod, debugstr_a(type), debugstr_a(name), lpfun, lparam );
|
|
|
|
|
|
|
|
if (!hmod) hmod = GetModuleHandleA( NULL );
|
|
|
|
typeW.Buffer = nameW.Buffer = NULL;
|
|
|
|
if ((status = LdrFindResourceDirectory_U( hmod, NULL, 0, &basedir )) != STATUS_SUCCESS)
|
|
|
|
goto done;
|
|
|
|
if ((status = get_res_nameA( type, &typeW )) != STATUS_SUCCESS)
|
|
|
|
goto done;
|
|
|
|
if ((status = get_res_nameA( name, &nameW )) != STATUS_SUCCESS)
|
|
|
|
goto done;
|
|
|
|
info.Type = (ULONG_PTR)typeW.Buffer;
|
|
|
|
info.Name = (ULONG_PTR)nameW.Buffer;
|
|
|
|
if ((status = LdrFindResourceDirectory_U( hmod, &info, 2, &resdir )) != STATUS_SUCCESS)
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
goto done;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
|
|
|
|
__TRY
|
|
|
|
{
|
|
|
|
for (i = 0; i < resdir->NumberOfNamedEntries + resdir->NumberOfIdEntries; i++)
|
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
ret = lpfun( hmod, type, name, et[i].Id, lparam );
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!ret) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
__EXCEPT_PAGE_FAULT
|
|
|
|
{
|
|
|
|
ret = FALSE;
|
|
|
|
status = STATUS_ACCESS_VIOLATION;
|
|
|
|
}
|
|
|
|
__ENDTRY
|
|
|
|
done:
|
|
|
|
if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
|
|
|
|
if (!IS_INTRESOURCE(nameW.Buffer)) HeapFree( GetProcessHeap(), 0, nameW.Buffer );
|
|
|
|
if (status != STATUS_SUCCESS) SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* EnumResourceLanguagesW (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumResourceLanguagesW( HMODULE hmod, LPCWSTR type, LPCWSTR name,
|
|
|
|
ENUMRESLANGPROCW lpfun, LONG_PTR lparam )
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
BOOL ret = FALSE;
|
|
|
|
NTSTATUS status;
|
|
|
|
UNICODE_STRING typeW, nameW;
|
|
|
|
LDR_RESOURCE_INFO info;
|
2013-12-22 18:10:41 +00:00
|
|
|
IMAGE_RESOURCE_DIRECTORY *basedir, *resdir;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
|
|
|
|
|
|
|
TRACE( "%p %s %s %p %lx\n", hmod, debugstr_w(type), debugstr_w(name), lpfun, lparam );
|
|
|
|
|
|
|
|
if (!hmod) hmod = GetModuleHandleW( NULL );
|
|
|
|
typeW.Buffer = nameW.Buffer = NULL;
|
|
|
|
if ((status = LdrFindResourceDirectory_U( hmod, NULL, 0, &basedir )) != STATUS_SUCCESS)
|
|
|
|
goto done;
|
|
|
|
if ((status = get_res_nameW( type, &typeW )) != STATUS_SUCCESS)
|
|
|
|
goto done;
|
|
|
|
if ((status = get_res_nameW( name, &nameW )) != STATUS_SUCCESS)
|
|
|
|
goto done;
|
|
|
|
info.Type = (ULONG_PTR)typeW.Buffer;
|
|
|
|
info.Name = (ULONG_PTR)nameW.Buffer;
|
|
|
|
if ((status = LdrFindResourceDirectory_U( hmod, &info, 2, &resdir )) != STATUS_SUCCESS)
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
et = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(resdir + 1);
|
|
|
|
__TRY
|
|
|
|
{
|
|
|
|
for (i = 0; i < resdir->NumberOfNamedEntries + resdir->NumberOfIdEntries; i++)
|
|
|
|
{
|
2013-12-22 18:10:41 +00:00
|
|
|
ret = lpfun( hmod, type, name, et[i].Id, lparam );
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!ret) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
__EXCEPT_PAGE_FAULT
|
|
|
|
{
|
|
|
|
ret = FALSE;
|
|
|
|
status = STATUS_ACCESS_VIOLATION;
|
|
|
|
}
|
|
|
|
__ENDTRY
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
done:
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!IS_INTRESOURCE(typeW.Buffer)) HeapFree( GetProcessHeap(), 0, typeW.Buffer );
|
|
|
|
if (!IS_INTRESOURCE(nameW.Buffer)) HeapFree( GetProcessHeap(), 0, nameW.Buffer );
|
|
|
|
if (status != STATUS_SUCCESS) SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
return ret;
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* LoadResource (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
HGLOBAL WINAPI LoadResource( HINSTANCE hModule, HRSRC hRsrc )
|
|
|
|
{
|
|
|
|
NTSTATUS status;
|
|
|
|
void *ret = NULL;
|
|
|
|
|
|
|
|
TRACE( "%p %p\n", hModule, hRsrc );
|
|
|
|
|
|
|
|
if (!hRsrc) return 0;
|
|
|
|
if (!hModule) hModule = GetModuleHandleA( NULL );
|
|
|
|
status = LdrAccessResource( hModule, (IMAGE_RESOURCE_DATA_ENTRY *)hRsrc, &ret, NULL );
|
|
|
|
if (status != STATUS_SUCCESS) SetLastError( RtlNtStatusToDosError(status) );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* LockResource (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
LPVOID WINAPI LockResource( HGLOBAL handle )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
return handle;
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* FreeResource (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI FreeResource( HGLOBAL handle )
|
|
|
|
{
|
2015-11-27 18:49:07 +00:00
|
|
|
return FALSE;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* SizeofResource (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI SizeofResource( HINSTANCE hModule, HRSRC hRsrc )
|
|
|
|
{
|
|
|
|
if (!hRsrc) return 0;
|
|
|
|
return ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->Size;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Data structure for updating resources.
|
|
|
|
* Type/Name/Language is a keyset for accessing resource data.
|
|
|
|
*
|
|
|
|
* QUEUEDUPDATES (root) ->
|
|
|
|
* list of struct resource_dir_entry (Type) ->
|
|
|
|
* list of struct resource_dir_entry (Name) ->
|
|
|
|
* list of struct resource_data Language + Data
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
LPWSTR pFileName;
|
|
|
|
BOOL bDeleteExistingResources;
|
|
|
|
struct list root;
|
|
|
|
} QUEUEDUPDATES;
|
|
|
|
|
|
|
|
/* this structure is shared for types and names */
|
|
|
|
struct resource_dir_entry {
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR id;
|
|
|
|
struct list children;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* this structure is the leaf */
|
|
|
|
struct resource_data {
|
|
|
|
struct list entry;
|
|
|
|
LANGID lang;
|
|
|
|
DWORD codepage;
|
|
|
|
DWORD cbData;
|
|
|
|
void *lpData;
|
|
|
|
};
|
|
|
|
|
|
|
|
static int resource_strcmp( LPCWSTR a, LPCWSTR b )
|
|
|
|
{
|
|
|
|
if ( a == b )
|
|
|
|
return 0;
|
|
|
|
if (!IS_INTRESOURCE( a ) && !IS_INTRESOURCE( b ) )
|
|
|
|
return lstrcmpW( a, b );
|
|
|
|
/* strings come before ids */
|
|
|
|
if (!IS_INTRESOURCE( a ) && IS_INTRESOURCE( b ))
|
|
|
|
return -1;
|
|
|
|
if (!IS_INTRESOURCE( b ) && IS_INTRESOURCE( a ))
|
|
|
|
return 1;
|
|
|
|
return ( a < b ) ? -1 : 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct resource_dir_entry *find_resource_dir_entry( struct list *dir, LPCWSTR id )
|
|
|
|
{
|
|
|
|
struct resource_dir_entry *ent;
|
|
|
|
|
|
|
|
/* match either IDs or strings */
|
|
|
|
LIST_FOR_EACH_ENTRY( ent, dir, struct resource_dir_entry, entry )
|
|
|
|
if (!resource_strcmp( id, ent->id ))
|
|
|
|
return ent;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct resource_data *find_resource_data( struct list *dir, LANGID lang )
|
|
|
|
{
|
|
|
|
struct resource_data *res_data;
|
|
|
|
|
|
|
|
/* match only languages here */
|
|
|
|
LIST_FOR_EACH_ENTRY( res_data, dir, struct resource_data, entry )
|
|
|
|
if ( lang == res_data->lang )
|
|
|
|
return res_data;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
return NULL;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void add_resource_dir_entry( struct list *dir, struct resource_dir_entry *resdir )
|
|
|
|
{
|
|
|
|
struct resource_dir_entry *ent;
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY( ent, dir, struct resource_dir_entry, entry )
|
|
|
|
{
|
|
|
|
if (0>resource_strcmp( ent->id, resdir->id ))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
list_add_before( &ent->entry, &resdir->entry );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
list_add_tail( dir, &resdir->entry );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void add_resource_data_entry( struct list *dir, struct resource_data *resdata )
|
|
|
|
{
|
|
|
|
struct resource_data *ent;
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY( ent, dir, struct resource_data, entry )
|
|
|
|
{
|
|
|
|
if (ent->lang < resdata->lang)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
list_add_before( &ent->entry, &resdata->entry );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
list_add_tail( dir, &resdata->entry );
|
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
static LPWSTR res_strdupW( LPCWSTR str )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
LPWSTR ret;
|
|
|
|
UINT len;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (IS_INTRESOURCE(str))
|
|
|
|
return (LPWSTR) (UINT_PTR) LOWORD(str);
|
|
|
|
len = (lstrlenW( str ) + 1) * sizeof (WCHAR);
|
|
|
|
ret = HeapAlloc( GetProcessHeap(), 0, len );
|
|
|
|
memcpy( ret, str, len );
|
|
|
|
return ret;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
static void res_free_str( LPWSTR str )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!IS_INTRESOURCE(str))
|
|
|
|
HeapFree( GetProcessHeap(), 0, str );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL update_add_resource( QUEUEDUPDATES *updates, LPCWSTR Type, LPCWSTR Name,
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
LANGID Lang, struct resource_data *resdata,
|
|
|
|
BOOL overwrite_existing )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
|
|
|
struct resource_dir_entry *restype, *resname;
|
|
|
|
struct resource_data *existing;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("%p %s %s %p %d\n", updates,
|
|
|
|
debugstr_w(Type), debugstr_w(Name), resdata, overwrite_existing );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
restype = find_resource_dir_entry( &updates->root, Type );
|
|
|
|
if (!restype)
|
|
|
|
{
|
|
|
|
restype = HeapAlloc( GetProcessHeap(), 0, sizeof *restype );
|
|
|
|
restype->id = res_strdupW( Type );
|
|
|
|
list_init( &restype->children );
|
|
|
|
add_resource_dir_entry( &updates->root, restype );
|
|
|
|
}
|
|
|
|
|
|
|
|
resname = find_resource_dir_entry( &restype->children, Name );
|
|
|
|
if (!resname)
|
|
|
|
{
|
|
|
|
resname = HeapAlloc( GetProcessHeap(), 0, sizeof *resname );
|
|
|
|
resname->id = res_strdupW( Name );
|
|
|
|
list_init( &resname->children );
|
|
|
|
add_resource_dir_entry( &restype->children, resname );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If there's an existing resource entry with matching (Type,Name,Language)
|
|
|
|
* it needs to be removed before adding the new data.
|
|
|
|
*/
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
existing = find_resource_data( &resname->children, Lang );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
if (existing)
|
|
|
|
{
|
|
|
|
if (!overwrite_existing)
|
2009-12-23 11:13:35 +00:00
|
|
|
return FALSE;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
list_remove( &existing->entry );
|
|
|
|
HeapFree( GetProcessHeap(), 0, existing );
|
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (resdata)
|
|
|
|
add_resource_data_entry( &resname->children, resdata );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
static struct resource_data *allocate_resource_data( WORD Language, DWORD codepage,
|
|
|
|
LPVOID lpData, DWORD cbData, BOOL copy_data )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
struct resource_data *resdata;
|
|
|
|
|
|
|
|
if (!lpData || !cbData)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
resdata = HeapAlloc( GetProcessHeap(), 0, sizeof *resdata + (copy_data ? cbData : 0) );
|
|
|
|
if (resdata)
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
resdata->lang = Language;
|
|
|
|
resdata->codepage = codepage;
|
|
|
|
resdata->cbData = cbData;
|
|
|
|
if (copy_data)
|
|
|
|
{
|
|
|
|
resdata->lpData = &resdata[1];
|
|
|
|
memcpy( resdata->lpData, lpData, cbData );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
resdata->lpData = lpData;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
return resdata;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
static void free_resource_directory( struct list *head, int level )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
struct list *ptr = NULL;
|
|
|
|
|
|
|
|
while ((ptr = list_head( head )))
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
list_remove( ptr );
|
|
|
|
if (level)
|
|
|
|
{
|
|
|
|
struct resource_dir_entry *ent;
|
|
|
|
|
|
|
|
ent = LIST_ENTRY( ptr, struct resource_dir_entry, entry );
|
|
|
|
res_free_str( ent->id );
|
|
|
|
free_resource_directory( &ent->children, level - 1 );
|
|
|
|
HeapFree(GetProcessHeap(), 0, ent);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
struct resource_data *data;
|
|
|
|
|
|
|
|
data = LIST_ENTRY( ptr, struct resource_data, entry );
|
|
|
|
HeapFree( GetProcessHeap(), 0, data );
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
static IMAGE_NT_HEADERS *get_nt_header( void *base, DWORD mapping_size )
|
|
|
|
{
|
|
|
|
IMAGE_NT_HEADERS *nt;
|
|
|
|
IMAGE_DOS_HEADER *dos;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (mapping_size<sizeof (*dos))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
dos = base;
|
|
|
|
if (dos->e_magic != IMAGE_DOS_SIGNATURE)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if ((dos->e_lfanew + sizeof (*nt)) > mapping_size)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
nt = (void*) ((BYTE*)base + dos->e_lfanew);
|
|
|
|
|
|
|
|
if (nt->Signature != IMAGE_NT_SIGNATURE)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return nt;
|
|
|
|
}
|
|
|
|
|
|
|
|
static IMAGE_SECTION_HEADER *get_section_header( void *base, DWORD mapping_size, DWORD *num_sections )
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
|
|
|
IMAGE_NT_HEADERS *nt;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
DWORD section_ofs;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
nt = get_nt_header( base, mapping_size );
|
|
|
|
if (!nt)
|
|
|
|
return NULL;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/* check that we don't go over the end of the file accessing the sections */
|
|
|
|
section_ofs = FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + nt->FileHeader.SizeOfOptionalHeader;
|
2013-05-09 21:01:41 +00:00
|
|
|
if ((nt->FileHeader.NumberOfSections * sizeof (IMAGE_SECTION_HEADER) + section_ofs) > mapping_size)
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (num_sections)
|
|
|
|
*num_sections = nt->FileHeader.NumberOfSections;
|
|
|
|
|
|
|
|
/* from here we have a valid PE exe to update */
|
|
|
|
return (void*) ((BYTE*)nt + section_ofs);
|
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL check_pe_exe( HANDLE file, QUEUEDUPDATES *updates )
|
|
|
|
{
|
2015-11-27 18:49:07 +00:00
|
|
|
const IMAGE_NT_HEADERS32 *nt;
|
|
|
|
const IMAGE_NT_HEADERS64 *nt64;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
const IMAGE_SECTION_HEADER *sec;
|
2015-11-27 18:49:07 +00:00
|
|
|
const IMAGE_DATA_DIRECTORY *dd;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
BOOL ret = FALSE;
|
|
|
|
HANDLE mapping;
|
|
|
|
DWORD mapping_size, num_sections = 0;
|
|
|
|
void *base = NULL;
|
|
|
|
|
|
|
|
mapping_size = GetFileSize( file, NULL );
|
|
|
|
|
|
|
|
mapping = CreateFileMappingW( file, NULL, PAGE_READONLY, 0, 0, NULL );
|
|
|
|
if (!mapping)
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
base = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, mapping_size );
|
|
|
|
if (!base)
|
|
|
|
goto done;
|
|
|
|
|
2015-11-27 18:49:07 +00:00
|
|
|
nt = (IMAGE_NT_HEADERS32 *)get_nt_header( base, mapping_size );
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!nt)
|
|
|
|
goto done;
|
|
|
|
|
2015-11-27 18:49:07 +00:00
|
|
|
nt64 = (IMAGE_NT_HEADERS64*)nt;
|
|
|
|
dd = &nt->OptionalHeader.DataDirectory[0];
|
|
|
|
if (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
|
|
|
|
dd = &nt64->OptionalHeader.DataDirectory[0];
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("resources: %08x %08x\n",
|
2015-11-27 18:49:07 +00:00
|
|
|
dd[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress,
|
|
|
|
dd[IMAGE_DIRECTORY_ENTRY_RESOURCE].Size);
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
sec = get_section_header( base, mapping_size, &num_sections );
|
|
|
|
if (!sec)
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
goto done;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
ret = TRUE;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
done:
|
|
|
|
if (base)
|
|
|
|
UnmapViewOfFile( base );
|
|
|
|
if (mapping)
|
|
|
|
CloseHandle( mapping );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
return ret;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
struct resource_size_info {
|
|
|
|
DWORD types_ofs;
|
|
|
|
DWORD names_ofs;
|
|
|
|
DWORD langs_ofs;
|
|
|
|
DWORD data_entry_ofs;
|
|
|
|
DWORD strings_ofs;
|
|
|
|
DWORD data_ofs;
|
|
|
|
DWORD total_size;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct mapping_info {
|
|
|
|
HANDLE file;
|
|
|
|
void *base;
|
|
|
|
DWORD size;
|
|
|
|
BOOL read_write;
|
|
|
|
};
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
static const IMAGE_SECTION_HEADER *section_from_rva( void *base, DWORD mapping_size, DWORD rva )
|
|
|
|
{
|
|
|
|
const IMAGE_SECTION_HEADER *sec;
|
|
|
|
DWORD num_sections = 0;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
sec = get_section_header( base, mapping_size, &num_sections );
|
|
|
|
if (!sec)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
for (i=num_sections-1; i>=0; i--)
|
|
|
|
{
|
|
|
|
if (sec[i].VirtualAddress <= rva &&
|
|
|
|
rva <= (DWORD)sec[i].VirtualAddress + sec[i].SizeOfRawData)
|
|
|
|
{
|
|
|
|
return &sec[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *address_from_rva( void *base, DWORD mapping_size, DWORD rva, DWORD len )
|
|
|
|
{
|
|
|
|
const IMAGE_SECTION_HEADER *sec;
|
|
|
|
|
|
|
|
sec = section_from_rva( base, mapping_size, rva );
|
|
|
|
if (!sec)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (rva + len <= (DWORD)sec->VirtualAddress + sec->SizeOfRawData)
|
|
|
|
return (void*)((LPBYTE) base + (sec->PointerToRawData + rva - sec->VirtualAddress));
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static LPWSTR resource_dup_string( const IMAGE_RESOURCE_DIRECTORY *root, const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry )
|
|
|
|
{
|
|
|
|
const IMAGE_RESOURCE_DIR_STRING_U* string;
|
|
|
|
LPWSTR s;
|
|
|
|
|
2013-12-22 18:10:41 +00:00
|
|
|
if (!entry->NameIsString)
|
|
|
|
return UIntToPtr(entry->Id);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
2013-12-22 18:10:41 +00:00
|
|
|
string = (const IMAGE_RESOURCE_DIR_STRING_U*) (((const char *)root) + entry->NameOffset);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
s = HeapAlloc(GetProcessHeap(), 0, (string->Length + 1)*sizeof (WCHAR) );
|
|
|
|
memcpy( s, string->NameString, (string->Length + 1)*sizeof (WCHAR) );
|
|
|
|
s[string->Length] = 0;
|
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* this function is based on the code in winedump's pe.c */
|
|
|
|
static BOOL enumerate_mapped_resources( QUEUEDUPDATES *updates,
|
|
|
|
void *base, DWORD mapping_size,
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY *root )
|
|
|
|
{
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY *namedir, *langdir;
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *e1, *e2, *e3;
|
|
|
|
const IMAGE_RESOURCE_DATA_ENTRY *data;
|
|
|
|
DWORD i, j, k;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("version (%d.%d) %d named %d id entries\n",
|
|
|
|
root->MajorVersion, root->MinorVersion, root->NumberOfNamedEntries, root->NumberOfIdEntries);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
for (i = 0; i< root->NumberOfNamedEntries + root->NumberOfIdEntries; i++)
|
|
|
|
{
|
|
|
|
LPWSTR Type;
|
|
|
|
|
|
|
|
e1 = (const IMAGE_RESOURCE_DIRECTORY_ENTRY*)(root + 1) + i;
|
|
|
|
|
|
|
|
Type = resource_dup_string( root, e1 );
|
|
|
|
|
2013-12-22 18:10:41 +00:00
|
|
|
namedir = (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + e1->OffsetToDirectory);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
for (j = 0; j < namedir->NumberOfNamedEntries + namedir->NumberOfIdEntries; j++)
|
|
|
|
{
|
|
|
|
LPWSTR Name;
|
|
|
|
|
|
|
|
e2 = (const IMAGE_RESOURCE_DIRECTORY_ENTRY*)(namedir + 1) + j;
|
|
|
|
|
|
|
|
Name = resource_dup_string( root, e2 );
|
|
|
|
|
2013-12-22 18:10:41 +00:00
|
|
|
langdir = (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + e2->OffsetToDirectory);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
for (k = 0; k < langdir->NumberOfNamedEntries + langdir->NumberOfIdEntries; k++)
|
|
|
|
{
|
|
|
|
LANGID Lang;
|
|
|
|
void *p;
|
|
|
|
struct resource_data *resdata;
|
|
|
|
|
|
|
|
e3 = (const IMAGE_RESOURCE_DIRECTORY_ENTRY*)(langdir + 1) + k;
|
|
|
|
|
2013-12-22 18:10:41 +00:00
|
|
|
Lang = e3->Id;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
2013-12-22 18:10:41 +00:00
|
|
|
data = (const IMAGE_RESOURCE_DATA_ENTRY *)((const char *)root + e3->OffsetToData);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
p = address_from_rva( base, mapping_size, data->OffsetToData, data->Size );
|
|
|
|
|
|
|
|
resdata = allocate_resource_data( Lang, data->CodePage, p, data->Size, FALSE );
|
|
|
|
if (resdata)
|
2009-12-23 11:13:35 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!update_add_resource( updates, Type, Name, Lang, resdata, FALSE ))
|
2009-12-23 11:13:35 +00:00
|
|
|
HeapFree( GetProcessHeap(), 0, resdata );
|
|
|
|
}
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
res_free_str( Name );
|
|
|
|
}
|
|
|
|
res_free_str( Type );
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL read_mapped_resources( QUEUEDUPDATES *updates, void *base, DWORD mapping_size )
|
|
|
|
{
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY *root;
|
|
|
|
const IMAGE_NT_HEADERS *nt;
|
|
|
|
const IMAGE_SECTION_HEADER *sec;
|
|
|
|
DWORD num_sections = 0, i;
|
|
|
|
|
|
|
|
nt = get_nt_header( base, mapping_size );
|
|
|
|
if (!nt)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
sec = get_section_header( base, mapping_size, &num_sections );
|
|
|
|
if (!sec)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
for (i=0; i<num_sections; i++)
|
|
|
|
if (!memcmp(sec[i].Name, ".rsrc", 6))
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (i == num_sections)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* check the resource data is inside the mapping */
|
|
|
|
if (sec[i].PointerToRawData > mapping_size ||
|
|
|
|
(sec[i].PointerToRawData + sec[i].SizeOfRawData) > mapping_size)
|
|
|
|
return TRUE;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("found .rsrc at %08x, size %08x\n", sec[i].PointerToRawData, sec[i].SizeOfRawData);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
2009-09-26 05:25:52 +00:00
|
|
|
if (!sec[i].PointerToRawData || sec[i].SizeOfRawData < sizeof(IMAGE_RESOURCE_DIRECTORY))
|
|
|
|
return TRUE;
|
|
|
|
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
root = (void*) ((BYTE*)base + sec[i].PointerToRawData);
|
|
|
|
enumerate_mapped_resources( updates, base, mapping_size, root );
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL map_file_into_memory( struct mapping_info *mi )
|
|
|
|
{
|
|
|
|
DWORD page_attr, perm;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
HANDLE mapping;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
if (mi->read_write)
|
|
|
|
{
|
|
|
|
page_attr = PAGE_READWRITE;
|
|
|
|
perm = FILE_MAP_WRITE | FILE_MAP_READ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
page_attr = PAGE_READONLY;
|
|
|
|
perm = FILE_MAP_READ;
|
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
mapping = CreateFileMappingW( mi->file, NULL, page_attr, 0, 0, NULL );
|
|
|
|
if (!mapping) return FALSE;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
mi->base = MapViewOfFile( mapping, perm, 0, 0, mi->size );
|
|
|
|
CloseHandle( mapping );
|
|
|
|
|
|
|
|
return mi->base != NULL;
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
static BOOL unmap_file_from_memory( struct mapping_info *mi )
|
|
|
|
{
|
|
|
|
if (mi->base)
|
|
|
|
UnmapViewOfFile( mi->base );
|
|
|
|
mi->base = NULL;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
static void destroy_mapping( struct mapping_info *mi )
|
|
|
|
{
|
|
|
|
if (!mi)
|
|
|
|
return;
|
|
|
|
unmap_file_from_memory( mi );
|
|
|
|
if (mi->file)
|
|
|
|
CloseHandle( mi->file );
|
|
|
|
HeapFree( GetProcessHeap(), 0, mi );
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
static struct mapping_info *create_mapping( LPCWSTR name, BOOL rw )
|
|
|
|
{
|
|
|
|
struct mapping_info *mi;
|
|
|
|
|
|
|
|
mi = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof *mi );
|
|
|
|
if (!mi)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
mi->read_write = rw;
|
|
|
|
|
|
|
|
mi->file = CreateFileW( name, GENERIC_READ | (rw ? GENERIC_WRITE : 0),
|
|
|
|
0, NULL, OPEN_EXISTING, 0, 0 );
|
|
|
|
|
|
|
|
if (mi->file != INVALID_HANDLE_VALUE)
|
|
|
|
{
|
|
|
|
mi->size = GetFileSize( mi->file, NULL );
|
|
|
|
|
|
|
|
if (map_file_into_memory( mi ))
|
|
|
|
return mi;
|
|
|
|
}
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
destroy_mapping( mi );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
static BOOL resize_mapping( struct mapping_info *mi, DWORD new_size )
|
|
|
|
{
|
|
|
|
if (!unmap_file_from_memory( mi ))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* change the file size */
|
|
|
|
SetFilePointer( mi->file, new_size, NULL, FILE_BEGIN );
|
|
|
|
if (!SetEndOfFile( mi->file ))
|
|
|
|
{
|
|
|
|
ERR("failed to set file size to %08x\n", new_size );
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
mi->size = new_size;
|
|
|
|
|
|
|
|
return map_file_into_memory( mi );
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
static void get_resource_sizes( QUEUEDUPDATES *updates, struct resource_size_info *si )
|
|
|
|
{
|
|
|
|
struct resource_dir_entry *types, *names;
|
|
|
|
struct resource_data *data;
|
|
|
|
DWORD num_types = 0, num_names = 0, num_langs = 0, strings_size = 0, data_size = 0;
|
|
|
|
|
|
|
|
memset( si, 0, sizeof *si );
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY( types, &updates->root, struct resource_dir_entry, entry )
|
|
|
|
{
|
|
|
|
num_types++;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!IS_INTRESOURCE( types->id ))
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
strings_size += sizeof (WORD) + lstrlenW( types->id )*sizeof (WCHAR);
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY( names, &types->children, struct resource_dir_entry, entry )
|
|
|
|
{
|
|
|
|
num_names++;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!IS_INTRESOURCE( names->id ))
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
strings_size += sizeof (WORD) + lstrlenW( names->id )*sizeof (WCHAR);
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY( data, &names->children, struct resource_data, entry )
|
|
|
|
{
|
|
|
|
num_langs++;
|
|
|
|
data_size += (data->cbData + 3) & ~3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* names are at the end of the types */
|
|
|
|
si->names_ofs = sizeof (IMAGE_RESOURCE_DIRECTORY) +
|
|
|
|
num_types * sizeof (IMAGE_RESOURCE_DIRECTORY_ENTRY);
|
|
|
|
|
|
|
|
/* language directories are at the end of the names */
|
|
|
|
si->langs_ofs = si->names_ofs +
|
|
|
|
num_types * sizeof (IMAGE_RESOURCE_DIRECTORY) +
|
|
|
|
num_names * sizeof (IMAGE_RESOURCE_DIRECTORY_ENTRY);
|
|
|
|
|
|
|
|
si->data_entry_ofs = si->langs_ofs +
|
|
|
|
num_names * sizeof (IMAGE_RESOURCE_DIRECTORY) +
|
|
|
|
num_langs * sizeof (IMAGE_RESOURCE_DIRECTORY_ENTRY);
|
|
|
|
|
|
|
|
si->strings_ofs = si->data_entry_ofs +
|
|
|
|
num_langs * sizeof (IMAGE_RESOURCE_DATA_ENTRY);
|
|
|
|
|
|
|
|
si->data_ofs = si->strings_ofs + ((strings_size + 3) & ~3);
|
|
|
|
|
|
|
|
si->total_size = si->data_ofs + data_size;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("names %08x langs %08x data entries %08x strings %08x data %08x total %08x\n",
|
|
|
|
si->names_ofs, si->langs_ofs, si->data_entry_ofs,
|
|
|
|
si->strings_ofs, si->data_ofs, si->total_size);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void res_write_padding( BYTE *res_base, DWORD size )
|
|
|
|
{
|
|
|
|
static const BYTE pad[] = {
|
|
|
|
'P','A','D','D','I','N','G','X','X','P','A','D','D','I','N','G' };
|
|
|
|
DWORD i;
|
|
|
|
|
|
|
|
for ( i = 0; i < size / sizeof pad; i++ )
|
|
|
|
memcpy( &res_base[i*sizeof pad], pad, sizeof pad );
|
|
|
|
memcpy( &res_base[i*sizeof pad], pad, size%sizeof pad );
|
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL write_resources( QUEUEDUPDATES *updates, LPBYTE base, struct resource_size_info *si, DWORD rva )
|
|
|
|
{
|
|
|
|
struct resource_dir_entry *types, *names;
|
|
|
|
struct resource_data *data;
|
|
|
|
IMAGE_RESOURCE_DIRECTORY *root;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("%p %p %p %08x\n", updates, base, si, rva );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
memset( base, 0, si->total_size );
|
|
|
|
|
|
|
|
/* the root entry always exists */
|
|
|
|
root = (IMAGE_RESOURCE_DIRECTORY*) base;
|
|
|
|
memset( root, 0, sizeof *root );
|
|
|
|
root->MajorVersion = 4;
|
|
|
|
si->types_ofs = sizeof *root;
|
|
|
|
LIST_FOR_EACH_ENTRY( types, &updates->root, struct resource_dir_entry, entry )
|
|
|
|
{
|
|
|
|
IMAGE_RESOURCE_DIRECTORY_ENTRY *e1;
|
|
|
|
IMAGE_RESOURCE_DIRECTORY *namedir;
|
|
|
|
|
|
|
|
e1 = (IMAGE_RESOURCE_DIRECTORY_ENTRY*) &base[si->types_ofs];
|
|
|
|
memset( e1, 0, sizeof *e1 );
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!IS_INTRESOURCE( types->id ))
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
|
|
|
WCHAR *strings;
|
|
|
|
DWORD len;
|
|
|
|
|
|
|
|
root->NumberOfNamedEntries++;
|
2013-12-22 18:10:41 +00:00
|
|
|
e1->NameIsString = 1;
|
|
|
|
e1->NameOffset = si->strings_ofs;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
strings = (WCHAR*) &base[si->strings_ofs];
|
|
|
|
len = lstrlenW( types->id );
|
|
|
|
strings[0] = len;
|
|
|
|
memcpy( &strings[1], types->id, len * sizeof (WCHAR) );
|
|
|
|
si->strings_ofs += (len + 1) * sizeof (WCHAR);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
root->NumberOfIdEntries++;
|
2013-12-22 18:10:41 +00:00
|
|
|
e1->Id = LOWORD( types->id );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
2013-12-22 18:10:41 +00:00
|
|
|
e1->OffsetToDirectory = si->names_ofs;
|
|
|
|
e1->DataIsDirectory = TRUE;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
si->types_ofs += sizeof (IMAGE_RESOURCE_DIRECTORY_ENTRY);
|
|
|
|
|
|
|
|
namedir = (IMAGE_RESOURCE_DIRECTORY*) &base[si->names_ofs];
|
|
|
|
memset( namedir, 0, sizeof *namedir );
|
|
|
|
namedir->MajorVersion = 4;
|
|
|
|
si->names_ofs += sizeof (IMAGE_RESOURCE_DIRECTORY);
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY( names, &types->children, struct resource_dir_entry, entry )
|
|
|
|
{
|
|
|
|
IMAGE_RESOURCE_DIRECTORY_ENTRY *e2;
|
|
|
|
IMAGE_RESOURCE_DIRECTORY *langdir;
|
|
|
|
|
|
|
|
e2 = (IMAGE_RESOURCE_DIRECTORY_ENTRY*) &base[si->names_ofs];
|
|
|
|
memset( e2, 0, sizeof *e2 );
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!IS_INTRESOURCE( names->id ))
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
|
|
|
WCHAR *strings;
|
|
|
|
DWORD len;
|
|
|
|
|
|
|
|
namedir->NumberOfNamedEntries++;
|
2013-12-22 18:10:41 +00:00
|
|
|
e2->NameIsString = 1;
|
|
|
|
e2->NameOffset = si->strings_ofs;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
strings = (WCHAR*) &base[si->strings_ofs];
|
|
|
|
len = lstrlenW( names->id );
|
|
|
|
strings[0] = len;
|
|
|
|
memcpy( &strings[1], names->id, len * sizeof (WCHAR) );
|
|
|
|
si->strings_ofs += (len + 1) * sizeof (WCHAR);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
namedir->NumberOfIdEntries++;
|
2013-12-22 18:10:41 +00:00
|
|
|
e2->Id = LOWORD( names->id );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
2013-12-22 18:10:41 +00:00
|
|
|
e2->OffsetToDirectory = si->langs_ofs;
|
|
|
|
e2->DataIsDirectory = TRUE;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
si->names_ofs += sizeof (IMAGE_RESOURCE_DIRECTORY_ENTRY);
|
|
|
|
|
|
|
|
langdir = (IMAGE_RESOURCE_DIRECTORY*) &base[si->langs_ofs];
|
|
|
|
memset( langdir, 0, sizeof *langdir );
|
|
|
|
langdir->MajorVersion = 4;
|
|
|
|
si->langs_ofs += sizeof (IMAGE_RESOURCE_DIRECTORY);
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY( data, &names->children, struct resource_data, entry )
|
|
|
|
{
|
|
|
|
IMAGE_RESOURCE_DIRECTORY_ENTRY *e3;
|
|
|
|
IMAGE_RESOURCE_DATA_ENTRY *de;
|
|
|
|
int pad_size;
|
|
|
|
|
|
|
|
e3 = (IMAGE_RESOURCE_DIRECTORY_ENTRY*) &base[si->langs_ofs];
|
|
|
|
memset( e3, 0, sizeof *e3 );
|
|
|
|
langdir->NumberOfIdEntries++;
|
2013-12-22 18:10:41 +00:00
|
|
|
e3->Id = LOWORD( data->lang );
|
|
|
|
e3->OffsetToData = si->data_entry_ofs;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
si->langs_ofs += sizeof (IMAGE_RESOURCE_DIRECTORY_ENTRY);
|
|
|
|
|
|
|
|
/* write out all the data entries */
|
|
|
|
de = (IMAGE_RESOURCE_DATA_ENTRY*) &base[si->data_entry_ofs];
|
|
|
|
memset( de, 0, sizeof *de );
|
|
|
|
de->OffsetToData = si->data_ofs + rva;
|
|
|
|
de->Size = data->cbData;
|
|
|
|
de->CodePage = data->codepage;
|
|
|
|
si->data_entry_ofs += sizeof (IMAGE_RESOURCE_DATA_ENTRY);
|
|
|
|
|
|
|
|
/* write out the resource data */
|
|
|
|
memcpy( &base[si->data_ofs], data->lpData, data->cbData );
|
|
|
|
si->data_ofs += data->cbData;
|
|
|
|
|
|
|
|
pad_size = (-si->data_ofs)&3;
|
|
|
|
res_write_padding( &base[si->data_ofs], pad_size );
|
|
|
|
si->data_ofs += pad_size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/*
|
|
|
|
* FIXME:
|
|
|
|
* Assumes that the resources are in .rsrc
|
|
|
|
* and .rsrc is the last section in the file.
|
|
|
|
* Not sure whether updating resources will other cases on Windows.
|
|
|
|
* If the resources lie in a section containing other data,
|
|
|
|
* resizing that section could possibly cause trouble.
|
|
|
|
* If the section with the resources isn't last, the remaining
|
|
|
|
* sections need to be moved down in the file, and the section header
|
|
|
|
* would need to be adjusted.
|
|
|
|
* If we needed to add a section, what would we name it?
|
|
|
|
* If we needed to add a section and there wasn't space in the file
|
|
|
|
* header, how would that work?
|
|
|
|
* Seems that at least some of these cases can't be handled properly.
|
|
|
|
*/
|
|
|
|
static IMAGE_SECTION_HEADER *get_resource_section( void *base, DWORD mapping_size )
|
|
|
|
{
|
|
|
|
IMAGE_SECTION_HEADER *sec;
|
|
|
|
IMAGE_NT_HEADERS *nt;
|
|
|
|
DWORD i, num_sections = 0;
|
|
|
|
|
|
|
|
nt = get_nt_header( base, mapping_size );
|
|
|
|
if (!nt)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
sec = get_section_header( base, mapping_size, &num_sections );
|
|
|
|
if (!sec)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
/* find the resources section */
|
|
|
|
for (i=0; i<num_sections; i++)
|
|
|
|
if (!memcmp(sec[i].Name, ".rsrc", 6))
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (i == num_sections)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return &sec[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
static DWORD get_init_data_size( void *base, DWORD mapping_size )
|
|
|
|
{
|
|
|
|
DWORD i, sz = 0, num_sections = 0;
|
|
|
|
IMAGE_SECTION_HEADER *s;
|
|
|
|
|
|
|
|
s = get_section_header( base, mapping_size, &num_sections );
|
|
|
|
|
|
|
|
for (i=0; i<num_sections; i++)
|
|
|
|
if (s[i].Characteristics & IMAGE_SCN_CNT_INITIALIZED_DATA)
|
|
|
|
sz += s[i].SizeOfRawData;
|
|
|
|
|
|
|
|
TRACE("size = %08x\n", sz);
|
|
|
|
|
|
|
|
return sz;
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
static BOOL write_raw_resources( QUEUEDUPDATES *updates )
|
|
|
|
{
|
|
|
|
static const WCHAR prefix[] = { 'r','e','s','u',0 };
|
|
|
|
WCHAR tempdir[MAX_PATH], tempfile[MAX_PATH];
|
2018-04-11 11:36:44 +00:00
|
|
|
DWORD i, section_size;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
BOOL ret = FALSE;
|
|
|
|
IMAGE_SECTION_HEADER *sec;
|
2015-11-27 18:49:07 +00:00
|
|
|
IMAGE_NT_HEADERS32 *nt;
|
|
|
|
IMAGE_NT_HEADERS64 *nt64;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
struct resource_size_info res_size;
|
|
|
|
BYTE *res_base;
|
|
|
|
struct mapping_info *read_map = NULL, *write_map = NULL;
|
2015-11-27 18:49:07 +00:00
|
|
|
DWORD PeSectionAlignment, PeFileAlignment, PeSizeOfImage;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
/* copy the exe to a temp file then update the temp file... */
|
|
|
|
tempdir[0] = 0;
|
|
|
|
if (!GetTempPathW( MAX_PATH, tempdir ))
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
if (!GetTempFileNameW( tempdir, prefix, 0, tempfile ))
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
if (!CopyFileW( updates->pFileName, tempfile, FALSE ))
|
|
|
|
goto done;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("tempfile %s\n", debugstr_w(tempfile));
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
if (!updates->bDeleteExistingResources)
|
|
|
|
{
|
|
|
|
read_map = create_mapping( updates->pFileName, FALSE );
|
|
|
|
if (!read_map)
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
ret = read_mapped_resources( updates, read_map->base, read_map->size );
|
|
|
|
if (!ret)
|
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
ERR("failed to read existing resources\n");
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
write_map = create_mapping( tempfile, TRUE );
|
|
|
|
if (!write_map)
|
|
|
|
goto done;
|
|
|
|
|
2015-11-27 18:49:07 +00:00
|
|
|
nt = (IMAGE_NT_HEADERS32*)get_nt_header( write_map->base, write_map->size );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
if (!nt)
|
|
|
|
goto done;
|
|
|
|
|
2015-11-27 18:49:07 +00:00
|
|
|
nt64 = (IMAGE_NT_HEADERS64*)nt;
|
|
|
|
if (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
|
|
|
|
PeSectionAlignment = nt64->OptionalHeader.SectionAlignment;
|
|
|
|
PeFileAlignment = nt64->OptionalHeader.FileAlignment;
|
|
|
|
PeSizeOfImage = nt64->OptionalHeader.SizeOfImage;
|
|
|
|
} else {
|
|
|
|
PeSectionAlignment = nt->OptionalHeader.SectionAlignment;
|
|
|
|
PeFileAlignment = nt->OptionalHeader.FileAlignment;
|
|
|
|
PeSizeOfImage = nt->OptionalHeader.SizeOfImage;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((LONG)PeSectionAlignment <= 0)
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
2015-11-27 18:49:07 +00:00
|
|
|
ERR("invalid section alignment %08x\n", PeSectionAlignment);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2015-11-27 18:49:07 +00:00
|
|
|
if ((LONG)PeFileAlignment <= 0)
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
{
|
2015-11-27 18:49:07 +00:00
|
|
|
ERR("invalid file alignment %08x\n", PeFileAlignment);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
goto done;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
sec = get_resource_section( write_map->base, write_map->size );
|
|
|
|
if (!sec) /* no section, add one */
|
2009-09-26 05:25:52 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
DWORD num_sections;
|
|
|
|
|
|
|
|
sec = get_section_header( write_map->base, write_map->size, &num_sections );
|
|
|
|
if (!sec)
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
sec += num_sections;
|
|
|
|
nt->FileHeader.NumberOfSections++;
|
|
|
|
|
|
|
|
memset( sec, 0, sizeof *sec );
|
|
|
|
memcpy( sec->Name, ".rsrc", 5 );
|
|
|
|
sec->Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ;
|
2015-11-27 18:49:07 +00:00
|
|
|
sec->VirtualAddress = PeSizeOfImage;
|
2009-09-26 05:25:52 +00:00
|
|
|
}
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
if (!sec->PointerToRawData) /* empty section */
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
2015-11-27 18:49:07 +00:00
|
|
|
sec->PointerToRawData = write_map->size + (-write_map->size) % PeFileAlignment;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
sec->SizeOfRawData = 0;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("before .rsrc at %08x, size %08x\n", sec->PointerToRawData, sec->SizeOfRawData);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
get_resource_sizes( updates, &res_size );
|
|
|
|
|
|
|
|
/* round up the section size */
|
|
|
|
section_size = res_size.total_size;
|
2015-11-27 18:49:07 +00:00
|
|
|
section_size += (-section_size) % PeFileAlignment;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("requires %08x (%08x) bytes\n", res_size.total_size, section_size );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
/* check if the file size needs to be changed */
|
|
|
|
if (section_size != sec->SizeOfRawData)
|
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
DWORD old_size = write_map->size;
|
2015-11-27 18:49:07 +00:00
|
|
|
DWORD virtual_section_size = res_size.total_size + (-res_size.total_size) % PeSectionAlignment;
|
|
|
|
int delta = section_size - (sec->SizeOfRawData + (-sec->SizeOfRawData) % PeFileAlignment);
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
int rva_delta = virtual_section_size -
|
2015-11-27 18:49:07 +00:00
|
|
|
(sec->Misc.VirtualSize + (-sec->Misc.VirtualSize) % PeSectionAlignment);
|
|
|
|
/* when new section is added it could end past current mapping size */
|
|
|
|
BOOL rsrc_is_last = sec->PointerToRawData + sec->SizeOfRawData >= old_size;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/* align .rsrc size when possible */
|
|
|
|
DWORD mapping_size = rsrc_is_last ? sec->PointerToRawData + section_size : old_size + delta;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/* postpone file truncation if there are some data to be moved down from file end */
|
|
|
|
BOOL resize_after = mapping_size < old_size && !rsrc_is_last;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("file size %08x -> %08x\n", old_size, mapping_size);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!resize_after)
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/* unmap the file before changing the file size */
|
|
|
|
ret = resize_mapping( write_map, mapping_size );
|
|
|
|
|
|
|
|
/* get the pointers again - they might be different after remapping */
|
2015-11-27 18:49:07 +00:00
|
|
|
nt = (IMAGE_NT_HEADERS32*)get_nt_header( write_map->base, mapping_size );
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!nt)
|
|
|
|
{
|
|
|
|
ERR("couldn't get NT header\n");
|
|
|
|
goto done;
|
|
|
|
}
|
2015-11-27 18:49:07 +00:00
|
|
|
nt64 = (IMAGE_NT_HEADERS64*)nt;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
sec = get_resource_section( write_map->base, mapping_size );
|
|
|
|
if (!sec)
|
|
|
|
goto done;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!rsrc_is_last) /* not last section, relocate trailing sections */
|
|
|
|
{
|
|
|
|
IMAGE_SECTION_HEADER *s;
|
|
|
|
DWORD tail_start = sec->PointerToRawData + sec->SizeOfRawData;
|
|
|
|
DWORD i, num_sections = 0;
|
|
|
|
|
|
|
|
memmove( (char*)write_map->base + tail_start + delta, (char*)write_map->base + tail_start, old_size - tail_start );
|
|
|
|
|
|
|
|
s = get_section_header( write_map->base, mapping_size, &num_sections );
|
|
|
|
|
|
|
|
for (i=0; i<num_sections; i++)
|
|
|
|
{
|
|
|
|
if (s[i].PointerToRawData > sec->PointerToRawData)
|
|
|
|
{
|
|
|
|
s[i].PointerToRawData += delta;
|
|
|
|
s[i].VirtualAddress += rva_delta;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (resize_after)
|
|
|
|
{
|
|
|
|
ret = resize_mapping( write_map, mapping_size );
|
|
|
|
|
2015-11-27 18:49:07 +00:00
|
|
|
nt = (IMAGE_NT_HEADERS32*)get_nt_header( write_map->base, mapping_size );
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (!nt)
|
|
|
|
{
|
|
|
|
ERR("couldn't get NT header\n");
|
|
|
|
goto done;
|
|
|
|
}
|
2015-11-27 18:49:07 +00:00
|
|
|
nt64 = (IMAGE_NT_HEADERS64*)nt;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
|
|
|
|
sec = get_resource_section( write_map->base, mapping_size );
|
|
|
|
if (!sec)
|
|
|
|
goto done;
|
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
/* adjust the PE header information */
|
|
|
|
sec->SizeOfRawData = section_size;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
sec->Misc.VirtualSize = virtual_section_size;
|
2015-11-27 18:49:07 +00:00
|
|
|
if (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
|
|
|
|
nt64->OptionalHeader.SizeOfImage += rva_delta;
|
|
|
|
nt64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress = sec->VirtualAddress;
|
|
|
|
nt64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].Size = res_size.total_size;
|
|
|
|
nt64->OptionalHeader.SizeOfInitializedData = get_init_data_size( write_map->base, mapping_size );
|
2018-04-11 11:36:44 +00:00
|
|
|
|
|
|
|
for (i=0; i<nt64->OptionalHeader.NumberOfRvaAndSizes; i++)
|
|
|
|
if (nt64->OptionalHeader.DataDirectory[i].VirtualAddress > sec->VirtualAddress)
|
|
|
|
nt64->OptionalHeader.DataDirectory[i].VirtualAddress += rva_delta;
|
2015-11-27 18:49:07 +00:00
|
|
|
} else {
|
|
|
|
nt->OptionalHeader.SizeOfImage += rva_delta;
|
|
|
|
nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress = sec->VirtualAddress;
|
|
|
|
nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].Size = res_size.total_size;
|
|
|
|
nt->OptionalHeader.SizeOfInitializedData = get_init_data_size( write_map->base, mapping_size );
|
2018-04-11 11:36:44 +00:00
|
|
|
|
|
|
|
for (i=0; i<nt->OptionalHeader.NumberOfRvaAndSizes; i++)
|
|
|
|
if (nt->OptionalHeader.DataDirectory[i].VirtualAddress > sec->VirtualAddress)
|
|
|
|
nt->OptionalHeader.DataDirectory[i].VirtualAddress += rva_delta;
|
2015-11-27 18:49:07 +00:00
|
|
|
}
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
res_base = (LPBYTE) write_map->base + sec->PointerToRawData;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("base = %p offset = %08x\n", write_map->base, sec->PointerToRawData);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
ret = write_resources( updates, res_base, &res_size, sec->VirtualAddress );
|
|
|
|
|
|
|
|
res_write_padding( res_base + res_size.total_size, section_size - res_size.total_size );
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("after .rsrc at %08x, size %08x\n", sec->PointerToRawData, sec->SizeOfRawData);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
done:
|
|
|
|
destroy_mapping( read_map );
|
|
|
|
destroy_mapping( write_map );
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (ret)
|
|
|
|
ret = CopyFileW( tempfile, updates->pFileName, FALSE );
|
2003-07-10 18:50:51 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
DeleteFileW( tempfile );
|
1999-11-17 21:21:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
return ret;
|
|
|
|
}
|
2003-07-10 18:50:51 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* BeginUpdateResourceW (KERNEL32.@)
|
2003-07-10 18:50:51 +00:00
|
|
|
*/
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
HANDLE WINAPI BeginUpdateResourceW( LPCWSTR pFileName, BOOL bDeleteExistingResources )
|
2001-03-31 01:17:30 +00:00
|
|
|
{
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
QUEUEDUPDATES *updates = NULL;
|
|
|
|
HANDLE hUpdate, file, ret = NULL;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("%s, %d\n", debugstr_w(pFileName), bDeleteExistingResources);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
hUpdate = GlobalAlloc(GHND, sizeof(QUEUEDUPDATES));
|
|
|
|
if (!hUpdate)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
updates = GlobalLock(hUpdate);
|
|
|
|
if (updates)
|
|
|
|
{
|
|
|
|
list_init( &updates->root );
|
|
|
|
updates->bDeleteExistingResources = bDeleteExistingResources;
|
|
|
|
updates->pFileName = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(pFileName)+1)*sizeof(WCHAR));
|
|
|
|
if (updates->pFileName)
|
|
|
|
{
|
|
|
|
lstrcpyW(updates->pFileName, pFileName);
|
|
|
|
|
|
|
|
file = CreateFileW( pFileName, GENERIC_READ | GENERIC_WRITE,
|
|
|
|
0, NULL, OPEN_EXISTING, 0, 0 );
|
|
|
|
|
|
|
|
/* if resources are deleted, only the file's presence is checked */
|
|
|
|
if (file != INVALID_HANDLE_VALUE &&
|
|
|
|
(bDeleteExistingResources || check_pe_exe( file, updates )))
|
|
|
|
ret = hUpdate;
|
|
|
|
else
|
|
|
|
HeapFree( GetProcessHeap(), 0, updates->pFileName );
|
|
|
|
|
|
|
|
CloseHandle( file );
|
|
|
|
}
|
|
|
|
GlobalUnlock(hUpdate);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!ret)
|
|
|
|
GlobalFree(hUpdate);
|
|
|
|
|
|
|
|
return ret;
|
2001-03-31 01:17:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* BeginUpdateResourceA (KERNEL32.@)
|
2003-07-10 18:50:51 +00:00
|
|
|
*/
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
HANDLE WINAPI BeginUpdateResourceA( LPCSTR pFileName, BOOL bDeleteExistingResources )
|
2001-03-31 01:17:30 +00:00
|
|
|
{
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
UNICODE_STRING FileNameW;
|
|
|
|
HANDLE ret;
|
|
|
|
RtlCreateUnicodeStringFromAsciiz(&FileNameW, pFileName);
|
|
|
|
ret = BeginUpdateResourceW(FileNameW.Buffer, bDeleteExistingResources);
|
|
|
|
RtlFreeUnicodeString(&FileNameW);
|
|
|
|
return ret;
|
2001-03-31 01:17:30 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* EndUpdateResourceW (KERNEL32.@)
|
2003-07-10 18:50:51 +00:00
|
|
|
*/
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
BOOL WINAPI EndUpdateResourceW( HANDLE hUpdate, BOOL fDiscard )
|
2001-03-31 01:17:30 +00:00
|
|
|
{
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
QUEUEDUPDATES *updates;
|
|
|
|
BOOL ret;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("%p %d\n", hUpdate, fDiscard);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
|
|
|
updates = GlobalLock(hUpdate);
|
|
|
|
if (!updates)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
ret = fDiscard || write_raw_resources( updates );
|
|
|
|
|
|
|
|
free_resource_directory( &updates->root, 2 );
|
|
|
|
|
|
|
|
HeapFree( GetProcessHeap(), 0, updates->pFileName );
|
|
|
|
GlobalUnlock( hUpdate );
|
|
|
|
GlobalFree( hUpdate );
|
|
|
|
|
|
|
|
return ret;
|
2001-03-31 01:17:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* EndUpdateResourceA (KERNEL32.@)
|
2003-07-10 18:50:51 +00:00
|
|
|
*/
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
BOOL WINAPI EndUpdateResourceA( HANDLE hUpdate, BOOL fDiscard )
|
2001-03-31 01:17:30 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
return EndUpdateResourceW(hUpdate, fDiscard);
|
2001-03-31 01:17:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* UpdateResourceW (KERNEL32.@)
|
2003-07-10 18:50:51 +00:00
|
|
|
*/
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
BOOL WINAPI UpdateResourceW( HANDLE hUpdate, LPCWSTR lpType, LPCWSTR lpName,
|
|
|
|
WORD wLanguage, LPVOID lpData, DWORD cbData)
|
2001-03-31 01:17:30 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
QUEUEDUPDATES *updates;
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
BOOL ret = FALSE;
|
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
TRACE("%p %s %s %08x %p %d\n", hUpdate,
|
|
|
|
debugstr_w(lpType), debugstr_w(lpName), wLanguage, lpData, cbData);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
updates = GlobalLock(hUpdate);
|
|
|
|
if (updates)
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if (lpData == NULL && cbData == 0) /* remove resource */
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
ret = update_add_resource( updates, lpType, lpName, wLanguage, NULL, TRUE );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
struct resource_data *data;
|
|
|
|
data = allocate_resource_data( wLanguage, 0, lpData, cbData, TRUE );
|
|
|
|
if (data)
|
|
|
|
ret = update_add_resource( updates, lpType, lpName, wLanguage, data, TRUE );
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
GlobalUnlock(hUpdate);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
}
|
|
|
|
return ret;
|
2001-03-31 01:17:30 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* UpdateResourceA (KERNEL32.@)
|
2003-07-10 18:50:51 +00:00
|
|
|
*/
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
BOOL WINAPI UpdateResourceA( HANDLE hUpdate, LPCSTR lpType, LPCSTR lpName,
|
|
|
|
WORD wLanguage, LPVOID lpData, DWORD cbData)
|
2001-03-31 01:17:30 +00:00
|
|
|
{
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
BOOL ret;
|
|
|
|
UNICODE_STRING TypeW;
|
|
|
|
UNICODE_STRING NameW;
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if(IS_INTRESOURCE(lpType))
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
TypeW.Buffer = ULongToPtr(LOWORD(lpType));
|
|
|
|
else
|
|
|
|
RtlCreateUnicodeStringFromAsciiz(&TypeW, lpType);
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if(IS_INTRESOURCE(lpName))
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
NameW.Buffer = ULongToPtr(LOWORD(lpName));
|
|
|
|
else
|
|
|
|
RtlCreateUnicodeStringFromAsciiz(&NameW, lpName);
|
|
|
|
ret = UpdateResourceW(hUpdate, TypeW.Buffer, NameW.Buffer, wLanguage, lpData, cbData);
|
[KERNEL32]: Winesync all there is to Winesync in ReactOS' kernel32. This mainly affects LZ*, Comm*, *ProfileString* (INI), and *Resource* APIs, however the changes in there are relatively minor. More substantial changes affect the locale/NLS/language functions, many which were bitrotting for 6+ years.
In theory, this code is "better" than before, and it is closer to Wine (which arguably has better compatibility). It also resets things in sync with Wine however, and may lose and "fixes" ReactOS may have added over the years. But this is a good thing, since these fixes have been "lost" (they obviously never made it into Wine), and if regressions are now found due to this, actual upstream patches can be sent and picked up on the next sync. This avoids maintaining duplicate code, at the expenses of some potential short-term regressions in i18n.
Finally, note that much of /string seems to be taken from Wine's Unicode library (which a host "unicode" already exists in ReactOS' tools/. It may be better (for someone with more experience as to these wine-isms) to simply just pull-in whatever winelib files are not currently present in ReactOS, and have kernel32 and tools/unicode use winelib, instead of having 2 or 3 copies of the code.
svn path=/trunk/; revision=52754
2011-07-21 05:24:59 +00:00
|
|
|
if(!IS_INTRESOURCE(lpType)) RtlFreeUnicodeString(&TypeW);
|
|
|
|
if(!IS_INTRESOURCE(lpName)) RtlFreeUnicodeString(&NameW);
|
Implemented (from Wine): BeginUpdateResourceA, BeginUpdateResourceW, UpdateResourceA, UpdateResourceW, EnumResourceLanguagesW, EnumResourceLanguagesA, EndUpdateResourceA, EndUpdateResourceW, EnumResourceTypesW, EnumResourceTypesA
Small fixes: GetSystemInfo, IsProcessorFeaturePresent, LockResource
svn path=/trunk/; revision=32899
2008-04-09 19:05:08 +00:00
|
|
|
return ret;
|
2001-03-31 01:17:30 +00:00
|
|
|
}
|