ReactOS 0.4.16-dev-2104-gb84fa49
wcsdup.cpp File Reference
#include <corecrt_internal.h>
#include <malloc.h>
#include <string.h>
Include dependency graph for wcsdup.cpp:

Go to the source code of this file.

Functions

wchar_t *__cdecl _wcsdup (wchar_t const *string)
 

Function Documentation

◆ _wcsdup()

wchar_t *__cdecl _wcsdup ( wchar_t const string)

Definition at line 33 of file wcsdup.cpp.

38{
39 if (string == nullptr)
40 return nullptr;
41
42 size_t const size_in_elements = wcslen(string) + 1;
43
44#ifdef _DEBUG
45 wchar_t* const memory = static_cast<wchar_t*>(_malloc_dbg(
46 size_in_elements * sizeof(wchar_t),
50#else
51 wchar_t* const memory = static_cast<wchar_t*>(malloc(
52 size_in_elements * sizeof(wchar_t)));
53#endif
54
55 if (memory == nullptr)
56 return nullptr;
57
59 return memory;
60}
#define _ERRCHECK(e)
size_t const size_in_elements
int const char const *const int const line_number
Definition: debug_heap.cpp:499
#define malloc
Definition: debug_ros.c:4
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
#define _malloc_dbg(s, t, f, l)
Definition: crtdbg.h:126
_Out_opt_ size_t *const Character const *const int const block_use
Definition: getenv.cpp:258
#define wcscpy_s(d, l, s)
Definition: utility.h:201
static char memory[1024 *256]
Definition: process.c:116
static LPCWSTR file_name
Definition: protocol.c:147

Referenced by __wgetmainargs(), _wgetdcwd(), _wtempnam(), AddEntryToList(), AllocStrCat(), CDirectoryItem::CDirectoryItem(), CreateStyle(), CreateTheme(), crt_process_init(), CConfig::Default(), DllMain(), DoSanitizeClipboard(), DuplicateEnvironment(), FindLabel(), ATL::CW2WEX< t_nBufferLength >::Init(), InputList_Add(), InputList_Create(), LayoutList_AppendNode(), LoadEventLabel(), CNewMenu::LoadItem(), LoadSoundFiles(), LocaleList_Append(), msvcrt_init_args(), CDirectoryItem::operator=(), NtObjDirectory::read_directory(), RegFindRecurse(), RegFindWalk(), SetEnv(), CDirectoryItem::SetPath(), SoundsDlgProc(), wcsdup(), wexpand(), and XCOPY_ParseCommandLine().