From: Kohn E. D. <em...@cs...> - 2002-07-26 23:14:50
|
While in C, wchar_t is just a typedef for something that is able to hold a wide character (such as unsigned short), in C++ wchar_t is a distinct type, built into the language. In my opinion, the definition of PWSTR is broken (it should have been a typedef to wchar_t*) Emil On Fri, 26 Jul 2002, Eric Kohl wrote: > > "Robert K." <ro...@ko...> wrote: > > > > Where is my Fault? > > > > NT::UNICODE_STRING unistr; > > NT::NTSTATUS stat; > > NT::OBJECT_ATTRIBUTES oa = {sizeof oa, 0, &unistr, > > NT::OBJ_CASE_INSENSITIVE, 0, 0}; > > > > // init String still bevore use. > > NT::RtlInitUnicodeString( &unistr, L"\\\\.\\Beep" ); > > ---------------------------^ > > This results in > > misc/error.cpp:36: passing `const __wchar_t *' as argument 2 of > > `NT::RtlInitUnicodeString(NT::_UNICODE_STRING *, const short unsigned > > int *)' > > IFAICS, 'const __wchar_t *' and 'const short unsigned int*' are different > types. You might have to use > (PWSTR)L"\\\\.\\Beep" instead. > > > > Is the kernel32.dll written in that way that one can run both Unicode > > appsand ANSI ones? > > cos it doesn't look like. > > Yes, kernel32.dll supports UNICODE and ANSI apps. For example, have a look > at the function CreateProcess(). A UNICODE application will call > CreateProcessW() and an ANSI application will call CreateProcessA(). > Kernel32.dll implements both functions. > > Eric > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > reactos-kernel mailing list > rea...@li... > https://lists.sourceforge.net/lists/listinfo/reactos-kernel > |