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

Last change on this file since 46 was 46, checked in by sandervl, 26 years ago

* empty log message *

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