Rev 71 | 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 ComputerName; |
2 | |||
3 | uses |
||
4 | Windows, |
||
5 | SysUtils, |
||
6 | Classes, |
||
81 | daniel-mar | 7 | MiscUtils, |
68 | daniel-mar | 8 | UD2_PluginIntf in '..\UD2_PluginIntf.pas', |
71 | daniel-mar | 9 | UD2_PluginUtils in '..\UD2_PluginUtils.pas', |
10 | UD2_PluginStatus in '..\UD2_PluginStatus.pas'; |
||
68 | daniel-mar | 11 | |
12 | {$R *.res} |
||
13 | |||
14 | const |
||
15 | PLUGIN_GUID: TGUID = '{2AD004FF-6BFD-4038-B75B-9527DEABA28F}'; |
||
16 | |||
17 | function PluginIdentifier: TGUID; cdecl; |
||
18 | begin |
||
19 | result := PLUGIN_GUID; |
||
20 | end; |
||
21 | |||
69 | daniel-mar | 22 | function IdentificationStringW(lpIdentifier: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl; |
68 | daniel-mar | 23 | var |
24 | stIdentifier: WideString; |
||
25 | begin |
||
26 | stIdentifier := GetComputerName; |
||
69 | daniel-mar | 27 | result := UD2_WritePascalStringToPointerW(lpIdentifier, cchSize, stIdentifier); |
68 | daniel-mar | 28 | end; |
29 | |||
69 | daniel-mar | 30 | function PluginNameW(lpPluginName: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
68 | daniel-mar | 31 | var |
32 | stPluginName: WideString; |
||
33 | primaryLangID: Byte; |
||
34 | begin |
||
35 | primaryLangID := wLangID and $00FF; |
||
36 | if primaryLangID = LANG_GERMAN then |
||
37 | stPluginName := 'Computer-Name' |
||
38 | else |
||
39 | stPluginName := 'Computer name'; |
||
69 | daniel-mar | 40 | result := UD2_WritePascalStringToPointerW(lpPluginName, cchSize, stPluginName); |
68 | daniel-mar | 41 | end; |
42 | |||
69 | daniel-mar | 43 | function PluginVendorW(lpPluginVendor: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
68 | daniel-mar | 44 | begin |
69 | daniel-mar | 45 | result := UD2_WritePascalStringToPointerW(lpPluginVendor, cchSize, 'ViaThinkSoft'); |
68 | daniel-mar | 46 | end; |
47 | |||
69 | daniel-mar | 48 | function PluginVersionW(lpPluginVersion: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
68 | daniel-mar | 49 | begin |
69 | daniel-mar | 50 | result := UD2_WritePascalStringToPointerW(lpPluginVersion, cchSize, '1.0'); |
68 | daniel-mar | 51 | end; |
52 | |||
69 | daniel-mar | 53 | function IdentificationMethodNameW(lpIdentificationMethodName: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl; |
68 | daniel-mar | 54 | var |
55 | stIdentificationMethodName: WideString; |
||
56 | begin |
||
57 | stIdentificationMethodName := 'ComputerName'; |
||
69 | daniel-mar | 58 | result := UD2_WritePascalStringToPointerW(lpIdentificationMethodName, cchSize, stIdentificationMethodName); |
68 | daniel-mar | 59 | end; |
60 | |||
69 | daniel-mar | 61 | function CheckLicense(lpReserved: LPVOID): UD2_STATUS; cdecl; |
68 | daniel-mar | 62 | begin |
69 | daniel-mar | 63 | result := UD2_STATUS_OK_LICENSED; |
68 | daniel-mar | 64 | end; |
65 | |||
70 | daniel-mar | 66 | function DescribeOwnStatusCodeW(lpErrorDescription: LPWSTR; cchSize: DWORD; statusCode: UD2_STATUS; wLangID: LANGID): BOOL; cdecl; |
67 | begin |
||
68 | // This function does not use non-generic status codes |
||
69 | result := FALSE; |
||
70 | end; |
||
71 | |||
68 | daniel-mar | 72 | exports |
73 | PluginInterfaceID name mnPluginInterfaceID, |
||
74 | PluginIdentifier name mnPluginIdentifier, |
||
75 | PluginNameW name mnPluginNameW, |
||
76 | PluginVendorW name mnPluginVendorW, |
||
77 | PluginVersionW name mnPluginVersionW, |
||
78 | IdentificationMethodNameW name mnIdentificationMethodNameW, |
||
79 | IdentificationStringW name mnIdentificationStringW, |
||
70 | daniel-mar | 80 | CheckLicense name mnCheckLicense, |
81 | DescribeOwnStatusCodeW name mnDescribeOwnStatusCodeW; |
||
68 | daniel-mar | 82 | |
83 | end. |