Waitrud Weber’s blog

things and reminders for memories

3d: WindowsAPI: Windows-make: How do we face memories problem: Print massages: DrawTextA: we should use: which ensured ASCII:

Ensured ASCII, we sould use the DrawTextA in Visual Studio 2019.

---

/*
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

#define _In_bypassable_reads_or_z_(size) \
	_When_(((size) == -1) || (_String_length_(_Curr_) <  (size)), _In_z_) \
	_When_(((size) != -1) && (_String_length_(_Curr_) >= (size)), _In_reads_(size))

#define _Inout_grows_updates_bypassable_or_z_(size, grows) \
	_When_(((size) == -1) || (_String_length_(_Curr_) <  (size)), _Pre_z_ _Pre_valid_ _Out_writes_z_(_String_length_(_Curr_) + (grows))) \
	_When_(((size) != -1) && (_String_length_(_Curr_) >= (size)), _Pre_count_(size) _Pre_valid_ _Out_writes_z_((size) + (grows)))

WINUSERAPI
_Success_(return)
int
WINAPI
DrawTextA(
	_In_ HDC hdc,
	_When_((format & DT_MODIFYSTRING), _At_((LPSTR)lpchText, _Inout_grows_updates_bypassable_or_z_(cchText, 4)))
	_When_((!(format & DT_MODIFYSTRING)), _In_bypassable_reads_or_z_(cchText))
	LPCSTR lpchText,
	_In_ int cchText,
	_Inout_ LPRECT lprc,
	_In_ UINT format);
WINUSERAPI
_Success_(return)
int
WINAPI
DrawTextW(
	_In_ HDC hdc,
	_When_((format & DT_MODIFYSTRING), _At_((LPWSTR)lpchText, _Inout_grows_updates_bypassable_or_z_(cchText, 4)))
	_When_((!(format & DT_MODIFYSTRING)), _In_bypassable_reads_or_z_(cchText))
	LPCWSTR lpchText,
	_In_ int cchText,
	_Inout_ LPRECT lprc,
	_In_ UINT format);
#ifdef UNICODE
#define DrawText  DrawTextW
*/

/*
int DrawText(
	HDC     hdc,
	LPCTSTR lpchText,
	int     cchText,
	LPRECT  lprc,
	UINT    format
);
*/

---