Re: Adding L defines to include files ?

2006-09-01 Thread Marcus Meissner
On Fri, Sep 01, 2006 at 09:43:40AM +0200, Paul Vriens wrote:
 Hi,
 
 I'm currently dealing with the DllRegister part of wintrust. One of it's
 include files (softpub.h) on Windows has:
 
 #define SP_POLICY_PROVIDER_DLL_NAME LWINTRUST.DLL
 #define SP_INIT_FUNCTIONLSoftpubInitialize
 #define SP_OBJTRUST_FUNCTIONLSoftpubLoadMessage
 #define SP_SIGTRUST_FUNCTIONLSoftpubLoadSignature
 #define SP_CHKCERT_FUNCTION LSoftpubCheckCert
 #define SP_FINALPOLICY_FUNCTION LSoftpubAuthenticode
 #define SP_CLEANUPPOLICY_FUNCTION   LSoftpubCleanup
 
 should we do the same?
 
 I've seen several occurrences of these in our own include files, so one
 should think there is no harm.

They won't work when used in WINE.

Lxxx usually gives a strings with 4 byte characters instead of the
expect 2.

Ciao, Marcus




Re: Adding L defines to include files ?

2006-09-01 Thread Paul Vriens
On Fri, 2006-09-01 at 10:06 +0200, Marcus Meissner wrote:
 On Fri, Sep 01, 2006 at 09:43:40AM +0200, Paul Vriens wrote:
  Hi,
  
  I'm currently dealing with the DllRegister part of wintrust. One of it's
  include files (softpub.h) on Windows has:
  
  #define SP_POLICY_PROVIDER_DLL_NAME LWINTRUST.DLL
  #define SP_INIT_FUNCTIONLSoftpubInitialize
  #define SP_OBJTRUST_FUNCTIONLSoftpubLoadMessage
  #define SP_SIGTRUST_FUNCTIONLSoftpubLoadSignature
  #define SP_CHKCERT_FUNCTION LSoftpubCheckCert
  #define SP_FINALPOLICY_FUNCTION LSoftpubAuthenticode
  #define SP_CLEANUPPOLICY_FUNCTION   LSoftpubCleanup
  
  should we do the same?
  
  I've seen several occurrences of these in our own include files, so one
  should think there is no harm.
 
 They won't work when used in WINE.
 
 Lxxx usually gives a strings with 4 byte characters instead of the
 expect 2.
 
 Ciao, Marcus
 
I'm only talking about the #defines. I've seen several cases in our
code-base where we use these sort of defines (sometimes we needed to
cast them when used).

If we shouldn't use these, is it OK if I instead do something like:

static WCHAR SP_POLICY_PROVIDER_DLL_NAME[] = 
{'W','I','N','T','R','U','S','T','.','D','L','L', 0};

but then not in the include file? Or should I then use a different name
for the variable?

Cheers,

Paul.







Re: Adding L defines to include files ?

2006-09-01 Thread Frank Richter
On 01.09.2006 09:43, Paul Vriens wrote:
 I've seen several occurrences of these in our own include files, so one
 should think there is no harm.

You could look how e.g. the WC_* macros are defined in commctrl.h.

-f.r.