source: trunk/src/kernel32/resource.cpp@ 100

Last change on this file since 100 was 100, checked in by phaller, 26 years ago

Add: added cvs variable $Id$ to the source files.

File size: 3.4 KB
Line 
1/* $Id: resource.cpp,v 1.6 1999-06-10 20:48:01 phaller Exp $ */
2
3/*
4 *
5 * Project Odin Software License can be found in LICENSE.TXT
6 *
7 */
8/*
9 * Misc resource procedures
10 *
11 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
12 * Copyright 1998 Patrick Haller
13 *
14 */
15#include <os2win.h>
16#include "unicode.h"
17#include "winres.h"
18#include "winimage.h"
19#include "winexe.h"
20
21//******************************************************************************
22//lpszName = integer id (high word 0), else string (name or "#237")
23//Can lpszType contain a pointer to a default resource type name?
24//******************************************************************************
25HRSRC WIN32API FindResourceA(HINSTANCE hModule, LPCSTR lpszName, LPCSTR lpszType)
26{
27 Win32Image *module;
28
29 dprintf(("FindResourceA %X", hModule));
30 if(hModule == 0 || hModule == -1 || (WinExe != NULL && hModule ==
31 WinExe->getOS2InstanceHandle()))
32 {
33 module = (Win32Image *)WinExe;
34 }
35 else module = (Win32Image *)Win32Dll::findModule(hModule);
36
37 if(module == NULL)
38 return(NULL);
39
40 return module->findResourceA(lpszName, (LPSTR)lpszType);
41}
42//******************************************************************************
43//******************************************************************************
44HRSRC WIN32API FindResourceW(HINSTANCE hModule, LPCWSTR lpszName,
45 LPCWSTR lpszType)
46{
47 Win32Image *module;
48
49 dprintf(("FindResourceW %X", hModule));
50 if(hModule == 0 || hModule == -1 || (WinExe != NULL && hModule ==
51 WinExe->getOS2InstanceHandle()))
52 {
53 module = (Win32Image *)WinExe;
54 }
55 else module = (Win32Image *)Win32Dll::findModule(hModule);
56
57 if(module == NULL)
58 return(NULL);
59
60 return module->findResourceW((LPWSTR)lpszName, (LPWSTR)lpszType);
61}
62//******************************************************************************
63//hRes returned by LoadResource
64//******************************************************************************
65PVOID WIN32API LockResource(HGLOBAL hRes)
66{
67 Win32Resource *res = (Win32Resource *)hRes;
68
69 dprintf(("LockResource %X\n", hRes));
70
71 /* @@@PH */
72 if (res == NULL)
73 return (NULL);
74 else
75 return res->lockResource();
76}
77//******************************************************************************
78//******************************************************************************
79HGLOBAL WIN32API LoadResource(HINSTANCE hModule, HRSRC hRes)
80{
81 return (HGLOBAL)hRes;
82}
83//******************************************************************************
84//hRes == returned by FindResource(Ex)
85//******************************************************************************
86DWORD WIN32API SizeofResource(HINSTANCE hModule, HRSRC hRes)
87{
88 Win32Resource *res = (Win32Resource *)hRes;
89
90 dprintf(("OS2SizeofResource\n"));
91 if(res == NULL)
92 return(0);
93
94 return res->sizeofResource();
95}
96//******************************************************************************
97//******************************************************************************
98BOOL WIN32API EnumResourceNamesA(HINSTANCE hModule, LPCTSTR lpszType,
99 ENUMRESNAMEPROCA lpEnumFunc, LONG lParam)
100{
101 dprintf(("OS2EnumResourceNamesA - stub\n"));
102 return(FALSE);
103}
104//******************************************************************************
105//******************************************************************************
Note: See TracBrowser for help on using the repository browser.