Adding L"" defines to include files ?
Paul Vriens
Paul.Vriens at xs4all.nl
Fri Sep 1 03:14:56 CDT 2006
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 L"WINTRUST.DLL"
> > #define SP_INIT_FUNCTION L"SoftpubInitialize"
> > #define SP_OBJTRUST_FUNCTION L"SoftpubLoadMessage"
> > #define SP_SIGTRUST_FUNCTION L"SoftpubLoadSignature"
> > #define SP_CHKCERT_FUNCTION L"SoftpubCheckCert"
> > #define SP_FINALPOLICY_FUNCTION L"SoftpubAuthenticode"
> > #define SP_CLEANUPPOLICY_FUNCTION L"SoftpubCleanup"
> >
> > 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.
>
> L"xxx" 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.
More information about the wine-devel
mailing list