|
[求助]socket 客户端connect 失败,错误10061
原作者这么写的,我也没改,帮我看看为什么500个客户端并发链接会连接不上,客户端错误10061 |
|
[求助]socket 客户端connect 失败,错误10061
我用的是gh0st的iocp内核。附件是gh0st的iocp源码,你看看哪里有缺陷 |
|
[讨论]抛砖引玉,大疆PHANTOM 3 STANDARD遥控信号嗅探
牛逼,毅力非凡,祖国的脊梁 |
|
求教c++怎么调用webkit控件
谢谢楼上的建议 |
|
[讨论]如何获取QQkey
我自己已经搞定了QQkey |
|
[求助]进程如何切换会员(Session)
楼上的方法试过了可以的,没有办法不关进程,直接切换? 附上楼上方法的源码 DWORD _stdcall LaunchAppIntoDifferentSession( LPTSTR lpCommand ) { DWORD dwRet = 0; PROCESS_INFORMATION pi; STARTUPINFO si; DWORD dwSessionId; HANDLE hUserToken = NULL; HANDLE hUserTokenDup = NULL; HANDLE hPToken = NULL; HANDLE hProcess = NULL; DWORD dwCreationFlags; HMODULE hInstKernel32 = NULL; typedef DWORD (WINAPI *WTSGetActiveConsoleSessionIdPROC)(); WTSGetActiveConsoleSessionIdPROC WTSGetActiveConsoleSessionId = NULL; hInstKernel32 = LoadLibrary("Kernel32.dll"); if (!hInstKernel32) return FALSE; WTSGetActiveConsoleSessionId = (WTSGetActiveConsoleSessionIdPROC)GetProcAddress(hInstKernel32,"WTSGetActiveConsoleSessionId"); // Log the client on to the local computer. dwSessionId = WTSGetActiveConsoleSessionId(); do { typedef BOOL ((WINAPI *WTSQueryUserToken)(ULONG SessionId,PHANDLE phToken)); WTSQueryUserToken WTSQueryUserTokenT=(WTSQueryUserToken)GetProcAddress(LoadLibrary("Wtsapi32.dll"),"WTSQueryUserToken"); WTSQueryUserTokenT(dwSessionId,&hUserToken ); dwCreationFlags = NORMAL_PRIORITY_CLASS | CREATE_NEW_CONSOLE; ZeroMemory( &si, sizeof( STARTUPINFO ) ); si.cb= sizeof( STARTUPINFO ); si.lpDesktop = "winsta0\\default"; ZeroMemory( &pi, sizeof(pi) ); TOKEN_PRIVILEGES tp; LUID luid; if( !::OpenProcessToken( GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_ASSIGN_PRIMARY | TOKEN_ADJUST_SESSIONID | TOKEN_READ | TOKEN_WRITE, &hPToken ) ) { dwRet = GetLastError(); break; } if ( !LookupPrivilegeValue( NULL, SE_DEBUG_NAME, &luid ) ) { dwRet = GetLastError(); break; } tp.PrivilegeCount =1; tp.Privileges[0].Luid =luid; tp.Privileges[0].Attributes =SE_PRIVILEGE_ENABLED; if( !DuplicateTokenEx( hPToken, MAXIMUM_ALLOWED, NULL, SecurityIdentification, TokenPrimary, &hUserTokenDup ) ) { dwRet = GetLastError(); break; } //Adjust Token privilege if( !SetTokenInformation( hUserTokenDup,TokenSessionId,(void*)&dwSessionId,sizeof(DWORD) ) ) { dwRet = GetLastError(); break; } if( !AdjustTokenPrivileges( hUserTokenDup, FALSE, &tp, sizeof(TOKEN_PRIVILEGES), (PTOKEN_PRIVILEGES)NULL, NULL ) ) { dwRet = GetLastError(); break; } LPVOID pEnv =NULL; DWORD (__stdcall *CreateEnvironmentBlock)( LPVOID *, HANDLE, BOOL ); CreateEnvironmentBlock = (DWORD (__stdcall *)(LPVOID *, HANDLE,BOOL))GetProcAddress( LoadLibrary("UserEnv.dll"), "CreateEnvironmentBlock" ); if (!CreateEnvironmentBlock) break; if( CreateEnvironmentBlock( &pEnv, hUserTokenDup, TRUE ) ) { dwCreationFlags|=CREATE_UNICODE_ENVIRONMENT; } else pEnv=NULL; // Launch the process in the client's logon session. if( CreateProcessAsUser( hUserTokenDup, // client's access token NULL, // file to execute lpCommand, // command line NULL, // pointer to process SECURITY_ATTRIBUTES NULL, // pointer to thread SECURITY_ATTRIBUTES FALSE, // handles are not inheritable dwCreationFlags,// creation flags pEnv, // pointer to new environment block NULL, // name of current directory &si, // pointer to STARTUPINFO structure &pi // receives information about new process ) ) { } else { dwRet = GetLastError(); break; } } while( 0 ); //Perform All the Close Handles task if( NULL != hUserToken ) { CloseHandle( hUserToken ); } if( NULL != hUserTokenDup) { CloseHandle( hUserTokenDup ); } if( NULL != hPToken ) { CloseHandle( hPToken ); } return dwRet; } |
|
码农如何快速成长为大牛
研究下gh0st的源码,吃透你就是大牛了 |
|
码农如何快速成长为大牛
先把英文6级证书拿到,再考虑成为大牛 |
|
[调查]快十年没来了!!!哈哈.身份版主,不在岗
你是版主? |
|
[调查]很久没来这里了,时间过得真快
老牛 老牛 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值