Subversion Repositories userdetect2

Rev

Rev 81 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
81 daniel-mar 1
library WinMajorVersion;
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 = '{30EDE7BF-E70E-4D7D-B2AA-5E27CBEF6F45}';
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
    result := UD2_WritePascalStringToPointerW(lpIdentifier, cchSize, stIdentifier);
28
  except
29
    on E: Exception do result := UD2_STATUS_HandleException(E);
30
  end;
81 daniel-mar 31
end;
32
 
33
function PluginNameW(lpPluginName: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl;
34
var
35
  stPluginName: WideString;
36
  primaryLangID: Byte;
37
begin
38
  primaryLangID := wLangID and $00FF;
39
  if primaryLangID = LANG_GERMAN then
40
    stPluginName := 'Windows-Hauptversion'
41
  else
42
    stPluginName := 'Windows major version';
43
  result := UD2_WritePascalStringToPointerW(lpPluginName, cchSize, stPluginName);
44
end;
45
 
46
function PluginVendorW(lpPluginVendor: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl;
47
begin
48
  result := UD2_WritePascalStringToPointerW(lpPluginVendor, cchSize, 'ViaThinkSoft');
49
end;
50
 
51
function PluginVersionW(lpPluginVersion: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl;
52
begin
53
  result := UD2_WritePascalStringToPointerW(lpPluginVersion, cchSize, '1.0');
54
end;
55
 
56
function IdentificationMethodNameW(lpIdentificationMethodName: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl;
57
var
58
  stIdentificationMethodName: WideString;
59
begin
60
  stIdentificationMethodName := 'WinMajorVersion';
61
  result := UD2_WritePascalStringToPointerW(lpIdentificationMethodName, cchSize, stIdentificationMethodName);
62
end;
63
 
64
function CheckLicense(lpReserved: LPVOID): UD2_STATUS; cdecl;
65
begin
66
  result := UD2_STATUS_OK_LICENSED;
67
end;
68
 
69
function DescribeOwnStatusCodeW(lpErrorDescription: LPWSTR; cchSize: DWORD; statusCode: UD2_STATUS; wLangID: LANGID): BOOL; cdecl;
70
begin
71
  // This function does not use non-generic status codes
72
  result := FALSE;
73
end;
74
 
75
exports
76
  PluginInterfaceID         name mnPluginInterfaceID,
77
  PluginIdentifier          name mnPluginIdentifier,
78
  PluginNameW               name mnPluginNameW,
79
  PluginVendorW             name mnPluginVendorW,
80
  PluginVersionW            name mnPluginVersionW,
81
  IdentificationMethodNameW name mnIdentificationMethodNameW,
82
  IdentificationStringW     name mnIdentificationStringW,
83
  CheckLicense              name mnCheckLicense,
84
  DescribeOwnStatusCodeW    name mnDescribeOwnStatusCodeW;
85
 
86
end.