阅读:1405回复:4
2000DDK中的packet好用么,怎么发不了数据包?
???
|
|
沙发#
发布于:2002-06-28 13:46
怎么发不了数据包?你用sniffer抓一下,就可以看到发出的数据包。
|
|
板凳#
发布于:2002-06-28 14:17
失误,失误
|
|
地板#
发布于:2002-06-28 16:01
请教:
DDK中的Packet PacketStartDriver()用途。我把它注释掉,重起机器程序依然好用。是否没用?(不会吧) //////////////////////////////////////////////////////// From DDK: BOOL PacketStartDriver( LPTSTR ServiceName ) /*++ Routine Description: This routine Atempts to start the kernel mode packet driver Arguments: ServiceName - Name of service to try to start Return Value: SUCCESS - FAILURE - --*/ { BOOL Status = FALSE; SERVICE_STATUS ServiceStatus; SC_HANDLE SCManagerHandle = NULL; SC_HANDLE SCServiceHandle = NULL; /* Open a handle to the SC Manager database. */ SCManagerHandle = OpenSCManager( NULL, /* local machine */ NULL, /* ServicesActive database */ SC_MANAGER_ALL_ACCESS); /* full access rights */ if (SCManagerHandle==NULL) { MessageBox(NULL,TEXT(\"Could not open SC\"),szWindowTitle,MB_OK); goto CleanExit; } else { SCServiceHandle=OpenService(SCManagerHandle, ServiceName, SERVICE_START ); if (SCServiceHandle == NULL) { MessageBox(NULL,TEXT(\"Could not open service\"),szWindowTitle,MB_OK); goto CleanExit; } Status=StartService( SCServiceHandle, 0, NULL ); if (!Status) { if (GetLastError()==ERROR_SERVICE_ALREADY_RUNNING) { ODS(\"Packet32: Packet service already started\\n\"); Status = TRUE; goto CleanExit; } else { MessageBox(NULL,TEXT(\"Could not start service\"),szWindowTitle,MB_OK); goto CleanExit; } } do { // loop until the service is fully started. if (!QueryServiceStatus(SCServiceHandle, &ServiceStatus)) { goto CleanExit; } switch(ServiceStatus.dwCurrentState) { case SERVICE_RUNNING: Status = TRUE; goto CleanExit; break; case SERVICE_START_PENDING: Sleep(2000); break; default: goto CleanExit; break; } }while (TRUE); } CleanExit: if(SCManagerHandle != NULL) { (VOID) CloseServiceHandle(SCManagerHandle); } if(SCServiceHandle != NULL) { (VOID) CloseServiceHandle(SCServiceHandle); } return(Status); } :P |
|
地下室#
发布于:2002-06-28 18:11
poppan 兄:
因为packet。sys已经加载在系统中了!!! 它只是“第一次”(听着怪怪的,:D)在内部还没有packet。sys时有用。。。。。。。。。 :) |
|
|