"Tim Schwartz" <[EMAIL PROTECTED]> writes:
> +if(!strcasecmp(argv[1], "start"))
> +{
> +if(argc < 3)
> +{
> +printf("Specify service name to start.\n");
> +return TRUE;
> +}
> +
> +if(!net_service(NET_START, argv[2]))
> +{
> +
"Tim Schwartz" <[EMAIL PROTECTED]> wrote:
+GetServiceDisplayName(SCManager, service_name, NULL, &buffer_size);
+if(!buffer_size)
You need to check the GetServiceDisplayName retrun value, not buffer_size.
If GetServiceDisplayName succeeds buffer_size contains valid length.
Also please
Tim Schwartz wrote:
+if(!strcasecmp(operation, "start"))
+{
+printf("The %s service is starting.\n", service_display_name);
+result = StartService(serviceHandle,0,NULL);
+CloseServiceHandle(serviceHandle);
+if(!result) printf("The %s service failed to start.
"Dmitry Timoshkov" <[EMAIL PROTECTED]> wrote:
+if(!buffer_size)
+{
The check above is wrong.
Please ignore this one.
--
Dmitry.
"Tim Schwartz" <[EMAIL PROTECTED]> wrote:
+GetServiceDisplayName(SCManager, service_name, NULL, &buffer_size);
You need to check GetServiceDisplayName return value here and later.
+/* until GetServiceDisplayName() is implemented, buffer_size will always be zero so the service short na
Rolf Kalbermatter [mailto:[EMAIL PROTECTED]
>+GetServiceDisplayName(SCManager, service_name, NULL, buffer_size);
>+if(!buffer_size)
>+{
>
>Apart from GetServiceDisplayName() currently not being implemented in Wine,
this won't work!
>*buffer_size won't be allocated by the function but h
Tim Schwartz [EMAIL PROTECTED] wrote:
diff --git a/programs/net/net.c b/programs/net/net.c index f77c820..ef08250
100644
--- a/programs/net/net.c
+++ b/programs/net/net.c
@@ -18,15 +18,66 @@
#include
#include
+#include
+
+int net_service(char *operation, char *service_name) {
+SC_HANDLE
"Tim Schwartz" <[EMAIL PROTECTED]> wrote:
+int net_service(char *operation, char *service_name)
Please add 'static' since it isn't used outside of this .c file.
+{
+SC_HANDLE SCManager, serviceHandle;
+int result = 0;
+unsigned int *buffer_size = NULL;
+char *service_display_