Subversion Repositories delphiutils

Rev

Rev 69 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

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