ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

delete.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:     ReactOS Services
00003  * LICENSE:     GPL - See COPYING in the top level directory
00004  * FILE:        base/system/sc/delete.c
00005  * PURPOSE:     Delete a service
00006  * COPYRIGHT:   Copyright 2005 - 2006 Ged Murphy <gedmurphy@gmail.com>
00007  *
00008  */
00009 
00010 #include "sc.h"
00011 
00012 BOOL Delete(LPCTSTR ServiceName)
00013 {
00014     SC_HANDLE hSCManager = NULL;
00015     SC_HANDLE hSc = NULL;
00016 
00017 #ifdef SCDBG
00018     _tprintf(_T("service to delete - %s\n\n"), ServiceName);
00019 #endif
00020 
00021     hSCManager = OpenSCManager(NULL,
00022                                NULL,
00023                                SC_MANAGER_CONNECT);
00024     if (hSCManager != NULL)
00025     {
00026         hSc = OpenService(hSCManager, ServiceName, DELETE);
00027         if (hSc != NULL)
00028         {
00029             if (DeleteService(hSc))
00030             {
00031                 _tprintf(_T("[SC] DeleteService SUCCESS\n"));
00032 
00033                 CloseServiceHandle(hSc);
00034                 CloseServiceHandle(hSCManager);
00035 
00036                 return TRUE;
00037             }
00038         }
00039     }
00040 
00041     ReportLastError();
00042 
00043     if (hSc) CloseServiceHandle(hSc);
00044     if (hSCManager) CloseServiceHandle(hSCManager);
00045 
00046     return FALSE;
00047 }

Generated on Sun May 27 2012 04:16:59 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.