随笔分类 - API
摘要:PowerShell是微软公司于2006年第四季度正式发布的. 它的出现标志着, 微软公司向服务器领域迈出了重要的一步, 拉近了与Unix, Linux等操作系统的距离. PowerShell的前身命名为Monad, 在2006年4月25日正式发布beta版时更名为PowerShell. PowerShell是一款基于对象的shell, 建立在.Net框架之上, 目前支持.Net Framew...
阅读全文
摘要:char *p =(char*)malloc(1024);p[1024]=1;pageheap /enable test.exe /fullchar *p =(char*)malloc(1023);p[1023]=1;pageheap /enable test.exe /unalignedchar *p=new char[1023];p[-1]='c';pageheap /enable test....
阅读全文
摘要:keybd_event(VK_NUMLOCK,0,0,0); keybd_event(VK_NUMLOCK ,0,KEYEVENTF_KEYUP,0);模拟按下NUMLOCKkeycode 0 =keycode 1 =keycode 2 =keycode 3 =keycode 4 =keycode 5 =keycode 6 =keycode 7 =keycode 8 = BackSpace Bac...
阅读全文
摘要:HANDLE hProcess =::OpenProcess(PROCESS_ALL_ACCESS,false,5196);char bufFullName[500]={0};::GetModuleFileNameEx((HMODULE)hProcess,NULL,bufFullName,sizeof(bufFullName));
阅读全文
摘要:C:\Program Files\Debugging Tools for Windows (x86)>symchk /r c:\windows\system32\kernel32.dll /s SRV*i:\sym\*http://msdl.microsoft.com/download/symbolssymchk /r c:\windows\system32 /s SRV*c:\symbol...
阅读全文
摘要:InterlockedCompareExchange属于互锁函数 类似的还有下面的几个 (1) LONG InterlockedExchangeAdd ( LPLONG Addend, LONG Increment ); Addend为长整型变量的地址,Increment为想要在Addend指向的长整型变量上增加的数值(可以是负数)。这个函数的主要作用是保证这个加操作为一个原子访问。 ...
阅读全文
摘要:[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug]"Debugger"="C:\\Program Files\\Microsoft Visual Studio\\Common\\MSDev98\\Bin\\MSDEV.EXE -p %ld -e %ld""UserDebuggerHotKey"=dwor...
阅读全文
摘要:ClearDirectory(const char* szPath) { if( szPath == NULL ) return; string strPath = szPath; if( strPath.at(strPath.length()-1) != '\\' ) strPath.append("\\"); string strSearch = strPath+"*";...
阅读全文
摘要:BOOL GetCurrentUserSid(std::string& strSID) { CCommonFunc func; DWORD dwProcessID = func.GetProcessIDFromName("explorer.exe"); if( 0 == dwProcessID ) { return FALSE; } #ifndef _RELEASE_WIN9X ...
阅读全文
摘要:PostThreadMessage的原型是这样的 BOOL PostThreadMessage( DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam ); PostThreadMessage可以用于线程之间的异步通讯,因为它不用等待调用者返回, 这也许是线程通讯中最简单的一种方法了。 但是要注意以下问题 1 ....
阅读全文
摘要:vista与2008的大小版本都是一样的6.0,要区分就要通过wProductType来识别! if( VerInfoEx.dwMajorVersion == 6 ) { if (VerInfoEx.wProductType == VER_NT_SERVER || VerInfoEx.wProductType == VER_NT_DOMAIN_CONTROLLER) retur...
阅读全文
摘要:#include<windows.h>intmain(intargc,char*argv[]){printf("DefineDosDevice!\n");//setBOOLrs=DefineDosDevice(DDD_RAW_TARGET_PATH,"U:","\\??\\D:\\DHCP");if(0){rs=DefineDosDevice(DDD_REMOVE_DEFINITION,"U:",NULL);}printf("rs=%d",rs);return0;}本地用户下创建 盘
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->chartemp[1024]={0};ZeroMemory(temp,sizeof(temp));intlen=WideCharToMultiByte(CP_ACP,0,vtProp.bstrVal,-1,temp,sizeof(temp),NULL,NULL);Code highlighting produced by Actipro CodeHighlighter (freeware)htt
阅读全文
摘要:该api的可以实现windows的无线客户端的网络参数配置(WlanSetProfile),连接指定的ap,断开连接和获得其他关于无线网络的信息(ssid,rssi等)。 WLAN_NOTIFICATION_CALLBACK WlanAllocateMemory WlanCloseHandle WlanConnect WlanDeleteProfile WlanDisconnect W...
阅读全文
摘要:本示例用多线程实现了一个ssl服务端和一个客户端。 服务端代码如下: #include #include #include #include #ifndef _WIN32 #include #include #include #include #include #include #else #include #include #endif #include "pthr...
阅读全文
摘要:#include void OnButton3() { USES_CONVERSION; DATE m_dt; _bstr_t bstrDate=__DATE__; VarDateFromStr(bstrDate, LANG_USER_DEFAULT, 0, &m_dt); _variant_t vTime; vTime=m_dt; SYSTEMTIME stTmp; ...
阅读全文
摘要:windbg[-serverServerOptions|-remoteClientOptions][-premoteSmartClientOptions][-?][-ee{masm|c++}][-clineslines][-b][-d][-aExtension][-eEvent][-failinc][-g][-G][-hd][-j][-n][-noshell][-o][-Q|-QY][-QS|-Q...
阅读全文
摘要:【Pascal保留字/关键字列表】 关键字 作用 关键字 作用 ...
阅读全文
摘要:这些都是对路径,文件名等字符串的分析提取函数 This section describes the Microsoft Windows Shell path handling functions. The programming elements explained in this documentation are exported by Shlwapi.dll and defined in S...
阅读全文
摘要:1.创建dll工程 2.删除cpp,h文件 3.添加连接选项/noentry dll部分完成 app部分 1.添加成员变量 HINSTANCE m_hLangDLL; 2.InitInstance()内添加 AfxEnableControlContainer(); m_hLangDLL=::LoadLibrary("chinese.dll"); AfxSetResourceHandle(...
阅读全文