/********************************************************/ /* ntapi: Native API core library */ /* Copyright (C) 2013--2017 Z. Gilboa */ /* Released under GPLv2 and GPLv3; see COPYING.NTAPI. */ /********************************************************/ #include #include "ntapi_impl.h" void * __cdecl __ntapi_tt_aligned_block_memset( __in void * block, __in uintptr_t val, __in size_t bytes) { uintptr_t * ptr = (uintptr_t *)block; for (bytes/=sizeof(uintptr_t); bytes; bytes--) *ptr++=val; return block; } void * __cdecl __ntapi_tt_generic_memset( __in void * dst, __in uintptr_t val, __in size_t bytes) { char c; char * ch; size_t i; size_t abytes; if (!bytes) return dst; else if (!(bytes % sizeof(size_t)) && (!(uintptr_t)dst % sizeof(size_t))) return __ntapi_tt_aligned_block_memset( dst,val,bytes); c = (char)val; for (i=0; i