Windows中的TLS [英] TLS in windows

查看:273
本文介绍了Windows中的TLS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码段是否合法使用TLS?但是,应用程序验证程序没有在控制台应用程序上抱怨。

Is the following code snippet legal way of working with TLS ? However Application Verifier did not complain on console app.

如果我通过dll应用验证程序提取代码片段抱怨TLS泄漏,有任何原因。

If I pull the code snippet through a dll app verifier complains about TLS leak, Any reason for this.

int _tmain(int argc,_TCHAR * argv [])

{



LPVOID lpvoid;

DWORD indx = TlsAlloc();

lpvoid = LocalAlloc(LPTR,256);

TlsSetValue(indx,lpvoid);

int _tmain(int argc, _TCHAR* argv[])
{

LPVOID lpvoid;
DWORD indx = TlsAlloc();
lpvoid = LocalAlloc(LPTR, 256);
TlsSetValue(indx, lpvoid);

TlsSetValue(indx ,NULL);

LocalFree(lpvoid);



}

TlsSetValue(indx, NULL);
LocalFree(lpvoid);

}

推荐答案

也许是寻找TlsFree?
Maybe its looking for TlsFree?


这篇关于Windows中的TLS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆