Rev 81 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
81 | daniel-mar | 1 | library HomeShare; |
2 | |||
3 | uses |
||
4 | Windows, |
||
5 | SysUtils, |
||
6 | Classes, |
||
7 | MiscUtils, |
||
8 | UD2_PluginIntf in '..\UD2_PluginIntf.pas', |
||
9 | UD2_PluginUtils in '..\UD2_PluginUtils.pas', |
||
10 | UD2_PluginStatus in '..\UD2_PluginStatus.pas'; |
||
11 | |||
12 | {$R *.res} |
||
13 | |||
14 | const |
||
15 | PLUGIN_GUID: TGUID = '{A04AD926-474D-40CC-A29D-64AE22AFDDAF}'; |
||
16 | |||
17 | function PluginIdentifier: TGUID; cdecl; |
||
18 | begin |
||
19 | result := PLUGIN_GUID; |
||
20 | end; |
||
21 | |||
22 | function IdentificationStringW(lpIdentifier: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl; |
||
23 | var |
||
24 | stIdentifier: WideString; |
||
25 | begin |
||
82 | daniel-mar | 26 | try |
27 | stIdentifier := ExpandEnvironmentStrings('%HOMESHARE%'); |
||
28 | if stIdentifier = '%HOMESHARE%' then stIdentifier := ''; |
||
29 | result := UD2_WritePascalStringToPointerW(lpIdentifier, cchSize, stIdentifier); |
||
30 | except |
||
31 | on E: Exception do result := UD2_STATUS_HandleException(E); |
||
32 | end; |
||
81 | daniel-mar | 33 | end; |
34 | |||
35 | function PluginNameW(lpPluginName: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
||
36 | var |
||
37 | stPluginName: WideString; |
||
38 | primaryLangID: Byte; |
||
39 | begin |
||
40 | primaryLangID := wLangID and $00FF; |
||
41 | if primaryLangID = LANG_GERMAN then |
||
42 | stPluginName := 'Tauschverzeichnis' |
||
43 | else |
||
44 | stPluginName := 'Home share directory'; |
||
45 | result := UD2_WritePascalStringToPointerW(lpPluginName, cchSize, stPluginName); |
||
46 | end; |
||
47 | |||
48 | function PluginVendorW(lpPluginVendor: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
||
49 | begin |
||
50 | result := UD2_WritePascalStringToPointerW(lpPluginVendor, cchSize, 'ViaThinkSoft'); |
||
51 | end; |
||
52 | |||
53 | function PluginVersionW(lpPluginVersion: LPWSTR; cchSize: DWORD; wLangID: LANGID): UD2_STATUS; cdecl; |
||
54 | begin |
||
55 | result := UD2_WritePascalStringToPointerW(lpPluginVersion, cchSize, '1.0'); |
||
56 | end; |
||
57 | |||
58 | function IdentificationMethodNameW(lpIdentificationMethodName: LPWSTR; cchSize: DWORD): UD2_STATUS; cdecl; |
||
59 | var |
||
60 | stIdentificationMethodName: WideString; |
||
61 | begin |
||
62 | stIdentificationMethodName := 'HomeShare'; |
||
63 | result := UD2_WritePascalStringToPointerW(lpIdentificationMethodName, cchSize, stIdentificationMethodName); |
||
64 | end; |
||
65 | |||
66 | function CheckLicense(lpReserved: LPVOID): UD2_STATUS; cdecl; |
||
67 | begin |
||
68 | result := UD2_STATUS_OK_LICENSED; |
||
69 | end; |
||
70 | |||
71 | function DescribeOwnStatusCodeW(lpErrorDescription: LPWSTR; cchSize: DWORD; statusCode: UD2_STATUS; wLangID: LANGID): BOOL; cdecl; |
||
72 | begin |
||
73 | // This function does not use non-generic status codes |
||
74 | result := FALSE; |
||
75 | end; |
||
76 | |||
77 | exports |
||
78 | PluginInterfaceID name mnPluginInterfaceID, |
||
79 | PluginIdentifier name mnPluginIdentifier, |
||
80 | PluginNameW name mnPluginNameW, |
||
81 | PluginVendorW name mnPluginVendorW, |
||
82 | PluginVersionW name mnPluginVersionW, |
||
83 | IdentificationMethodNameW name mnIdentificationMethodNameW, |
||
84 | IdentificationStringW name mnIdentificationStringW, |
||
85 | CheckLicense name mnCheckLicense, |
||
86 | DescribeOwnStatusCodeW name mnDescribeOwnStatusCodeW; |
||
87 | |||
88 | end. |