Rev 68 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 68 | Rev 69 | ||
---|---|---|---|
Line 16... | Line 16... | ||
16 | function PluginIdentifier: TGUID; cdecl; |
16 | function PluginIdentifier: TGUID; cdecl; |
17 | begin |
17 | begin |
18 | result := PLUGIN_GUID; |
18 | result := PLUGIN_GUID; |
19 | end; |
19 | end; |
20 | 20 | ||
21 | function IdentificationStringW(lpIdentifier: LPWSTR; cchSize: DWORD): UD2_STATUSCODE; 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 | begin |
26 | begin |
27 | sl := TStringList.Create; |
27 | sl := TStringList.Create; |
28 | sl2 := TStringList.Create; |
28 | sl2 := TStringList.Create; |
29 | try |
29 | try |
30 | if GetLocalMACAddressList(sl2) <> NO_ERROR then |
30 | if GetLocalMACAddressList(sl2) <> NO_ERROR then |
31 | begin |
31 | begin |
32 | result := UD2_STATUS_OK; // we assume that we just don't have any data |
32 | result := UD2_STATUS_NOTAVAIL_API_CALL_FAILURE; |
33 | Exit; |
33 | Exit; |
34 | end; |
34 | end; |
35 | 35 | ||
36 | // This procedure should not find any more MAC addresses... |
36 | // This procedure should not find any more MAC addresses... |
37 | GetLocalIPAddressList(sl); |
37 | GetLocalIPAddressList(sl); |
Line 43... | Line 43... | ||
43 | (sl2.IndexOf(mac) = -1) then |
43 | (sl2.IndexOf(mac) = -1) then |
44 | begin |
44 | begin |
45 | sl2.add(mac); |
45 | sl2.add(mac); |
46 | end; |
46 | end; |
47 | end; |
47 | end; |
48 | result := WriteStringListToPointerW(lpIdentifier, cchSize, sl2); |
48 | result := UD2_WriteStringListToPointerW(lpIdentifier, cchSize, sl2); |
49 | finally |
49 | finally |
50 | sl.Free; |
50 | sl.Free; |
51 | sl2.Free; |
51 | sl2.Free; |
52 | end; |
52 | end; |
53 | end; |
53 | end; |
54 | 54 | ||
55 | function PluginNameW(lpPluginName: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUSCODE; cdecl; |
55 | function PluginNameW(lpPluginName: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
56 | var |
56 | var |
57 | stPluginName: WideString; |
57 | stPluginName: WideString; |
58 | primaryLangID: Byte; |
58 | primaryLangID: Byte; |
59 | begin |
59 | begin |
60 | primaryLangID := wLangID and $00FF; |
60 | primaryLangID := wLangID and $00FF; |
61 | if primaryLangID = LANG_GERMAN then |
61 | if primaryLangID = LANG_GERMAN then |
62 | stPluginName := 'MAC-Adressen' |
62 | stPluginName := 'MAC-Adressen' |
63 | else |
63 | else |
64 | stPluginName := 'MAC addresses'; |
64 | stPluginName := 'MAC addresses'; |
65 | result := WritePascalStringToPointerW(lpPluginName, cchSize, stPluginName); |
65 | result := UD2_WritePascalStringToPointerW(lpPluginName, cchSize, stPluginName); |
66 | end; |
66 | end; |
67 | 67 | ||
68 | function PluginVendorW(lpPluginVendor: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUSCODE; cdecl; |
68 | function PluginVendorW(lpPluginVendor: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
69 | begin |
69 | begin |
70 | result := WritePascalStringToPointerW(lpPluginVendor, cchSize, 'ViaThinkSoft'); |
70 | result := UD2_WritePascalStringToPointerW(lpPluginVendor, cchSize, 'ViaThinkSoft'); |
71 | end; |
71 | end; |
72 | 72 | ||
73 | function PluginVersionW(lpPluginVersion: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUSCODE; cdecl; |
73 | function PluginVersionW(lpPluginVersion: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
74 | begin |
74 | begin |
75 | result := WritePascalStringToPointerW(lpPluginVersion, cchSize, '1.0'); |
75 | result := UD2_WritePascalStringToPointerW(lpPluginVersion, cchSize, '1.0'); |
76 | end; |
76 | end; |
77 | 77 | ||
78 | function IdentificationMethodNameW(lpIdentificationMethodName: LPWSTR; cchSize: DWORD): UD2_STATUSCODE; cdecl; |
78 | function IdentificationMethodNameW(lpIdentificationMethodName: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl; |
79 | var |
79 | var |
80 | stIdentificationMethodName: WideString; |
80 | stIdentificationMethodName: WideString; |
81 | begin |
81 | begin |
82 | stIdentificationMethodName := 'LAN_MAC'; |
82 | stIdentificationMethodName := 'LAN_MAC'; |
83 | result := WritePascalStringToPointerW(lpIdentificationMethodName, cchSize, stIdentificationMethodName); |
83 | result := UD2_WritePascalStringToPointerW(lpIdentificationMethodName, cchSize, stIdentificationMethodName); |
84 | end; |
84 | end; |
85 | 85 | ||
86 | function CheckLicense(lpReserved: LPVOID): UD2_STATUSCODE; cdecl; |
86 | function CheckLicense(lpReserved: LPVOID): UD2_STATUS; cdecl; |
87 | begin |
87 | begin |
88 | result := UD2_STATUS_OK; |
88 | result := UD2_STATUS_OK_LICENSED; |
89 | end; |
89 | end; |
90 | 90 | ||
91 | exports |
91 | exports |
92 | PluginInterfaceID name mnPluginInterfaceID, |
92 | PluginInterfaceID name mnPluginInterfaceID, |
93 | PluginIdentifier name mnPluginIdentifier, |
93 | PluginIdentifier name mnPluginIdentifier, |