Subversion Repositories userdetect2

Rev

Rev 69 | Rev 71 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69 Rev 70
Line 21... Line 21...
21
function IdentificationStringW(lpIdentifier: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl;
21
function IdentificationStringW(lpIdentifier: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl;
22
var
22
var
23
  sl, sl2: TStringList;
23
  sl, sl2: TStringList;
24
  i: integer;
24
  i: integer;
25
  ip, mac: string;
25
  ip, mac: string;
-
 
26
  ec: DWORD;
26
begin
27
begin
27
  sl := TStringList.Create;
28
  sl := TStringList.Create;
28
  sl2 := TStringList.Create;
29
  sl2 := TStringList.Create;
29
  try
30
  try
30
    GetGatewayIPAddressList(sl);
31
    ec := GetGatewayIPAddressList(sl);
-
 
32
    if ec = ERROR_NOT_SUPPORTED then
-
 
33
    begin
-
 
34
      result := UD2_STATUS_NOTAVAIL_OS_NOT_SUPPORTED;
-
 
35
      Exit;
-
 
36
    end
-
 
37
    else if ec <> ERROR_SUCCESS then
-
 
38
    begin
-
 
39
      result := UD2_STATUS_NOTAVAIL_API_CALL_FAILURE;
-
 
40
      Exit;
-
 
41
    end;
-
 
42
 
31
    for i := 0 to sl.Count-1 do
43
    for i := 0 to sl.Count-1 do
32
    begin
44
    begin
33
      ip := sl.Strings[i];
45
      ip := sl.Strings[i];
34
      if (GetMACAddress(ip, mac) = S_OK) and
46
      ec := GetMACAddress(ip, mac);
-
 
47
      if ec = ERROR_NOT_SUPPORTED then
-
 
48
      begin
-
 
49
        result := UD2_STATUS_NOTAVAIL_OS_NOT_SUPPORTED;
-
 
50
        Exit;
-
 
51
      end
-
 
52
      else if (ec = S_OK) and
35
         (mac <> '') and
53
              (mac <> '') and
36
         (sl2.IndexOf(mac) = -1) then
54
              (sl2.IndexOf(mac) = -1) then
37
      begin
55
      begin
38
        sl2.add(mac);
56
        sl2.add(mac);
39
      end;
57
      end;
Line 79... Line 97...
79
function CheckLicense(lpReserved: LPVOID): UD2_STATUS; cdecl;
97
function CheckLicense(lpReserved: LPVOID): UD2_STATUS; cdecl;
80
begin
98
begin
81
  result := UD2_STATUS_OK_LICENSED;
99
  result := UD2_STATUS_OK_LICENSED;
82
end;
100
end;
83
 
101
 
-
 
102
function DescribeOwnStatusCodeW(lpErrorDescription: LPWSTR; cchSize: DWORD; statusCode: UD2_STATUS; wLangID: LANGID): BOOL; cdecl;
-
 
103
begin
-
 
104
  // This function does not use non-generic status codes
-
 
105
  result := FALSE;
-
 
106
end;
-
 
107
 
84
exports
108
exports
85
  PluginInterfaceID         name mnPluginInterfaceID,
109
  PluginInterfaceID         name mnPluginInterfaceID,
86
  PluginIdentifier          name mnPluginIdentifier,
110
  PluginIdentifier          name mnPluginIdentifier,
87
  PluginNameW               name mnPluginNameW,
111
  PluginNameW               name mnPluginNameW,
88
  PluginVendorW             name mnPluginVendorW,
112
  PluginVendorW             name mnPluginVendorW,
89
  PluginVersionW            name mnPluginVersionW,
113
  PluginVersionW            name mnPluginVersionW,
90
  IdentificationMethodNameW name mnIdentificationMethodNameW,
114
  IdentificationMethodNameW name mnIdentificationMethodNameW,
91
  IdentificationStringW     name mnIdentificationStringW,
115
  IdentificationStringW     name mnIdentificationStringW,
92
  CheckLicense              name mnCheckLicense;
116
  CheckLicense              name mnCheckLicense,
-
 
117
  DescribeOwnStatusCodeW    name mnDescribeOwnStatusCodeW;
93
 
118
 
94
end.
119
end.