Rev 81 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
81 | daniel-mar | 1 | library WinVersion; |
2 | |||
3 | uses |
||
4 | Windows, |
||
5 | SysUtils, |
||
6 | Classes, |
||
7 | UD2_PluginIntf in '..\UD2_PluginIntf.pas', |
||
8 | UD2_PluginUtils in '..\UD2_PluginUtils.pas', |
||
9 | UD2_PluginStatus in '..\UD2_PluginStatus.pas'; |
||
10 | |||
11 | {$R *.res} |
||
12 | |||
13 | const |
||
14 | PLUGIN_GUID: TGUID = '{07A0A0B0-4076-4A76-8992-57C6965269A0}'; |
||
15 | |||
16 | function PluginIdentifier: TGUID; cdecl; |
||
17 | begin |
||
18 | result := PLUGIN_GUID; |
||
19 | end; |
||
20 | |||
21 | function IdentificationStringW(lpIdentifier: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl; |
||
22 | var |
||
23 | stIdentifier: WideString; |
||
24 | begin |
||
82 | daniel-mar | 25 | try |
26 | stIdentifier := IntToStr(Win32MajorVersion) + '.' + |
||
27 | IntToStr(Win32MinorVersion) + '.' + |
||
28 | IntToStr(Win32BuildNumber); |
||
29 | result := UD2_WritePascalStringToPointerW(lpIdentifier, cchSize, stIdentifier); |
||
30 | except |
||
31 | on E: Exception do result := UD2_STATUS_HandleException(E); |
||
32 | end; |
||
81 | daniel-mar | 33 | end; |
34 | |||
35 | function PluginNameW(lpPluginName: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
||
36 | var |
||
37 | stPluginName: WideString; |
||
38 | primaryLangID: Byte; |
||
39 | begin |
||
40 | primaryLangID := wLangID and $00FF; |
||
41 | if primaryLangID = LANG_GERMAN then |
||
42 | stPluginName := 'Windows-Version' |
||
43 | else |
||
44 | stPluginName := 'Windows version'; |
||
45 | result := UD2_WritePascalStringToPointerW(lpPluginName, cchSize, stPluginName); |
||
46 | end; |
||
47 | |||
48 | function PluginVendorW(lpPluginVendor: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
||
49 | begin |
||
50 | result := UD2_WritePascalStringToPointerW(lpPluginVendor, cchSize, 'ViaThinkSoft'); |
||
51 | end; |
||
52 | |||
53 | function PluginVersionW(lpPluginVersion: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
||
54 | begin |
||
55 | result := UD2_WritePascalStringToPointerW(lpPluginVersion, cchSize, '1.0'); |
||
56 | end; |
||
57 | |||
58 | function IdentificationMethodNameW(lpIdentificationMethodName: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl; |
||
59 | var |
||
60 | stIdentificationMethodName: WideString; |
||
61 | begin |
||
62 | stIdentificationMethodName := 'WinVersion'; |
||
63 | result := UD2_WritePascalStringToPointerW(lpIdentificationMethodName, cchSize, stIdentificationMethodName); |
||
64 | end; |
||
65 | |||
66 | function CheckLicense(lpReserved: LPVOID): UD2_STATUS; cdecl; |
||
67 | begin |
||
68 | result := UD2_STATUS_OK_LICENSED; |
||
69 | end; |
||
70 | |||
71 | function DescribeOwnStatusCodeW(lpErrorDescription: LPWSTR; cchSize: DWORD; statusCode: UD2_STATUS; wLangID: LANGID): BOOL; cdecl; |
||
72 | begin |
||
73 | // This function does not use non-generic status codes |
||
74 | result := FALSE; |
||
75 | end; |
||
76 | |||
77 | exports |
||
78 | PluginInterfaceID name mnPluginInterfaceID, |
||
79 | PluginIdentifier name mnPluginIdentifier, |
||
80 | PluginNameW name mnPluginNameW, |
||
81 | PluginVendorW name mnPluginVendorW, |
||
82 | PluginVersionW name mnPluginVersionW, |
||
83 | IdentificationMethodNameW name mnIdentificationMethodNameW, |
||
84 | IdentificationStringW name mnIdentificationStringW, |
||
85 | CheckLicense name mnCheckLicense, |
||
86 | DescribeOwnStatusCodeW name mnDescribeOwnStatusCodeW; |
||
87 | |||
88 | end. |