|
ULONG cb_TLS = sizeof( _TLS ) + sizeof( OSTLS ) + g_cbUserTLSSize; |
ostls in _TLS is a struct not a point so sizeof(_TLS) already contains sizeof(OSTLS). Why _TLS's instance ptls need duplicate OSTLS's memory? I tried to delete sizeof(OSTLS) and run the sample. Everything seems good.