VirtualBox

source: vbox/trunk/src/VBox/Additions/3D/win/VBoxICD/icd_pfns.py@ 75621

Last change on this file since 75621 was 75621, checked in by vboxsync, 6 years ago

Additions/3D/win: ICD forwarder dll 32 bit fixes. bugref:9296

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1"""
2Copyright (C) 2018 Oracle Corporation
3
4This file is part of VirtualBox Open Source Edition (OSE), as
5available from http://www.virtualbox.org. This file is free software;
6you can redistribute it and/or modify it under the terms of the GNU
7General Public License (GPL) as published by the Free Software
8Foundation, in version 2 as it comes in the "COPYING" file of the
9VirtualBox OSE distribution. VirtualBox OSE is distributed in the
10hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
11"""
12
13import sys
14
15def GeneratePfns():
16
17 # Get list of functions.
18 exports_file = open(sys.argv[1], "r")
19 if not exports_file:
20 print("Error: couldn't open %s file!" % filename)
21 sys.exit()
22
23 names = []
24 for line in exports_file.readlines():
25 line = line.strip()
26 if len(line) > 0 and line[0] != ';' and line != 'EXPORTS':
27 # Parse 'glAccum = glAccum@8'
28 words = line.split('=')
29
30 # Function name
31 names.append(words[0].strip())
32
33 exports_file.close()
34
35
36 #
37 # C loader data
38 #
39 c_file = open(sys.argv[2], "w")
40 if not c_file:
41 print("Error: couldn't open %s file!" % filename)
42 sys.exit()
43
44 c_file.write('#include <iprt/win/windows.h>\n')
45 c_file.write('#include <VBoxWddmUmHlp.h>\n')
46 c_file.write('\n')
47
48 for index in range(len(names)):
49 fn = names[index]
50 c_file.write('FARPROC pfn_%s;\n' % fn)
51 c_file.write('\n')
52
53 c_file.write("struct VBOXWDDMDLLPROC aIcdProcs[] =\n")
54 c_file.write('{\n')
55 for index in range(len(names)):
56 fn = names[index]
57 c_file.write(' { "%s", &pfn_%s },\n' % (fn, fn) )
58 c_file.write(' { NULL, NULL }\n')
59 c_file.write('};\n')
60
61 c_file.close()
62
63GeneratePfns()
Note: See TracBrowser for help on using the repository browser.

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