Subversion Repositories userdetect2

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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