VirtualBox

source: kStuff/trunk/kProfiler2/kPrf2WinApiWrappers.c@ 24

Last change on this file since 24 was 13, checked in by bird, 17 years ago

Made it (winapi wrapping) work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1/* $Id: kPrf2WinApiWrappers.c 13 2008-04-20 10:13:43Z bird $ */
2/** @file
3 * Wrappers for a number of common Windows APIs.
4 */
5
6/*
7 * Copyright (c) 2008 knut st. osmundsen <[email protected]>
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#define _ADVAPI32_
29#define _KERNEL32_
30#define _WIN32_WINNT 0x0600
31#define UNICODE
32#include <Windows.h>
33#include <TLHelp32.h>
34#include <k/kDefs.h>
35#include "kPrf2WinApiWrapperHlp.h"
36
37#if K_ARCH == K_ARCH_X86_32
38typedef PVOID PRUNTIME_FUNCTION;
39typedef FARPROC PGET_RUNTIME_FUNCTION_CALLBACK;
40#endif
41
42/* RtlUnwindEx is used by msvcrt on amd64, but winnt.h only defines it for IA64... */
43typedef struct _FRAME_POINTERS {
44 ULONGLONG MemoryStackFp;
45 ULONGLONG BackingStoreFp;
46} FRAME_POINTERS, *PFRAME_POINTERS;
47typedef PVOID PUNWIND_HISTORY_TABLE;
48typedef PVOID PKNONVOLATILE_CONTEXT_POINTERS;
49
50
51/*******************************************************************************
52* Global Variables *
53*******************************************************************************/
54KPRF2WRAPDLL g_Kernel32 =
55{
56 INVALID_HANDLE_VALUE, "KERNEL32"
57};
58
59
60/*
61 * Include the generated code.
62 */
63#include "kPrf2WinApiWrappers-kernel32.h"
64
65/* TODO (amd64):
66
67AddLocalAlternateComputerNameA
68AddLocalAlternateComputerNameW
69EnumerateLocalComputerNamesA
70EnumerateLocalComputerNamesW
71RemoveLocalAlternateComputerNameA
72RemoveLocalAlternateComputerNameW
73
74RtlLookupFunctionEntry
75RtlPcToFileHeader
76RtlRaiseException
77RtlVirtualUnwind
78
79SetConsoleCursor
80SetLocalPrimaryComputerNameA
81SetLocalPrimaryComputerNameW
82__C_specific_handler
83__misaligned_access
84_local_unwind
85
86*/
87
88
89/**
90 * The DLL Main for the Windows API wrapper DLL.
91 *
92 * @returns Success indicator.
93 * @param hInstDll The instance handle of the DLL. (i.e. the module handle)
94 * @param fdwReason The reason why we're here. This is a 'flag' for reasons of
95 * tradition, it's really a kind of enum.
96 * @param pReserved Reserved / undocumented something.
97 */
98BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, PVOID pReserved)
99{
100 switch (fdwReason)
101 {
102 case DLL_PROCESS_ATTACH:
103 break;
104
105 case DLL_PROCESS_DETACH:
106 break;
107
108 case DLL_THREAD_ATTACH:
109 break;
110
111 case DLL_THREAD_DETACH:
112 break;
113 }
114
115 return TRUE;
116}
117
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette