悬购NtQuerySystemInformation成功用法!!!!(100分)

  • 主题发起人 chinaweiling
  • 开始时间
C

chinaweiling

Unregistered / Unconfirmed
GUEST, unregistred user!
各位大侠,小弟写一程序需要得到一个客户端与服务器联接时所打开端口,就想调用
ntdll.dll中的NtQuerySystemInformation函数,来获得所有SOCKET句柄,根据SOCKET信息
来得到。但小弟使用过多次方法也未将NtQuerySystemInformation调用成功,恳请各位侠
义之士出手援助。谢谢!!!!
 
天啊,100大分没人要么????????
 
你又不把错误的原因说出来
谁知道你错在哪
 

小弟将函数定义与实现部分写下,主要是NtQuerySystemInformation()若调用成功则返回
0,test返回系统中所有socket句柄。

typedef LONG (WINAPI *PROCNTQSI)(UINT,PVOID,ULONG,PULONG);
PROCNTQSI NtQuerySystemInformation;
......
NtQuerySystemInformation = (PROCNTQSI)GetProcAddress(
GetModuleHandle("ntdll"),
"NtQuerySystemInformation"
);
PBYTE test = NULL;
DWORD cInfoSize = 0x20000;
test = ( PBYTE ) malloc( cInfoSize );
iRet = NtQuerySystemInformation(16,test,0x20000,0);
..........
 
神啊,救救我吧!!
 
顶部