Rev 69 | 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 | if GetLocalMACAddressList(sl2) <> NO_ERROR then |
31 | ec := GetLocalMACAddressList(sl2); |
- | 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 |
|
31 | begin |
38 | begin |
32 | result := UD2_STATUS_NOTAVAIL_API_CALL_FAILURE; |
39 | result := UD2_STATUS_NOTAVAIL_API_CALL_FAILURE; |
33 | Exit; |
40 | Exit; |
34 | end; |
41 | end; |
35 | 42 | ||
36 | // This procedure should not find any more MAC addresses... |
43 | // This procedure should not find any more MAC addresses... |
37 | GetLocalIPAddressList(sl); |
44 | GetLocalIPAddressList(sl); |
38 | for i := 0 to sl.Count-1 do |
45 | for i := 0 to sl.Count-1 do |
39 | begin |
46 | begin |
40 | ip := sl.Strings[i]; |
47 | ip := sl.Strings[i]; |
41 | if (GetMACAddress(ip, mac) = S_OK) and |
48 | ec := GetMACAddress(ip, mac); |
- | 49 | if ec = ERROR_NOT_SUPPORTED then |
|
- | 50 | begin |
|
- | 51 | result := UD2_STATUS_NOTAVAIL_OS_NOT_SUPPORTED; |
|
- | 52 | Exit; |
|
- | 53 | end |
|
- | 54 | else if (ec = S_OK) and |
|
42 | (mac <> '') and |
55 | (mac <> '') and |
43 | (sl2.IndexOf(mac) = -1) then |
56 | (sl2.IndexOf(mac) = -1) then |
44 | begin |
57 | begin |
45 | sl2.add(mac); |
58 | sl2.add(mac); |
46 | end; |
59 | end; |
Line 86... | Line 99... | ||
86 | function CheckLicense(lpReserved: LPVOID): UD2_STATUS; cdecl; |
99 | function CheckLicense(lpReserved: LPVOID): UD2_STATUS; cdecl; |
87 | begin |
100 | begin |
88 | result := UD2_STATUS_OK_LICENSED; |
101 | result := UD2_STATUS_OK_LICENSED; |
89 | end; |
102 | end; |
90 | 103 | ||
- | 104 | function DescribeOwnStatusCodeW(lpErrorDescription: LPWSTR; cchSize: DWORD; statusCode: UD2_STATUS; wLangID: LANGID): BOOL; cdecl; |
|
- | 105 | begin |
|
- | 106 | // This function does not use non-generic status codes |
|
- | 107 | result := FALSE; |
|
- | 108 | end; |
|
- | 109 | ||
91 | exports |
110 | exports |
92 | PluginInterfaceID name mnPluginInterfaceID, |
111 | PluginInterfaceID name mnPluginInterfaceID, |
93 | PluginIdentifier name mnPluginIdentifier, |
112 | PluginIdentifier name mnPluginIdentifier, |
94 | PluginNameW name mnPluginNameW, |
113 | PluginNameW name mnPluginNameW, |
95 | PluginVendorW name mnPluginVendorW, |
114 | PluginVendorW name mnPluginVendorW, |
96 | PluginVersionW name mnPluginVersionW, |
115 | PluginVersionW name mnPluginVersionW, |
97 | IdentificationMethodNameW name mnIdentificationMethodNameW, |
116 | IdentificationMethodNameW name mnIdentificationMethodNameW, |
98 | IdentificationStringW name mnIdentificationStringW, |
117 | IdentificationStringW name mnIdentificationStringW, |
99 | CheckLicense name mnCheckLicense; |
118 | CheckLicense name mnCheckLicense, |
- | 119 | DescribeOwnStatusCodeW name mnDescribeOwnStatusCodeW; |
|
100 | 120 | ||
101 | end. |
121 | end. |