Subversion Repositories delphiutils

Rev

Rev 68 | 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 LAN_IP;
2
 
3
uses
4
  Windows,
5
  SysUtils,
6
  Classes,
7
  UD2_PluginIntf in '..\UD2_PluginIntf.pas',
8
  UD2_PluginUtils in '..\UD2_PluginUtils.pas',
9
  NetworkUtils in 'NetworkUtils.pas';
10
 
11
{$R *.res}
12
 
13
const
14
  PLUGIN_GUID: TGUID = '{3C7D83F7-742C-4B3C-9F63-D12DEB442D27}';
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
  sl: TStringList;
24
begin
25
  sl := TStringList.Create;
26
  try
27
    GetLocalIPAddressList(sl);
69 daniel-mar 28
    result := UD2_WriteStringListToPointerW(lpIdentifier, cchSize, sl);
68 daniel-mar 29
  finally
30
    sl.Free;
31
  end;
32
end;
33
 
69 daniel-mar 34
function PluginNameW(lpPluginName: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl;
68 daniel-mar 35
var
36
  stPluginName: WideString;
37
  primaryLangID: Byte;
38
begin
39
  primaryLangID := wLangID and $00FF;
40
  if primaryLangID = LANG_GERMAN then
41
    stPluginName := 'IP-Adressen'
42
  else
43
    stPluginName := 'IP addresses';
69 daniel-mar 44
  result := UD2_WritePascalStringToPointerW(lpPluginName, cchSize, stPluginName);
68 daniel-mar 45
end;
46
 
69 daniel-mar 47
function PluginVendorW(lpPluginVendor: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl;
68 daniel-mar 48
begin
69 daniel-mar 49
  result := UD2_WritePascalStringToPointerW(lpPluginVendor, cchSize, 'ViaThinkSoft');
68 daniel-mar 50
end;
51
 
69 daniel-mar 52
function PluginVersionW(lpPluginVersion: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl;
68 daniel-mar 53
begin
69 daniel-mar 54
  result := UD2_WritePascalStringToPointerW(lpPluginVersion, cchSize, '1.0');
68 daniel-mar 55
end;
56
 
69 daniel-mar 57
function IdentificationMethodNameW(lpIdentificationMethodName: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl;
68 daniel-mar 58
var
59
  stIdentificationMethodName: WideString;
60
begin
61
  stIdentificationMethodName := 'LAN_IP';
69 daniel-mar 62
  result := UD2_WritePascalStringToPointerW(lpIdentificationMethodName, cchSize, stIdentificationMethodName);
68 daniel-mar 63
end;
64
 
69 daniel-mar 65
function CheckLicense(lpReserved: LPVOID): UD2_STATUS; cdecl;
68 daniel-mar 66
begin
69 daniel-mar 67
  result := UD2_STATUS_OK_LICENSED;
68 daniel-mar 68
end;
69
 
70
exports
71
  PluginInterfaceID         name mnPluginInterfaceID,
72
  PluginIdentifier          name mnPluginIdentifier,
73
  PluginNameW               name mnPluginNameW,
74
  PluginVendorW             name mnPluginVendorW,
75
  PluginVersionW            name mnPluginVersionW,
76
  IdentificationMethodNameW name mnIdentificationMethodNameW,
77
  IdentificationStringW     name mnIdentificationStringW,
78
  CheckLicense              name mnCheckLicense;
79
 
80
end.