Re: Adds NET START to net.exe

2007-05-11 Thread Alexandre Julliard
"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])) > +{ > +

Re: Adds NET START to net.exe

2007-05-10 Thread Dmitry Timoshkov
"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

RE: Resend of Adds NET START to net.exe

2007-05-08 Thread Rolf Kalbermatter
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.

Re: Resend of Adds NET START to net.exe

2007-05-08 Thread Dmitry Timoshkov
"Dmitry Timoshkov" <[EMAIL PROTECTED]> wrote: +if(!buffer_size) +{ The check above is wrong. Please ignore this one. -- Dmitry.

Re: Resend of Adds NET START to net.exe

2007-05-08 Thread Dmitry Timoshkov
"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

RE: [PATCH] Adds NET START to net.exe

2007-05-07 Thread Rolf Kalbermatter
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

RE: [PATCH] Adds NET START to net.exe

2007-05-07 Thread Rolf Kalbermatter
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

Re: [PATCH] Adds NET START to net.exe

2007-05-07 Thread Dmitry Timoshkov
"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_