Exemplo n.º 1
0
void allocStrdup(bool bFree)
{
    int* leaked_memory = (int*)_strdup("_strdup() leaks!");
    int* leaked_memory_dbg = (int*)_strdup_dbg("_strdup_dbg() leaks!", _NORMAL_BLOCK, __FILE__, __LINE__);
    void* leaked_wmemory = (int*)_wcsdup(L"_wcsdup() leaks!");
    void* leaked_wmemory_dbg = (int*)_wcsdup_dbg(L"_wcsdup_dbg() leaks!", _NORMAL_BLOCK, __FILE__, __LINE__);
    if (bFree)
    {
        free(leaked_memory);
        _free_dbg(leaked_memory_dbg, _NORMAL_BLOCK);
        free(leaked_wmemory);
        _free_dbg(leaked_wmemory_dbg, _NORMAL_BLOCK);
    }
}
Exemplo n.º 2
0
_CRTIMP2_PURE _Collvec __CLRCALL_PURE_OR_CDECL _Getcoll()
{
        _Collvec coll;

        coll._Page = ___lc_collate_cp_func();
		auto __lc_collate = ___lc_handle_func()[LC_COLLATE];

		wchar_t _LocaleName[LOCALE_NAME_MAX_LENGTH];

		if (__lc_collate&&__acrt_LCIDToLocaleName(__lc_collate, _LocaleName, _countof(_LocaleName), 0))
			coll._LocaleName = _wcsdup_dbg(_LocaleName, _CRT_BLOCK, __FILE__, __LINE__);
		else
			coll._LocaleName = NULL;

        return (coll);
}
Exemplo n.º 3
0
wchar_t * __cdecl _wcsdup (
        const wchar_t * string
        )
{
        return _wcsdup_dbg(string, _NORMAL_BLOCK, NULL, 0);
}