HI,
I need to pass parametes to service main function.

This is how define the Service startup function
SERVICE_TABLE_ENTRY serviceTable[] =
{
{ SZSERVICENAME, (LPSERVICE_MAIN_FUNCTION) ServiceMain},
{ NULL, NULL}
};


I am using the follwing command to start the service.
success = StartServiceCtrlDispatcher(serviceTable);


1. If i want to parameters to the service main function, how can i do that.
2. Is there a way i can find the name of the service that i am starting before calling serice main function.
This is because i have installed the service using the fuction CreateService(), in which we give the name of the exe that we want to start when the service is started. In this executable before serice main is getting called the statically lined dll's are getting involked. I need to use the service name in the DllMain function of these function.

3. Is there a way when i create the serice using CreateService(), i can pass the command line parameters to the function to it, so that when i start the serice i can use these command line parameters.


Thanks in Advance,
Varadha