00001 /* 00002 * Unix SMB/CIFS implementation. 00003 * Service Control API Implementation 00004 * Copyright (C) Gerald Carter 2005. 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00021 #include "includes.h" 00022 00023 /* Implementation for internal wins service */ 00024 00025 /********************************************************************* 00026 *********************************************************************/ 00027 00028 static WERROR wins_status( const char *service, SERVICE_STATUS *service_status ) 00029 { 00030 ZERO_STRUCTP( service_status ); 00031 00032 service_status->type = 0x10; 00033 service_status->controls_accepted = SVCCTL_ACCEPT_NONE; 00034 00035 if ( lp_wins_support() ) 00036 service_status->state = SVCCTL_RUNNING; 00037 else { 00038 service_status->state = SVCCTL_STOPPED; 00039 service_status->win32_exit_code = WERR_SERVICE_NEVER_STARTED; 00040 } 00041 00042 return WERR_OK; 00043 } 00044 00045 /********************************************************************* 00046 *********************************************************************/ 00047 00048 static WERROR wins_stop( const char *service, SERVICE_STATUS *service_status ) 00049 { 00050 wins_status( service, service_status ); 00051 00052 return WERR_ACCESS_DENIED; 00053 } 00054 00055 /********************************************************************* 00056 *********************************************************************/ 00057 00058 static WERROR wins_start( const char *service ) 00059 { 00060 return WERR_ACCESS_DENIED; 00061 } 00062 00063 /********************************************************************* 00064 *********************************************************************/ 00065 00066 /* struct for svcctl control to manipulate wins service */ 00067 00068 SERVICE_CONTROL_OPS wins_svc_ops = { 00069 wins_stop, 00070 wins_start, 00071 wins_status 00072 };