Subversion Repositories userdetect2

Rev

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

Rev Author Line No. Line
73 daniel-mar 1
library AccountSID;
2
 
3
uses
4
  Windows,
5
  SysUtils,
6
  Classes,
7
  SPgetsid,
8
  UD2_PluginIntf in '..\UD2_PluginIntf.pas',
9
  UD2_PluginUtils in '..\UD2_PluginUtils.pas',
10
  UD2_PluginStatus in '..\UD2_PluginStatus.pas';
11
 
12
{$R *.res}
13
 
14
const
15
  PLUGIN_GUID: TGUID = '{96374FFC-0A55-46B4-826B-CFD702FB24A2}';
16
 
17
function PluginIdentifier: TGUID; cdecl;
18
begin
19
  result := PLUGIN_GUID;
20
end;
21
 
22
function IdentificationStringW(lpIdentifier: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl;
23
var
24
  stIdentifier: WideString;
25
begin
26
  stIdentifier := GetCurrentUserSid;
27
  result := UD2_WritePascalStringToPointerW(lpIdentifier, cchSize, stIdentifier);
28
end;
29
 
30
function PluginNameW(lpPluginName: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl;
31
var
32
  stPluginName: WideString;
33
  primaryLangID: Byte;
34
begin
35
  primaryLangID := wLangID and $00FF;
36
  if primaryLangID = LANG_GERMAN then
37
    stPluginName := 'SID des Benutzerkontos'
38
  else
39
    stPluginName := 'Account Security Identifier';
40
  result := UD2_WritePascalStringToPointerW(lpPluginName, cchSize, stPluginName);
41
end;
42
 
43
function PluginVendorW(lpPluginVendor: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl;
44
begin
45
  result := UD2_WritePascalStringToPointerW(lpPluginVendor, cchSize, 'ViaThinkSoft');
46
end;
47
 
48
function PluginVersionW(lpPluginVersion: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl;
49
begin
50
  result := UD2_WritePascalStringToPointerW(lpPluginVersion, cchSize, '1.0');
51
end;
52
 
53
function IdentificationMethodNameW(lpIdentificationMethodName: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl;
54
var
55
  stIdentificationMethodName: WideString;
56
begin
57
  stIdentificationMethodName := 'AccountSID';
58
  result := UD2_WritePascalStringToPointerW(lpIdentificationMethodName, cchSize, stIdentificationMethodName);
59
end;
60
 
61
function CheckLicense(lpReserved: LPVOID): UD2_STATUS; cdecl;
62
begin
63
  result := UD2_STATUS_OK_LICENSED;
64
end;
65
 
66
function DescribeOwnStatusCodeW(lpErrorDescription: LPWSTR; cchSize: DWORD; statusCode: UD2_STATUS; wLangID: LANGID): BOOL; cdecl;
67
begin
68
  // This function does not use non-generic status codes
69
  result := FALSE;
70
end;
71
 
72
exports
73
  PluginInterfaceID         name mnPluginInterfaceID,
74
  PluginIdentifier          name mnPluginIdentifier,
75
  PluginNameW               name mnPluginNameW,
76
  PluginVendorW             name mnPluginVendorW,
77
  PluginVersionW            name mnPluginVersionW,
78
  IdentificationMethodNameW name mnIdentificationMethodNameW,
79
  IdentificationStringW     name mnIdentificationStringW,
80
  CheckLicense              name mnCheckLicense,
81
  DescribeOwnStatusCodeW    name mnDescribeOwnStatusCodeW;
82
 
83
end.