FORCEINLINE VOID RtlInitLargeString( OUT PLARGE_STRING plstr, LPCVOID psz, BOOL bUnicode) { if(bUnicode) { RtlInitLargeUnicodeString((PLARGE_UNICODE_STRING)plstr, (PWSTR)psz, 0); } else { RtlInitLargeAnsiString((PLARGE_ANSI_STRING)plstr, (PSTR)psz, 0); } }
BOOL FASTCALL DefSetText(HWND hWnd, PCWSTR String, BOOL Ansi) { BOOL Ret; LARGE_STRING lsString; if ( String ) { if ( Ansi ) RtlInitLargeAnsiString((PLARGE_ANSI_STRING)&lsString, (PCSZ)String, 0); else RtlInitLargeUnicodeString((PLARGE_UNICODE_STRING)&lsString, String, 0); } Ret = NtUserDefSetText(hWnd, (String ? &lsString : NULL)); if (Ret) IntNotifyWinEvent(EVENT_OBJECT_NAMECHANGE, hWnd, OBJID_WINDOW, CHILDID_SELF, 0); return Ret; }