VirtualBox

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

Last change on this file since 106061 was 106061, checked in by vboxsync, 5 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1"""
2Copyright (C) 2018-2024 Oracle and/or its affiliates.
3
4This file is part of VirtualBox base platform packages, as
5available from https://www.virtualbox.org.
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation, in version 3 of the
10License.
11
12This program is distributed in the hope that it will be useful, but
13WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, see <https://www.gnu.org/licenses>.
19
20SPDX-License-Identifier: GPL-3.0-only
21"""
22
23import sys
24
25def GeneratePfns():
26
27 # Get list of functions.
28 exports_file = open(sys.argv[1], "r")
29 if not exports_file:
30 print("Error: couldn't open %s file!" % filename)
31 sys.exit()
32
33 names = []
34 for line in exports_file.readlines():
35 line = line.strip()
36 if len(line) > 0 and line[0] != ';' and line != 'EXPORTS':
37 # Parse 'glAccum = glAccum@8'
38 words = line.split('=')
39
40 # Function name
41 names.append(words[0].strip())
42
43 exports_file.close()
44
45
46 #
47 # C loader data
48 #
49 c_file = open(sys.argv[2], "w")
50 if not c_file:
51 print("Error: couldn't open %s file!" % filename)
52 sys.exit()
53
54 c_file.write('#include <iprt/win/windows.h>\n')
55 c_file.write('#include <VBoxWddmUmHlp.h>\n')
56 c_file.write('\n')
57
58 for index in range(len(names)):
59 fn = names[index]
60 c_file.write('FARPROC pfn_%s;\n' % fn)
61 c_file.write('\n')
62
63 c_file.write("struct VBOXWDDMDLLPROC aIcdProcs[] =\n")
64 c_file.write('{\n')
65 for index in range(len(names)):
66 fn = names[index]
67 c_file.write(' { "%s", &pfn_%s },\n' % (fn, fn) )
68 c_file.write(' { NULL, NULL }\n')
69 c_file.write('};\n')
70
71 c_file.close()
72
73GeneratePfns()
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