| 3002 | |
| 3003 | |
| 3004 | BOOL |
| 3005 | Ext2StartService(CHAR *service) |
| 3006 | { |
| 3007 | BOOL rc = FALSE; |
| 3008 | SC_HANDLE scmHandle = NULL; |
| 3009 | SC_HANDLE drvHandle = NULL; |
| 3010 | |
| 3011 | scmHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); |
| 3012 | if (!scmHandle) { |
| 3013 | goto errorout; |
| 3014 | } |
| 3015 | |
| 3016 | drvHandle = OpenService(scmHandle, |
| 3017 | service, |
| 3018 | SERVICE_ALL_ACCESS); |
| 3019 | if (!drvHandle) { |
| 3020 | goto errorout; |
| 3021 | } |
| 3022 | |
| 3023 | rc = (0 != StartService(drvHandle, 0, NULL)); |
| 3024 | |
| 3025 | errorout: |
| 3026 | |
| 3027 | if (drvHandle) |
| 3028 | CloseServiceHandle(drvHandle); |
| 3029 | |
| 3030 | if (scmHandle) { |
| 3031 | CloseServiceHandle(scmHandle); |
| 3032 | } |
| 3033 | |
| 3034 | return rc; |
| 3035 | } |
| 3036 | |
| 3037 | BOOL |
| 3038 | Ext2StartExt2Srv() |
no outgoing calls
no test coverage detected