1 | /* $Id: kPrf2WinApiWrapperHlp.c 13 2008-04-20 10:13:43Z bird $ */
|
---|
2 | /** @file
|
---|
3 | * Helpers for the Windows API wrapper DLL.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (c) 2008 knut st. osmundsen <bird-src-spam@anduin.net>
|
---|
8 | *
|
---|
9 | * This program is free software; you can redistribute it and/or modify
|
---|
10 | * it under the terms of the GNU General Public License as published by
|
---|
11 | * the Free Software Foundation; either version 2 of the License, or
|
---|
12 | * (at your option) any later version.
|
---|
13 | *
|
---|
14 | * This program is distributed in the hope that it will be useful,
|
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
17 | * GNU General Public License for more details.
|
---|
18 | *
|
---|
19 | * You should have received a copy of the GNU General Public License
|
---|
20 | * along with This program; if not, write to the Free Software
|
---|
21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
---|
22 | *
|
---|
23 | */
|
---|
24 |
|
---|
25 | /*******************************************************************************
|
---|
26 | * Header Files *
|
---|
27 | *******************************************************************************/
|
---|
28 | #include <Windows.h>
|
---|
29 | #include "kPRf2WinApiWRapperHlp.h"
|
---|
30 |
|
---|
31 |
|
---|
32 | FARPROC kPrf2WrapResolve(void **ppfn, const char *pszName, PKPRF2WRAPDLL pDll)
|
---|
33 | {
|
---|
34 | FARPROC pfn;
|
---|
35 | HMODULE hmod = pDll->hmod;
|
---|
36 | if (hmod == INVALID_HANDLE_VALUE)
|
---|
37 | {
|
---|
38 | hmod = LoadLibraryA(pDll->szName);
|
---|
39 | pDll->hmod = hmod;
|
---|
40 | }
|
---|
41 |
|
---|
42 | pfn = GetProcAddress(hmod, pszName);
|
---|
43 | *ppfn = (void *)pfn;
|
---|
44 | return pfn;
|
---|
45 | }
|
---|
46 |
|
---|
47 |
|
---|