From: Eric K. <ek...@rz...> - 2002-07-26 09:34:14
|
"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 > apps and 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 |