win-pvdrivers

view winver.nsh @ 685:c13ccf5a629b

Fixed a bug in the dma routines which was causing memory corruption. In some cases when Windows gave an MDL that was longer than the buffer to be dma'd, the end of the buffer would be overwritten. The only time I am aware of this occuring is on one particular map in Call Of Duty 4.

Split out the dma routines from xenpci_pdo.c into xenpci_dma.c
author James Harper <james.harper@bendigoit.com.au>
date Wed Oct 14 14:46:39 2009 +1100 (2009-10-14)
parents 89e1a0af859c
children
line source
1 ; GetWindowsVersion
2 ;
3 ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
4 ; Updated by Joost Verburg
5 ;
6 ; Returns on top of stack
7 ;
8 ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003, Vista)
9 ; or
10 ; '' (Unknown Windows Version)
11 ;
12 ; Usage:
13 ; Call GetWindowsVersion
14 ; Pop $R0
15 ; ; at this point $R0 is "NT 4.0" or whatnot
17 Function GetWindowsVersion
19 Push $R0
20 Push $R1
22 ClearErrors
24 ReadRegStr $R0 HKLM \
25 "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
27 IfErrors 0 lbl_winnt
29 ; we are not NT
30 ReadRegStr $R0 HKLM \
31 "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
33 StrCpy $R1 $R0 1
34 StrCmp $R1 '4' 0 lbl_error
36 StrCpy $R1 $R0 3
38 StrCmp $R1 '4.0' lbl_win32_95
39 StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
41 lbl_win32_95:
42 StrCpy $R0 '95'
43 Goto lbl_done
45 lbl_win32_98:
46 StrCpy $R0 '98'
47 Goto lbl_done
49 lbl_win32_ME:
50 StrCpy $R0 'ME'
51 Goto lbl_done
53 lbl_winnt:
55 StrCpy $R1 $R0 1
57 StrCmp $R1 '3' lbl_winnt_x
58 StrCmp $R1 '4' lbl_winnt_x
60 StrCpy $R1 $R0 3
62 StrCmp $R1 '5.0' lbl_winnt_2000
63 StrCmp $R1 '5.1' lbl_winnt_XP
64 StrCmp $R1 '5.2' lbl_winnt_2003
65 StrCmp $R1 '6.0' lbl_winnt_vista lbl_error
67 lbl_winnt_x:
68 StrCpy $R0 "NT $R0" 6
69 Goto lbl_done
71 lbl_winnt_2000:
72 Strcpy $R0 '2000'
73 Goto lbl_done
75 lbl_winnt_XP:
76 Strcpy $R0 'XP'
77 Goto lbl_done
79 lbl_winnt_2003:
80 Strcpy $R0 '2003'
81 Goto lbl_done
83 lbl_winnt_vista:
84 Strcpy $R0 'Vista'
85 Goto lbl_done
87 lbl_error:
88 Strcpy $R0 ''
89 lbl_done:
91 Pop $R1
92 Exch $R0
94 FunctionEnd