1994-10-17 18:12:41 +00:00
|
|
|
/*
|
1996-07-17 20:02:21 +00:00
|
|
|
* PE (Portable Execute) File Resources
|
1994-10-17 18:12:41 +00:00
|
|
|
*
|
1996-07-17 20:02:21 +00:00
|
|
|
* Copyright 1995 Thomas Sandford
|
|
|
|
* Copyright 1996 Martin von Loewis
|
1994-10-17 18:12:41 +00:00
|
|
|
*
|
1996-07-17 20:02:21 +00:00
|
|
|
* Based on the Win16 resource handling code in loader/resource.c
|
|
|
|
* Copyright 1993 Robert J. Amstadt
|
|
|
|
* Copyright 1995 Alexandre Julliard
|
1997-02-02 19:01:52 +00:00
|
|
|
* Copyright 1997 Marcus Meissner
|
1994-10-17 18:12:41 +00:00
|
|
|
*/
|
|
|
|
|
1997-03-05 08:22:35 +00:00
|
|
|
#include <stdlib.h>
|
1994-10-17 18:12:41 +00:00
|
|
|
#include <sys/types.h>
|
2000-09-26 00:39:06 +00:00
|
|
|
|
1999-02-19 10:37:02 +00:00
|
|
|
#include "wine/winestring.h"
|
2000-06-13 01:10:29 +00:00
|
|
|
#include "wine/unicode.h"
|
1999-03-14 16:35:05 +00:00
|
|
|
#include "windef.h"
|
2000-05-05 18:17:52 +00:00
|
|
|
#include "winnls.h"
|
2000-09-26 00:39:06 +00:00
|
|
|
#include "winerror.h"
|
1996-07-17 20:02:21 +00:00
|
|
|
#include "module.h"
|
1996-12-22 18:27:48 +00:00
|
|
|
#include "heap.h"
|
Release 970914
Thu Sep 11 18:24:56 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
* [objects/dc.c]
In DC_SetupGCForPatBlt, replace R2_NOT by GXxor with (black xor white).
Tue Sep 9 23:04:02 1997 U. Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [memory/virtual.c]
Do not write debugging info unconditionally to stderr.
* [files/profile.c]
Call PROFILE_GetSection in PROFILE_GetString for key_name "" too.
* [misc/crtdll.c]
Many new functions.
* [include/windows.h] [windows/winpos.c]
ClientToScreen16 doesn't have a return value.
Sun Sep 7 10:06:39 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [misc/main.c] [AUTHORS]
Update the list of contributors. Please let me know if I forgot
someone.
* [if1632/*.spec] [if1632/builtin.c] [tools/build.c]
Ordinal base for Win32 DLLs is now computed automatically from the
lowest ordinal found.
* [include/wintypes.h]
WINAPI is now defined as attribute((stdcall)). This will require
gcc to compile.
* [if1632/thunk.c]
Removed Win32 thunks (no longer needed with stdcall).
* [if1632/crtdll.spec] [misc/crtdll.c]
Make sure we only reference cdecl functions in the spec file.
* [objects/dc.c]
Use CapNotLast drawing style for 1-pixel wide lines.
* [tools/build.c]
Added 'double' argument type.
Added 'varargs' function type for Win32.
Made CallTo16_xxx functions stdcall.
Fri Sep 5 14:50:49 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [tools/build.c] [windows/win.c] [windows/event.c] [windows/message.c]
More fixes to get message exchange closer to the original.
* [misc/spy.c]
Message logs now contain window names.
* [loader/resource.c] [loader/ne_resource.c] [loader/task.c]
[objects/cursoricon.c] [windows/user.c]
Added some obscure features to fix memory leaks.
Fri Sep 5 00:46:28 1997 Jan Willamowius <jan@janhh.shnet.org>
* [if1632/kernel32.spec] [win32/newfns.c]
Added stub for UTRegister() and UTUnRegister().
Thu Sep 4 12:03:12 1997 Frans van Dorsselaer <dorssel@rulhmpc49.LeidenUniv.nl>
* [controls/edit.c]
Allow ASCII codes > 127 in WM_CHAR.
Mon Sep 1 17:23:24 1997 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/widgets.c]
In InitCommonControls, remember the name of the class
because lpszClassName was made to point to a local array
Added the ProgressBar to the list of implemented controls.
Call InitCommonControls from WIDGETS_Init to register all
implemented Common Controls.
* [include/commctrl.h]
Added misc decl for the Progress Bar.
* [controls/progress.c] [include/progress.h]
First attempt at implementiong the Progress Bar class.
* [objects/brush.h]
Implementation for GetSysColorBrush[16|32]
* [controls/status.c]
Use DrawEdge to draw the borders and fill the background
* [controls/uitools.c]
Added DrawDiagEdge32 and DrawRectEdge32
* [graphics/painting.c]
Implement DrawEdge[16|32]
Started DrawFrameControl32
Mon Sep 1 10:07:09 1997 Lawson Whitney <lawson_whitney@juno.com>
* [misc/comm.c] [include/windows.h]
SetCommEventMask returns a SEGPTR.
Sun Aug 31 23:28:32 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][loader/module.c][include/pe_image.h]
[include/module.h]
Cleaned up the whole Win32 library mess (a bit).
* [debugger/stabs.c]
If 'wine' has no absolute path and isn't found, check $PATH too.
* [misc/ole2nls.c]
Some fixes.
* [misc/ver.c]
Added support for PE style version resources.
* [memory/string.c]
Check for NULL pointers to _lstr* functions, just as Windows95 does.
* [multimedia/time.c]
Made list of timers a simple linked list.
* [loader/resource.c]
Netscape 3 seems to pass NEGATIVE resource Ids (in an
unsigned int, yes). Don't know why, fixed it anyway.
* [objects/bitmap.c]
LoadImageW added.
* [include/win.h][windows/win.c]
Change wIDmenu from UINT16 to UINT32 and changed the
SetWindow(Long|Word) accordingly.
Thu Aug 28 19:30:08 1997 Morten Welinder <terra@diku.dk>
* [include/windows.h]
Add a few more colors defined for Win95.
Add a few more brush styles.
* [windows/syscolor.c]
Add error checks for SYSCOLOR_SetColor, SYSCOLOR_Init,
GetSysColor16, GetSysColor32. Add support for above colors.
Sun Aug 24 16:22:57 1997 Andrew Taylor <andrew@riscan.com>
* [multimedia/mmsystem.c]
Changed mmioDescend to use mmio functions for file I/O, neccessary
for memory files.
1997-09-14 17:17:23 +00:00
|
|
|
#include "task.h"
|
|
|
|
#include "process.h"
|
1996-07-17 20:02:21 +00:00
|
|
|
#include "stackframe.h"
|
|
|
|
#include "neexe.h"
|
1999-06-12 15:45:58 +00:00
|
|
|
#include "debugtools.h"
|
1994-10-17 18:12:41 +00:00
|
|
|
|
2000-09-26 00:39:06 +00:00
|
|
|
DEFAULT_DEBUG_CHANNEL(resource);
|
|
|
|
|
1997-02-02 19:01:52 +00:00
|
|
|
/**********************************************************************
|
2000-08-07 04:12:41 +00:00
|
|
|
* get_resdir
|
1997-02-02 19:01:52 +00:00
|
|
|
*
|
2000-08-07 04:12:41 +00:00
|
|
|
* Get the resource directory of a PE module
|
1997-02-02 19:01:52 +00:00
|
|
|
*/
|
2000-10-19 20:29:53 +00:00
|
|
|
static const IMAGE_RESOURCE_DIRECTORY* get_resdir( HMODULE hmod )
|
2000-08-07 04:12:41 +00:00
|
|
|
{
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_DATA_DIRECTORY *dir;
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY *ret = NULL;
|
2000-08-07 04:12:41 +00:00
|
|
|
|
|
|
|
if (!hmod) hmod = GetModuleHandleA( NULL );
|
2000-09-26 00:39:06 +00:00
|
|
|
else if (!HIWORD(hmod))
|
|
|
|
{
|
|
|
|
FIXME("Enumeration of 16-bit resources is not supported\n");
|
|
|
|
SetLastError(ERROR_INVALID_HANDLE);
|
|
|
|
return NULL;
|
|
|
|
}
|
2000-08-07 04:12:41 +00:00
|
|
|
dir = &PE_HEADER(hmod)->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE];
|
|
|
|
if (dir->Size && dir->VirtualAddress)
|
|
|
|
ret = (IMAGE_RESOURCE_DIRECTORY *)((char *)hmod + dir->VirtualAddress);
|
|
|
|
return ret;
|
1997-02-02 19:01:52 +00:00
|
|
|
}
|
1994-10-17 18:12:41 +00:00
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* find_entry_by_name
|
|
|
|
*
|
|
|
|
* Find an entry by name in a resource directory
|
|
|
|
*/
|
|
|
|
static IMAGE_RESOURCE_DIRECTORY *find_entry_by_name( const IMAGE_RESOURCE_DIRECTORY *dir,
|
|
|
|
LPCWSTR name, const char *root )
|
|
|
|
{
|
|
|
|
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
|
|
|
|
const IMAGE_RESOURCE_DIR_STRING_U *str;
|
|
|
|
int min, max, res, pos, namelen = strlenW(name);
|
|
|
|
|
|
|
|
entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
|
|
|
|
min = 0;
|
|
|
|
max = dir->NumberOfNamedEntries - 1;
|
|
|
|
while (min <= max)
|
|
|
|
{
|
|
|
|
pos = (min + max) / 2;
|
|
|
|
str = (IMAGE_RESOURCE_DIR_STRING_U *)(root + entry[pos].u1.s.NameOffset);
|
|
|
|
res = strncmpiW( name, str->NameString, str->Length );
|
|
|
|
if (!res && namelen == str->Length)
|
|
|
|
return (IMAGE_RESOURCE_DIRECTORY *)(root + entry[pos].u2.s.OffsetToDirectory);
|
|
|
|
if (res < 0) max = pos - 1;
|
|
|
|
else min = pos + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now do a linear search just in case */
|
|
|
|
for (pos = 0; pos < dir->NumberOfNamedEntries; pos++)
|
|
|
|
{
|
|
|
|
str = (IMAGE_RESOURCE_DIR_STRING_U *)(root + entry[pos].u1.s.NameOffset);
|
|
|
|
if (namelen != str->Length) continue;
|
|
|
|
if (!strncmpiW( name, str->NameString, str->Length ))
|
|
|
|
{
|
|
|
|
ERR( "entry '%s' required linear search, please report\n", debugstr_w(name) );
|
|
|
|
return (IMAGE_RESOURCE_DIRECTORY *)(root + entry[pos].u2.s.OffsetToDirectory);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* find_entry_by_id
|
|
|
|
*
|
|
|
|
* Find an entry by id in a resource directory
|
|
|
|
*/
|
|
|
|
static IMAGE_RESOURCE_DIRECTORY *find_entry_by_id( const IMAGE_RESOURCE_DIRECTORY *dir,
|
|
|
|
WORD id, const char *root )
|
|
|
|
{
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
|
|
|
|
int min, max, pos;
|
|
|
|
|
|
|
|
entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
|
|
|
|
min = dir->NumberOfNamedEntries;
|
|
|
|
max = min + dir->NumberOfIdEntries - 1;
|
|
|
|
while (min <= max)
|
|
|
|
{
|
|
|
|
pos = (min + max) / 2;
|
|
|
|
if (entry[pos].u1.Id == id)
|
|
|
|
return (IMAGE_RESOURCE_DIRECTORY *)(root + entry[pos].u2.s.OffsetToDirectory);
|
|
|
|
if (entry[pos].u1.Id > id) max = pos - 1;
|
|
|
|
else min = pos + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now do a linear search just in case */
|
|
|
|
min = dir->NumberOfNamedEntries;
|
|
|
|
max = min + dir->NumberOfIdEntries - 1;
|
|
|
|
for (pos = min; pos <= max; pos++)
|
|
|
|
{
|
|
|
|
if (entry[pos].u1.Id == id)
|
|
|
|
{
|
|
|
|
ERR( "entry %04x required linear search, please report\n", id );
|
|
|
|
return (IMAGE_RESOURCE_DIRECTORY *)(root + entry[pos].u2.s.OffsetToDirectory);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* find_entry_default
|
|
|
|
*
|
|
|
|
* Find a default entry in a resource directory
|
|
|
|
*/
|
|
|
|
static IMAGE_RESOURCE_DIRECTORY *find_entry_default( const IMAGE_RESOURCE_DIRECTORY *dir,
|
|
|
|
const char *root )
|
|
|
|
{
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
|
|
|
|
|
|
|
|
entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
|
|
|
|
if (dir->NumberOfNamedEntries || dir->NumberOfIdEntries)
|
|
|
|
return (IMAGE_RESOURCE_DIRECTORY *)(root + entry->u2.s.OffsetToDirectory);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-07-17 20:02:21 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* GetResDirEntryW
|
|
|
|
*
|
|
|
|
* Helper function - goes down one level of PE resource tree
|
|
|
|
*
|
|
|
|
*/
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY *GetResDirEntryW(const IMAGE_RESOURCE_DIRECTORY *resdirptr,
|
|
|
|
LPCWSTR name, LPCVOID root,
|
|
|
|
BOOL allowdefault)
|
1996-07-17 20:02:21 +00:00
|
|
|
{
|
2000-10-19 20:29:53 +00:00
|
|
|
if (HIWORD(name))
|
|
|
|
{
|
|
|
|
if (name[0]=='#')
|
|
|
|
{
|
|
|
|
char buf[10];
|
|
|
|
if (!WideCharToMultiByte( CP_ACP, 0, name+1, -1, buf, sizeof(buf), NULL, NULL ))
|
|
|
|
return NULL;
|
|
|
|
return find_entry_by_id( resdirptr, atoi(buf), root );
|
|
|
|
}
|
|
|
|
return find_entry_by_name( resdirptr, name, root );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY *ret;
|
|
|
|
ret = find_entry_by_id( resdirptr, LOWORD(name), root );
|
|
|
|
if (!ret && !name && allowdefault) ret = find_entry_default( resdirptr, root );
|
|
|
|
return ret;
|
1996-07-17 20:02:21 +00:00
|
|
|
}
|
1994-10-17 18:12:41 +00:00
|
|
|
}
|
|
|
|
|
1999-01-31 10:13:13 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* GetResDirEntryA
|
|
|
|
*/
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY *GetResDirEntryA( const IMAGE_RESOURCE_DIRECTORY *resdirptr,
|
|
|
|
LPCSTR name, LPCVOID root,
|
|
|
|
BOOL allowdefault )
|
1999-01-31 10:13:13 +00:00
|
|
|
{
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY *retv;
|
1999-01-31 10:13:13 +00:00
|
|
|
LPWSTR nameW = HIWORD(name)? HEAP_strdupAtoW( GetProcessHeap(), 0, name )
|
|
|
|
: (LPWSTR)name;
|
|
|
|
|
|
|
|
retv = GetResDirEntryW( resdirptr, nameW, root, allowdefault );
|
|
|
|
|
|
|
|
if ( HIWORD(name) ) HeapFree( GetProcessHeap(), 0, nameW );
|
|
|
|
|
|
|
|
return retv;
|
|
|
|
}
|
|
|
|
|
1996-07-17 20:02:21 +00:00
|
|
|
/**********************************************************************
|
2000-08-07 04:12:41 +00:00
|
|
|
* PE_FindResourceExW
|
2000-08-11 12:50:56 +00:00
|
|
|
*
|
|
|
|
* FindResourceExA/W does search in the following order:
|
|
|
|
* 1. Exact specified language
|
|
|
|
* 2. Language with neutral sublanguage
|
|
|
|
* 3. Neutral language with neutral sublanguage
|
|
|
|
* 4. Neutral language with default sublanguage
|
1996-07-17 20:02:21 +00:00
|
|
|
*/
|
2000-08-11 12:50:56 +00:00
|
|
|
HRSRC PE_FindResourceExW( HMODULE hmod, LPCWSTR name, LPCWSTR type, WORD lang )
|
2000-08-07 04:12:41 +00:00
|
|
|
{
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY *resdirptr = get_resdir(hmod);
|
|
|
|
const void *root;
|
2000-08-11 12:50:56 +00:00
|
|
|
HRSRC result;
|
1994-10-17 18:12:41 +00:00
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
if (!resdirptr) return 0;
|
1996-07-17 20:02:21 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
root = resdirptr;
|
Release 971221
Fri Dec 19 10:50:46 1997 Douglas Ridgway <ridgway@winehq.com>
* [Make.rules.in] [Makefile.in] [documentation/Makefile.in]
[documentation/README.documentation]
First cut at Wine API documentation. No longer install reference
manual by default.
Wed Dec 17 21:32:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed GetTempFileName16() to use current path of requested drive
as needed.
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/dciman32.spec]
[if1632/msvfw32.spec] [if1632/tapi32.spec] [if1632/wow32.spec]
Added misc DLLs needed by various apps.
Wed Dec 17 12:01:50 1997 Morten Eriksen <mortene@sim.no>
* [if1632/gdi32.spec] [include/windows.h] [objects/palette.c]
Inserted empty stub for CreateHalftonePalette.
Tue Dec 16 22:08:06 1997 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [windows/mdi.c]
Use VK_TAB instead of VK_SEPARATOR in TranslateMDISysAccel().
* [graphics/metafiledrv/init.c]
DeleteDC() on a MetaDC doesn't do anything - it shouldn't. Therefore
fix cleanup of MetaDCs in CloseMetaFile(); they now actually get
removed from the GDI heap!
* [graphics/x11drv/xfont.c]
Preserve FO_MATCH_XYINDEP flag in XFONT_MatchFIList(). Should reduce
the number of bold-italic matches.
Tue Dec 16 20:11:43 1997 Bertho Stultiens <bertho@panter.soci.aau.dk>
* [graphics/painting.c]
Included an implementation of DrawState
* [if1632/thunk.c]
Changed many fprintfs into dprintf_thunk
* [include/cache.h] [graphics/cache.c]
New files to hold cached handles to regulary used GDI object.
* [include/windows.h]
Added DRAWSTATExx typedefs
Added DSS_DEFAULT define for DrawState
* [objects/text.c]
New implementation of GrayString()
* [controls/uitools.c]
Implemented DrawFrameControl() functions
Changed DrawEdge() behaviour to win95 implementation
Mon Dec 15 23:43:01 1997 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/path.c] [include/path.h] [graphics/painting.c]
[if1632/gdi32.spec] [include/gdi.h] [include/windows.h]
[objects/dc.c]
Added preliminary support for GDI paths.
* [objects/dc.c]
Added DC_Init_DC_INFO function for initializing WIN_DC_INFO
structure.
* [include/windows.h] [include/gdi.h] [objects/gdiobj.c]
Added DEFAULT_GUI_FONT.
* [include/winerror.h]
Added a few error codes.
* [memory/heap.c]
Changed HeapAlloc to make the correct calls to SetLastError
(now conforms to NT's behaviour).
* [windows/win.c]
Changed WIN_CreateWindowEx to allow child windows with zero
width / height.
Sun Dec 14 12:01:07 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/*] [relay32/*]
Moved all 32-bit relay stuff to relay32/
* [fi1632/thunk.c] [win32/kernel32.c]
Moved all KERNEL32 ordinal functions to kernel32.c
* [memory/selector.c]
Initialize selectors in AllocSelectorArray.
* [tools/build.c]
Generate C instead of assembly for Win32 relays.
Fixed stack corruption in CallTo16 functions, found by Bertho
Stultiens.
Sun Dec 14 10:55:00 1997 Andreas Mohr <100.30936@germany.net>
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/ole2thk.spec]
Added built-in OLE2THK.DLL.
* [if1632/toolhelp.spec] [include/toolhelp.h] [memory/selector.c]
[misc/toolhelp.c]
Added stubs for StackTraceFirst(), StackTraceCSIPFirst(),
StackTraceNext(), UTSelectorOffsetToLinear()
and UTLinearToSelectorOffset().
Sat Dec 13 17:26:41 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c]
32-bit API fixes for reported problems (thanks to Marcus
and David).
* [graphics/x11drv/xfont.c]
Little tweak in point size calculation.
* [windows/defwnd.c] [windows/dce.c] [windows/winhelp.c]
[windows/winproc.c] [windows/win.c]
Bug fixes.
Sat Dec 13 16:35:14 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [files/dos_fs.c]
OpenFile with empty filename and OF_PARSE returns current dir.
* [misc/commdlg.c]
Ignore initial dir if bogus.
* [files/file.c]
Locking an identic region in a file must not be an error.
* [misc/lstr.c]
Use wide char ctype functions.
Fri Dec 12 23:46:22 1997 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [file/drive.c]
First attempt for GetDiskFreeSpaceEx.
Fri Dec 12 23:18:41 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_resource.c]
Fixed wrongly appearing menus problem (only use default lookups in
last resource subtree).
* [multimedia/*.c]
Added win32 support for time* and joy* lowlevel drivers,
(not excessively tested), some misc fixes and cleanups.
* [misc/shellord.c][misc/shell.c][ole/folders.c][ole/ifs.c]
[include/interfaces.h][include/shlobj.h]
Added some more undocumented SHELL32 functions, some shell folder
interface stubs added, SHGetMalloc, SHGetDesktopFolder,
SHGetSpecialFolderLocation, SHGetPathFromIDList stubs added,
IMalloc, IUnknown implemented.
* [windows/msgbox.c]
Implemented MessageBoxIndirect*, some internal changes.
* [if1632/thunk.c]
KERNEL_431 implemented.
* [objects/gdiobj.c]
GetCurrentObject implemented.
Wed Dec 3 01:09:17 1997 Gordon Chaffee <chaffee@apu.cs.berkeley.edu>
* [objects/dib.c]
Fix a couple small DIB problems.
* [controls/edit.c]
Fix a typo.
* [files/dos_fs.c]
Try normal readdir in case fs is specified as vfat but isn't.
* [files/profile.c]
Implementation of WritePrivateProfileSection32A from Uwe Bonnes.
* [misc/printdrv.c]
OpenPrinter32A stub, helps Word97 start.
* [objects/text.c]
Fixup implementation of GetTextCharsetInfo.
* [scheduler/process.c]
Fix environment variable expansion.
* [win32/code_page.c]
Make MultiByteToWideChar and WideCharToMultiByte conform in return
values and error conditions to those in Windows NT 4.0.
* [windows/message.c]
Fix broadcasting problems in Win32. The Win32 docs say to use
HWND_TOPMOST to broadcast to all Win32 Windows.
* [memory/virtual.c] [loader/pe_image.c]
Do not map in VirtualAlloc if address is specified and space is
not available. This is required by Win32.
* [include/pen.h] [include/x11drv.h] [objects/dc.c]
[objects/pen.c] [graphics/x11drv/pen.c]
Support for ExtCreatePen.
Tue Dec 2 20:22:06 1997 Morten Welinder <terra@diku.dk>
* [*/*.c] [*/*.h]
Add lots of prototypes.
* [if1632/kernel32.spec][include/windows.h][include/winnt.h]
[misc/cpu.c]
Define IsProcessorFeaturePresent.
* [misc/crtdll.c]
(CRTDLL__getcwd): Allocate enough memory for the terminating zero.
* [misc/ver.c]
Improve check for null component in _find_data[AW]. Plug leaks
in VerQueryValue*.
* [win32/console.c][if1632/kernel32.spec]
Add stubs for GetConsoleCursorInfo32, SetConsoleCursorInfo32.
* [windows/message.c][if1632/user32.spec][include/windows.h]
Define SendMessageTimeout*.
* [graphics/x11drv/xfont.c]
Change algorithm of __genericCheckSum to be alignment safe.
* [misc/main.c] [misc/winsock.c] [misc/winsock_dns.c]
Include winsock.h early to avoid Solaris problem.
* [include/windows.h]
Undef FSHIFT before we define it.
* [rc/winerc.c]
Include <fcntl.h> instead of <sys/fcntl.h>.
* [files/file.c]
Use strerror in FILE_SetDosError if available.
* [include/config.h.in] [configure.in]
Check for strerror.
* [objects/gdiobj.c]
Make static font structures aligned.
Mon Dec 1 10:10:21 1997 Karl Garrison <karlos@eznet.net>
* [win32/console.c] [if1632/kernel32.spec] [include/windows.h]
Added stub for GetNumberOfConsoleMouseButtons.
Added stub for PeekConsoleInput(A,W).
Fixed parameter list for WriteConsole(A,W).
GetNumberOfConsoleInputEvents now returns 0 events instead of 1
(since low-level console functions are not yet supported).
GetConsoleMode no longer returns ENABLE_WINDOW_INPUT and
ENABLE_MOUSE_INPUT since these are not currently implemented.
1997-12-21 19:17:50 +00:00
|
|
|
if ((resdirptr = GetResDirEntryW(resdirptr, type, root, FALSE)) == NULL)
|
1996-07-17 20:02:21 +00:00
|
|
|
return 0;
|
Release 971221
Fri Dec 19 10:50:46 1997 Douglas Ridgway <ridgway@winehq.com>
* [Make.rules.in] [Makefile.in] [documentation/Makefile.in]
[documentation/README.documentation]
First cut at Wine API documentation. No longer install reference
manual by default.
Wed Dec 17 21:32:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed GetTempFileName16() to use current path of requested drive
as needed.
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/dciman32.spec]
[if1632/msvfw32.spec] [if1632/tapi32.spec] [if1632/wow32.spec]
Added misc DLLs needed by various apps.
Wed Dec 17 12:01:50 1997 Morten Eriksen <mortene@sim.no>
* [if1632/gdi32.spec] [include/windows.h] [objects/palette.c]
Inserted empty stub for CreateHalftonePalette.
Tue Dec 16 22:08:06 1997 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [windows/mdi.c]
Use VK_TAB instead of VK_SEPARATOR in TranslateMDISysAccel().
* [graphics/metafiledrv/init.c]
DeleteDC() on a MetaDC doesn't do anything - it shouldn't. Therefore
fix cleanup of MetaDCs in CloseMetaFile(); they now actually get
removed from the GDI heap!
* [graphics/x11drv/xfont.c]
Preserve FO_MATCH_XYINDEP flag in XFONT_MatchFIList(). Should reduce
the number of bold-italic matches.
Tue Dec 16 20:11:43 1997 Bertho Stultiens <bertho@panter.soci.aau.dk>
* [graphics/painting.c]
Included an implementation of DrawState
* [if1632/thunk.c]
Changed many fprintfs into dprintf_thunk
* [include/cache.h] [graphics/cache.c]
New files to hold cached handles to regulary used GDI object.
* [include/windows.h]
Added DRAWSTATExx typedefs
Added DSS_DEFAULT define for DrawState
* [objects/text.c]
New implementation of GrayString()
* [controls/uitools.c]
Implemented DrawFrameControl() functions
Changed DrawEdge() behaviour to win95 implementation
Mon Dec 15 23:43:01 1997 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/path.c] [include/path.h] [graphics/painting.c]
[if1632/gdi32.spec] [include/gdi.h] [include/windows.h]
[objects/dc.c]
Added preliminary support for GDI paths.
* [objects/dc.c]
Added DC_Init_DC_INFO function for initializing WIN_DC_INFO
structure.
* [include/windows.h] [include/gdi.h] [objects/gdiobj.c]
Added DEFAULT_GUI_FONT.
* [include/winerror.h]
Added a few error codes.
* [memory/heap.c]
Changed HeapAlloc to make the correct calls to SetLastError
(now conforms to NT's behaviour).
* [windows/win.c]
Changed WIN_CreateWindowEx to allow child windows with zero
width / height.
Sun Dec 14 12:01:07 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/*] [relay32/*]
Moved all 32-bit relay stuff to relay32/
* [fi1632/thunk.c] [win32/kernel32.c]
Moved all KERNEL32 ordinal functions to kernel32.c
* [memory/selector.c]
Initialize selectors in AllocSelectorArray.
* [tools/build.c]
Generate C instead of assembly for Win32 relays.
Fixed stack corruption in CallTo16 functions, found by Bertho
Stultiens.
Sun Dec 14 10:55:00 1997 Andreas Mohr <100.30936@germany.net>
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/ole2thk.spec]
Added built-in OLE2THK.DLL.
* [if1632/toolhelp.spec] [include/toolhelp.h] [memory/selector.c]
[misc/toolhelp.c]
Added stubs for StackTraceFirst(), StackTraceCSIPFirst(),
StackTraceNext(), UTSelectorOffsetToLinear()
and UTLinearToSelectorOffset().
Sat Dec 13 17:26:41 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c]
32-bit API fixes for reported problems (thanks to Marcus
and David).
* [graphics/x11drv/xfont.c]
Little tweak in point size calculation.
* [windows/defwnd.c] [windows/dce.c] [windows/winhelp.c]
[windows/winproc.c] [windows/win.c]
Bug fixes.
Sat Dec 13 16:35:14 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [files/dos_fs.c]
OpenFile with empty filename and OF_PARSE returns current dir.
* [misc/commdlg.c]
Ignore initial dir if bogus.
* [files/file.c]
Locking an identic region in a file must not be an error.
* [misc/lstr.c]
Use wide char ctype functions.
Fri Dec 12 23:46:22 1997 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [file/drive.c]
First attempt for GetDiskFreeSpaceEx.
Fri Dec 12 23:18:41 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_resource.c]
Fixed wrongly appearing menus problem (only use default lookups in
last resource subtree).
* [multimedia/*.c]
Added win32 support for time* and joy* lowlevel drivers,
(not excessively tested), some misc fixes and cleanups.
* [misc/shellord.c][misc/shell.c][ole/folders.c][ole/ifs.c]
[include/interfaces.h][include/shlobj.h]
Added some more undocumented SHELL32 functions, some shell folder
interface stubs added, SHGetMalloc, SHGetDesktopFolder,
SHGetSpecialFolderLocation, SHGetPathFromIDList stubs added,
IMalloc, IUnknown implemented.
* [windows/msgbox.c]
Implemented MessageBoxIndirect*, some internal changes.
* [if1632/thunk.c]
KERNEL_431 implemented.
* [objects/gdiobj.c]
GetCurrentObject implemented.
Wed Dec 3 01:09:17 1997 Gordon Chaffee <chaffee@apu.cs.berkeley.edu>
* [objects/dib.c]
Fix a couple small DIB problems.
* [controls/edit.c]
Fix a typo.
* [files/dos_fs.c]
Try normal readdir in case fs is specified as vfat but isn't.
* [files/profile.c]
Implementation of WritePrivateProfileSection32A from Uwe Bonnes.
* [misc/printdrv.c]
OpenPrinter32A stub, helps Word97 start.
* [objects/text.c]
Fixup implementation of GetTextCharsetInfo.
* [scheduler/process.c]
Fix environment variable expansion.
* [win32/code_page.c]
Make MultiByteToWideChar and WideCharToMultiByte conform in return
values and error conditions to those in Windows NT 4.0.
* [windows/message.c]
Fix broadcasting problems in Win32. The Win32 docs say to use
HWND_TOPMOST to broadcast to all Win32 Windows.
* [memory/virtual.c] [loader/pe_image.c]
Do not map in VirtualAlloc if address is specified and space is
not available. This is required by Win32.
* [include/pen.h] [include/x11drv.h] [objects/dc.c]
[objects/pen.c] [graphics/x11drv/pen.c]
Support for ExtCreatePen.
Tue Dec 2 20:22:06 1997 Morten Welinder <terra@diku.dk>
* [*/*.c] [*/*.h]
Add lots of prototypes.
* [if1632/kernel32.spec][include/windows.h][include/winnt.h]
[misc/cpu.c]
Define IsProcessorFeaturePresent.
* [misc/crtdll.c]
(CRTDLL__getcwd): Allocate enough memory for the terminating zero.
* [misc/ver.c]
Improve check for null component in _find_data[AW]. Plug leaks
in VerQueryValue*.
* [win32/console.c][if1632/kernel32.spec]
Add stubs for GetConsoleCursorInfo32, SetConsoleCursorInfo32.
* [windows/message.c][if1632/user32.spec][include/windows.h]
Define SendMessageTimeout*.
* [graphics/x11drv/xfont.c]
Change algorithm of __genericCheckSum to be alignment safe.
* [misc/main.c] [misc/winsock.c] [misc/winsock_dns.c]
Include winsock.h early to avoid Solaris problem.
* [include/windows.h]
Undef FSHIFT before we define it.
* [rc/winerc.c]
Include <fcntl.h> instead of <sys/fcntl.h>.
* [files/file.c]
Use strerror in FILE_SetDosError if available.
* [include/config.h.in] [configure.in]
Check for strerror.
* [objects/gdiobj.c]
Make static font structures aligned.
Mon Dec 1 10:10:21 1997 Karl Garrison <karlos@eznet.net>
* [win32/console.c] [if1632/kernel32.spec] [include/windows.h]
Added stub for GetNumberOfConsoleMouseButtons.
Added stub for PeekConsoleInput(A,W).
Fixed parameter list for WriteConsole(A,W).
GetNumberOfConsoleInputEvents now returns 0 events instead of 1
(since low-level console functions are not yet supported).
GetConsoleMode no longer returns ENABLE_WINDOW_INPUT and
ENABLE_MOUSE_INPUT since these are not currently implemented.
1997-12-21 19:17:50 +00:00
|
|
|
if ((resdirptr = GetResDirEntryW(resdirptr, name, root, FALSE)) == NULL)
|
1994-10-17 18:12:41 +00:00
|
|
|
return 0;
|
2000-08-11 12:50:56 +00:00
|
|
|
|
|
|
|
/* 1. Exact specified language */
|
2000-10-19 20:29:53 +00:00
|
|
|
if ((result = (HRSRC)find_entry_by_id( resdirptr, lang, root ))) goto found;
|
2000-05-05 18:17:52 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
/* 2. Language with neutral sublanguage */
|
|
|
|
lang = MAKELANGID(PRIMARYLANGID(lang), SUBLANG_NEUTRAL);
|
|
|
|
if ((result = (HRSRC)find_entry_by_id( resdirptr, lang, root ))) goto found;
|
2000-08-11 12:50:56 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
/* 3. Neutral language with neutral sublanguage */
|
|
|
|
lang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL);
|
|
|
|
if ((result = (HRSRC)find_entry_by_id( resdirptr, lang, root ))) goto found;
|
2000-08-11 12:50:56 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
/* 4. Neutral language with default sublanguage */
|
|
|
|
lang = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);
|
|
|
|
result = (HRSRC)find_entry_by_id( resdirptr, lang, root );
|
2000-08-11 12:50:56 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
found:
|
2000-08-11 12:50:56 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* PE_FindResourceW
|
|
|
|
*
|
|
|
|
* Load[String]/[Icon]/[Menu]/[etc.] does use FindResourceA/W.
|
|
|
|
* FindResourceA/W does search in the following order:
|
|
|
|
* 1. Neutral language with neutral sublanguage
|
|
|
|
* 2. Neutral language with default sublanguage
|
|
|
|
* 3. Current locale lang id
|
|
|
|
* 4. Current locale lang id with neutral sublanguage
|
|
|
|
* 5. (!) LANG_ENGLISH, SUBLANG_DEFAULT
|
|
|
|
* 6. Return first in the list
|
|
|
|
*/
|
|
|
|
HRSRC PE_FindResourceW( HMODULE hmod, LPCWSTR name, LPCWSTR type )
|
|
|
|
{
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY *resdirptr = get_resdir(hmod);
|
|
|
|
const void *root;
|
2000-08-11 12:50:56 +00:00
|
|
|
HRSRC result;
|
|
|
|
WORD lang;
|
|
|
|
|
|
|
|
if (!resdirptr) return 0;
|
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
root = resdirptr;
|
2000-08-11 12:50:56 +00:00
|
|
|
if ((resdirptr = GetResDirEntryW(resdirptr, type, root, FALSE)) == NULL)
|
|
|
|
return 0;
|
|
|
|
if ((resdirptr = GetResDirEntryW(resdirptr, name, root, FALSE)) == NULL)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* 1. Neutral language with neutral sublanguage */
|
|
|
|
lang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL);
|
2000-10-19 20:29:53 +00:00
|
|
|
if ((result = (HRSRC)find_entry_by_id( resdirptr, lang, root ))) goto found;
|
2000-08-11 12:50:56 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
/* 2. Neutral language with default sublanguage */
|
|
|
|
lang = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);
|
|
|
|
if ((result = (HRSRC)find_entry_by_id( resdirptr, lang, root ))) goto found;
|
2000-08-11 12:50:56 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
/* 3. Current locale lang id */
|
|
|
|
lang = LANGIDFROMLCID(GetUserDefaultLCID());
|
|
|
|
if ((result = (HRSRC)find_entry_by_id( resdirptr, lang, root ))) goto found;
|
2000-08-11 12:50:56 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
/* 4. Current locale lang id with neutral sublanguage */
|
|
|
|
lang = MAKELANGID(PRIMARYLANGID(lang), SUBLANG_NEUTRAL);
|
|
|
|
if ((result = (HRSRC)find_entry_by_id( resdirptr, lang, root ))) goto found;
|
2000-08-11 12:50:56 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
/* 5. (!) LANG_ENGLISH, SUBLANG_DEFAULT */
|
|
|
|
lang = MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT);
|
|
|
|
if ((result = (HRSRC)find_entry_by_id( resdirptr, lang, root ))) goto found;
|
2000-08-11 12:50:56 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
/* 6. Return first in the list */
|
|
|
|
result = (HRSRC)find_entry_default( resdirptr, root );
|
2000-08-11 12:50:56 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
found:
|
1996-07-17 20:02:21 +00:00
|
|
|
return result;
|
1994-10-17 18:12:41 +00:00
|
|
|
}
|
|
|
|
|
1996-07-17 20:02:21 +00:00
|
|
|
|
1994-10-17 18:12:41 +00:00
|
|
|
/**********************************************************************
|
2000-08-07 04:12:41 +00:00
|
|
|
* PE_LoadResource
|
1994-10-17 18:12:41 +00:00
|
|
|
*/
|
2000-08-07 04:12:41 +00:00
|
|
|
HANDLE PE_LoadResource( HMODULE hmod, HANDLE hRsrc )
|
1994-10-17 18:12:41 +00:00
|
|
|
{
|
2000-08-07 04:12:41 +00:00
|
|
|
if (!hRsrc) return 0;
|
|
|
|
return (HANDLE)(hmod + ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
|
1997-02-02 19:01:52 +00:00
|
|
|
}
|
|
|
|
|
1996-07-17 20:02:21 +00:00
|
|
|
|
1997-02-02 19:01:52 +00:00
|
|
|
/**********************************************************************
|
2000-08-07 23:50:00 +00:00
|
|
|
* PE_SizeofResource
|
1997-02-02 19:01:52 +00:00
|
|
|
*/
|
2000-08-07 23:50:00 +00:00
|
|
|
DWORD PE_SizeofResource( HANDLE hRsrc )
|
1997-02-02 19:01:52 +00:00
|
|
|
{
|
2000-08-07 23:50:00 +00:00
|
|
|
if (!hRsrc) return 0;
|
1998-10-16 09:30:33 +00:00
|
|
|
return ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->Size;
|
1997-02-02 19:01:52 +00:00
|
|
|
}
|
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
|
1997-02-02 19:01:52 +00:00
|
|
|
/**********************************************************************
|
2000-08-07 04:12:41 +00:00
|
|
|
* EnumResourceTypesA (KERNEL32.90)
|
1997-02-02 19:01:52 +00:00
|
|
|
*/
|
2000-08-07 04:12:41 +00:00
|
|
|
BOOL WINAPI EnumResourceTypesA( HMODULE hmod, ENUMRESTYPEPROCA lpfun, LONG lparam)
|
|
|
|
{
|
1997-02-02 19:01:52 +00:00
|
|
|
int i;
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY *resdir = get_resdir(hmod);
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL ret;
|
1997-02-02 19:01:52 +00:00
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
if (!resdir) return FALSE;
|
1997-02-02 19:01:52 +00:00
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)(resdir + 1);
|
1997-02-02 19:01:52 +00:00
|
|
|
ret = FALSE;
|
|
|
|
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
|
2000-08-20 03:32:57 +00:00
|
|
|
LPSTR type;
|
|
|
|
|
|
|
|
if (et[i].u1.s.NameIsString)
|
|
|
|
{
|
|
|
|
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) resdir + et[i].u1.s.NameOffset);
|
|
|
|
DWORD len = WideCharToMultiByte( CP_ACP, 0, pResString->NameString, pResString->Length,
|
|
|
|
NULL, 0, NULL, NULL);
|
|
|
|
if (!(type = HeapAlloc(GetProcessHeap(), 0, len + 1)))
|
|
|
|
return FALSE;
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, pResString->NameString, pResString->Length,
|
|
|
|
type, len, NULL, NULL);
|
|
|
|
type[len] = '\0';
|
|
|
|
ret = lpfun(hmod,type,lparam);
|
|
|
|
HeapFree(GetProcessHeap(), 0, type);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
type = (LPSTR)(int)et[i].u1.Id;
|
|
|
|
ret = lpfun(hmod,type,lparam);
|
|
|
|
}
|
1997-02-02 19:01:52 +00:00
|
|
|
if (!ret)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
|
1997-02-02 19:01:52 +00:00
|
|
|
/**********************************************************************
|
2000-08-07 04:12:41 +00:00
|
|
|
* EnumResourceTypesW (KERNEL32.91)
|
1997-02-02 19:01:52 +00:00
|
|
|
*/
|
2000-08-07 04:12:41 +00:00
|
|
|
BOOL WINAPI EnumResourceTypesW( HMODULE hmod, ENUMRESTYPEPROCW lpfun, LONG lparam)
|
|
|
|
{
|
1997-02-02 19:01:52 +00:00
|
|
|
int i;
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY *resdir = get_resdir(hmod);
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL ret;
|
1997-02-02 19:01:52 +00:00
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
if (!resdir) return FALSE;
|
1997-02-02 19:01:52 +00:00
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)(resdir + 1);
|
1997-02-02 19:01:52 +00:00
|
|
|
ret = FALSE;
|
|
|
|
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
|
|
|
|
LPWSTR type;
|
|
|
|
|
2000-08-20 03:32:57 +00:00
|
|
|
if (et[i].u1.s.NameIsString)
|
|
|
|
{
|
|
|
|
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) resdir + et[i].u1.s.NameOffset);
|
|
|
|
if (!(type = HeapAlloc(GetProcessHeap(), 0, (pResString->Length+1) * sizeof (WCHAR))))
|
|
|
|
return FALSE;
|
|
|
|
memcpy(type, pResString->NameString, pResString->Length * sizeof (WCHAR));
|
|
|
|
type[pResString->Length] = '\0';
|
|
|
|
ret = lpfun(hmod,type,lparam);
|
|
|
|
HeapFree(GetProcessHeap(), 0, type);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
type = (LPWSTR)(int)et[i].u1.Id;
|
|
|
|
ret = lpfun(hmod,type,lparam);
|
|
|
|
}
|
1997-02-02 19:01:52 +00:00
|
|
|
if (!ret)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
|
1997-02-02 19:01:52 +00:00
|
|
|
/**********************************************************************
|
2000-08-07 04:12:41 +00:00
|
|
|
* EnumResourceNamesA (KERNEL32.88)
|
1997-02-02 19:01:52 +00:00
|
|
|
*/
|
2000-08-07 04:12:41 +00:00
|
|
|
BOOL WINAPI EnumResourceNamesA( HMODULE hmod, LPCSTR type, ENUMRESNAMEPROCA lpfun, LONG lparam )
|
|
|
|
{
|
1997-02-02 19:01:52 +00:00
|
|
|
int i;
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY *basedir = get_resdir(hmod);
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY *resdir;
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL ret;
|
1997-02-02 19:01:52 +00:00
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
if (!basedir) return FALSE;
|
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
if (!(resdir = GetResDirEntryA(basedir,type,basedir,FALSE))) return FALSE;
|
2000-08-20 03:32:57 +00:00
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)(resdir + 1);
|
1997-02-02 19:01:52 +00:00
|
|
|
ret = FALSE;
|
|
|
|
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
|
2000-08-20 03:32:57 +00:00
|
|
|
LPSTR name;
|
|
|
|
|
|
|
|
if (et[i].u1.s.NameIsString)
|
|
|
|
{
|
|
|
|
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) basedir + et[i].u1.s.NameOffset);
|
|
|
|
DWORD len = WideCharToMultiByte(CP_ACP, 0, pResString->NameString, pResString->Length,
|
|
|
|
NULL, 0, NULL, NULL);
|
|
|
|
if (!(name = HeapAlloc(GetProcessHeap(), 0, len + 1 )))
|
|
|
|
return FALSE;
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, pResString->NameString, pResString->Length,
|
|
|
|
name, len, NULL, NULL );
|
|
|
|
name[len] = '\0';
|
|
|
|
ret = lpfun(hmod,type,name,lparam);
|
|
|
|
HeapFree( GetProcessHeap(), 0, name );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
name = (LPSTR)(int)et[i].u1.Id;
|
|
|
|
ret = lpfun(hmod,type,name,lparam);
|
|
|
|
}
|
1997-02-02 19:01:52 +00:00
|
|
|
if (!ret)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
|
1997-02-02 19:01:52 +00:00
|
|
|
/**********************************************************************
|
2000-08-07 04:12:41 +00:00
|
|
|
* EnumResourceNamesW (KERNEL32.89)
|
1997-02-02 19:01:52 +00:00
|
|
|
*/
|
2000-08-07 04:12:41 +00:00
|
|
|
BOOL WINAPI EnumResourceNamesW( HMODULE hmod, LPCWSTR type, ENUMRESNAMEPROCW lpfun, LONG lparam )
|
|
|
|
{
|
1997-02-02 19:01:52 +00:00
|
|
|
int i;
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY *basedir = get_resdir(hmod);
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY *resdir;
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL ret;
|
1997-02-02 19:01:52 +00:00
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
if (!basedir) return FALSE;
|
1997-02-02 19:01:52 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
resdir = GetResDirEntryW(basedir,type,basedir,FALSE);
|
1997-02-02 19:01:52 +00:00
|
|
|
if (!resdir)
|
|
|
|
return FALSE;
|
2000-08-07 04:12:41 +00:00
|
|
|
et = (PIMAGE_RESOURCE_DIRECTORY_ENTRY)(resdir + 1);
|
1997-02-02 19:01:52 +00:00
|
|
|
ret = FALSE;
|
|
|
|
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
|
2000-08-20 03:32:57 +00:00
|
|
|
LPWSTR name;
|
|
|
|
|
|
|
|
if (et[i].u1.s.NameIsString)
|
|
|
|
{
|
|
|
|
PIMAGE_RESOURCE_DIR_STRING_U pResString = (PIMAGE_RESOURCE_DIR_STRING_U) ((LPBYTE) basedir + et[i].u1.s.NameOffset);
|
|
|
|
if (!(name = HeapAlloc(GetProcessHeap(), 0, (pResString->Length + 1) * sizeof (WCHAR))))
|
|
|
|
return FALSE;
|
|
|
|
memcpy(name, pResString->NameString, pResString->Length * sizeof (WCHAR));
|
|
|
|
name[pResString->Length] = '\0';
|
|
|
|
ret = lpfun(hmod,type,name,lparam);
|
|
|
|
HeapFree(GetProcessHeap(), 0, name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
name = (LPWSTR)(int)et[i].u1.Id;
|
|
|
|
ret = lpfun(hmod,type,name,lparam);
|
|
|
|
}
|
1997-02-02 19:01:52 +00:00
|
|
|
if (!ret)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
|
1997-02-02 19:01:52 +00:00
|
|
|
/**********************************************************************
|
2000-08-07 04:12:41 +00:00
|
|
|
* EnumResourceLanguagesA (KERNEL32.86)
|
1997-02-02 19:01:52 +00:00
|
|
|
*/
|
2000-08-07 04:12:41 +00:00
|
|
|
BOOL WINAPI EnumResourceLanguagesA( HMODULE hmod, LPCSTR type, LPCSTR name,
|
|
|
|
ENUMRESLANGPROCA lpfun, LONG lparam )
|
|
|
|
{
|
1997-02-02 19:01:52 +00:00
|
|
|
int i;
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY *basedir = get_resdir(hmod);
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY *resdir;
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL ret;
|
1997-02-02 19:01:52 +00:00
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
if (!basedir) return FALSE;
|
2000-10-19 20:29:53 +00:00
|
|
|
if (!(resdir = GetResDirEntryA(basedir,type,basedir,FALSE))) return FALSE;
|
|
|
|
if (!(resdir = GetResDirEntryA(resdir,name,basedir,FALSE))) return FALSE;
|
2000-08-07 04:12:41 +00:00
|
|
|
|
|
|
|
et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)(resdir + 1);
|
1997-02-02 19:01:52 +00:00
|
|
|
ret = FALSE;
|
|
|
|
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
|
2000-08-20 03:32:57 +00:00
|
|
|
/* languages are just ids... I hope */
|
2000-08-07 04:12:41 +00:00
|
|
|
ret = lpfun(hmod,type,name,et[i].u1.Id,lparam);
|
1997-02-02 19:01:52 +00:00
|
|
|
if (!ret)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
|
1997-02-02 19:01:52 +00:00
|
|
|
/**********************************************************************
|
2000-08-07 04:12:41 +00:00
|
|
|
* EnumResourceLanguagesW (KERNEL32.87)
|
1997-02-02 19:01:52 +00:00
|
|
|
*/
|
2000-08-07 04:12:41 +00:00
|
|
|
BOOL WINAPI EnumResourceLanguagesW( HMODULE hmod, LPCWSTR type, LPCWSTR name,
|
|
|
|
ENUMRESLANGPROCW lpfun, LONG lparam )
|
|
|
|
{
|
1997-02-02 19:01:52 +00:00
|
|
|
int i;
|
2000-10-19 20:29:53 +00:00
|
|
|
const IMAGE_RESOURCE_DIRECTORY *basedir = get_resdir(hmod);
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY *resdir;
|
|
|
|
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL ret;
|
1997-02-02 19:01:52 +00:00
|
|
|
|
2000-08-07 04:12:41 +00:00
|
|
|
if (!basedir) return FALSE;
|
1997-02-02 19:01:52 +00:00
|
|
|
|
2000-10-19 20:29:53 +00:00
|
|
|
resdir = GetResDirEntryW(basedir,type,basedir,FALSE);
|
1997-02-02 19:01:52 +00:00
|
|
|
if (!resdir)
|
|
|
|
return FALSE;
|
2000-10-19 20:29:53 +00:00
|
|
|
resdir = GetResDirEntryW(resdir,name,basedir,FALSE);
|
1997-02-02 19:01:52 +00:00
|
|
|
if (!resdir)
|
|
|
|
return FALSE;
|
2000-08-07 04:12:41 +00:00
|
|
|
et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)(resdir + 1);
|
1997-02-02 19:01:52 +00:00
|
|
|
ret = FALSE;
|
|
|
|
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
|
2000-08-07 04:12:41 +00:00
|
|
|
ret = lpfun(hmod,type,name,et[i].u1.Id,lparam);
|
1997-02-02 19:01:52 +00:00
|
|
|
if (!ret)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
1994-10-17 18:12:41 +00:00
|
|
|
}
|