[Mplayer-cvslog] CVS: main/libdha/dhahelperwin MAKEFILE, NONE, 1.1 SOURCES, NONE, 1.1 dhahelper.c, NONE, 1.1 dhahelper.h, NONE, 1.1 dhasetup.c, NONE, 1.1

Felix Buenemann atmosfear at users.sourceforge.net
Tue Mar 23 12:55:15 CET 2004


On Tuesday 23 March 2004 11:41, Sascha Sommer CVS wrote:
> if(!strcmp(argv[1],"install")){
>     printf("installing dhahelper\n");
>    
> CopyFile("dhahelper.sys","c:\\windows\\System32\\drivers\\dhahelper.sys",FA
>LSE); // Install the driver
>     hService = CreateService(hSCManager,
>                              "DHAHELPER",
>                              "DHAHELPER",
>                              SERVICE_ALL_ACCESS,
>                              SERVICE_KERNEL_DRIVER,
>                              SERVICE_SYSTEM_START,
>                              SERVICE_ERROR_NORMAL,
>                            
>  "c:\\windows\\System32\\drivers\\dhahelper.sys", NULL,
>                              NULL,
>                              NULL,
>                              NULL,
>                              NULL);
>   }
>   else if(!strcmp(argv[1],"remove")){
>     SERVICE_STATUS ServiceStatus;
>     printf("removing dhahelper\n");
>     hService = OpenService(hSCManager, "DHAHELPER", SERVICE_ALL_ACCESS);
>     ControlService(hService, SERVICE_CONTROL_STOP, &ServiceStatus);
>     DeleteService(hService);
>     DeleteFile("c:\\windows\\System32\\drivers\\dhahelper.sys");
>   }
>   else {
>     printf("unknown parameter: %s\n",argv[1]);
>   }

This looks veeery bad, hardcoded path/drive is evil, this will at least fail 
on every NT4 and Win2000 system, as they use WINNT as windir. You could for 
example read the %WINDIR% which will contain the drive and path to the 
currently running windows installation.

-- 
Best Regards,
        Atmos
____________________________________________
- MPlayer Developer - http://mplayerhq.hu/ -
____________________________________________




More information about the MPlayer-cvslog mailing list