wstr vs ptr in spec files

Patrik Stridvall ps at
Thu Sep 12 10:05:21 CDT 2002

> When should I use wstr and when ptr for wide strings
> in the spec files functions specification?
> Looking at existing files I see that LPCWSTR type is
> usually mapped to wstr, 

It should almost always map to wstr.

> but LPWSTR is sometimes mapped
> to ptr, sometimes to wstr.

As the general rule it depends on whether the
parameter is IN, OUT or IN/OUT.

IN: wstr
OUT: ptr
IN/OUT: wstr

PS. It is for debug messages. If the parameter is OUT
it might not be initialized as thus it should not
be printed as a string (in this case a wide string).

More information about the wine-devel mailing list