Subversion Repositories userdetect2

Rev

Rev 69 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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