_CrtSetDebugFillThreshold
검색 하거나 디버그 함수에 버퍼 채우기 동작을 제어 하는 임계값을 수정 합니다.
size_t _CrtSetDebugFillThreshold(
size_t _NewThreshold
);
매개 변수
- newThreshold
새 임계값입니다.
반환 값
이전 임계값입니다.
설명
디버그 버전의 몇 가지 보안 CRT 함수는 특수 문자로 전달 버퍼 채우기 (0xFD).이 경우 잘못 된 크기 함수에 전달 된 곳을 찾을 수 있습니다.불행 하 게도 또한 성능이 저하 됩니다.성능을 향상 시킬 수 있습니다 _CrtSetDebugFillThreshold 버퍼 채우기 임계값 보다 더 큰 버퍼를 사용 하지 않도록 설정 합니다.임계값을 0에 대 한 모든 버퍼를 비활성화 합니다.
기본 임계값입니다 SIZE_T_MAX.
영향을 받는 함수는 다음과 같습니다.
strncpy_s, _strncpy_s_l, wcsncpy_s, _wcsncpy_s_l, _mbsncpy_s, _mbsncpy_s_l
strncat_s, _strncat_s_l, wcsncat_s, _wcsncat_s_l, _mbsncat_s, _mbsncat_s_l
_strset_s, _strset_s_l, _wcsset_s, _wcsset_s_l, _mbsset_s, _mbsset_s_l
_strnset_s, _strnset_s_l, _wcsnset_s, _wcsnset_s_l, _mbsnset_s, _mbsnset_s_l
_strlwr_s, _strlwr_s_l, _mbslwr_s, _mbslwr_s_l, _wcslwr_s, _wcslwr_s_l
_strupr_s, _strupr_s_l, _mbsupr_s, _mbsupr_s_l, _wcsupr_s, _wcsupr_s_l
_itoa_s, _i64toa_s, _ui64toa_s, _itow_s, _i64tow_s, _ui64tow_s
요구 사항
루틴 |
필수 헤더 |
---|---|
_CrtSetDebugFillThreshold |
<crtdbg.h> |
더 많은 호환성 정보를 참조 하십시오. 호환성 소개에서 합니다.
라이브러리
디버그 버전의 C 런타임 라이브러리 만 합니다.
예제
// crt_crtsetdebugfillthreshold.cpp
// compile with: /MTd
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <crtdbg.h>
void Clear( char buff[], size_t size )
{
for( int i=0; i<size; ++i )
buff[i] = 0;
}
void Print( char buff[], size_t size )
{
for( int i=0; i<size; ++i )
printf( "%02x %c\n", (unsigned char)buff[i], buff[i] );
}
int main( void )
{
char buff[10];
printf( "With buffer-filling on:\n" );
strcpy_s( buff, _countof(buff), "howdy" );
Print( buff, _countof(buff) );
_CrtSetDebugFillThreshold( 0 );
printf( "With buffer-filling off:\n" );
Clear( buff, _countof(buff) );
strcpy_s( buff, _countof(buff), "howdy" );
Print( buff, _countof(buff) );
}
With buffer-filling on:
68 h
6f o
77 w
64 d
79 y
00
fd ²
fd ²
fd ²
fd ²
With buffer-filling off:
68 h
6f o
77 w
64 d
79 y
00
00
00
00
00
해당 .NET Framework 항목
해당 사항 없음. 표준 C 함수를 호출할 수 있습니다 PInvoke. 자세한 내용은 플랫폼 호출 예제.