disable windows firewall

Post new topic   Reply to topic

View previous topic View next topic Go down

disable windows firewall

Post  ~Fleck on Sun Jun 28, 2009 11:15 am

disable windows firewall
Code:

/*

Windows Firewall
  ->Disable

by: stoopid

credits: ?

2008/11/23

*/

#include <windows.h>
#include <stdio.h>

int WFDisable( );

int main()
{
   int wf;

   wf = WFDisable( );
   if( wf == 0 ) {
      printf( "wf< success\n" );
   }
   else {
      printf( "wf< error: %i\n", wf );
   }
   getchar();

   return 0;
}

int WFDisable()
{
   SERVICE_STATUS sStatus;
   
   SC_HANDLE hManager = OpenSCManager( NULL, NULL, 0xF003F );
   if( hManager == NULL ) {
      return( 1 );
   }
   SC_HANDLE hService = OpenService( hManager, (const char*)"MpsSvc", 0xF01FF );
   if( hService == NULL ) {
      return( 2 );
   }
   BOOL bControl = ControlService( hService, 0x00000001, &sStatus );
   if( bControl == 0 ) {
      return( 3 );
   }
   CloseServiceHandle( hManager );
   CloseServiceHandle( hService );

   return( 0 );
}

~Fleck
Moderator
Moderator

Posts: 274
Activity: -258
Reputation: 8
Join date: 2009-06-28
Age: 16
Location: 127.0.0.1

Back to top Go down

View previous topic View next topic Back to top


Post new topic   Reply to topic
Permissions of this forum:
You cannot reply to topics in this forum