@@ -777,40 +777,21 @@ static void reportsvcstatus(DWORD status, DWORD param)
777777 LeaveCriticalSection (& servicelock );
778778}
779779
780- static PSECURITY_ATTRIBUTES getnullacl (void )
781- {
782- static BYTE sb [BBUFSIZ ];
783- static SECURITY_ATTRIBUTES sa ;
784- static PSECURITY_DESCRIPTOR sd = NULL ;
785-
786- if (sd == NULL ) {
787- sd = (PSECURITY_DESCRIPTOR )sb ;
788- if (!InitializeSecurityDescriptor (sd , SECURITY_DESCRIPTOR_REVISION ) ||
789- !SetSecurityDescriptorDacl (sd , TRUE, (PACL )NULL , FALSE)) {
790- sd = NULL ;
791- return NULL ;
792- }
793- }
794- sa .nLength = DSIZEOF (SECURITY_ATTRIBUTES );
795- sa .lpSecurityDescriptor = sd ;
796- sa .bInheritHandle = TRUE;
797- return & sa ;
798- }
799-
800780static DWORD createiopipes (LPSTARTUPINFOW si )
801781{
802- LPSECURITY_ATTRIBUTES sa ;
782+ SECURITY_ATTRIBUTES sa ;
803783 DWORD rc = 0 ;
804784 HANDLE sh = NULL ;
805785 HANDLE cp = GetCurrentProcess ();
806786
807- if ((sa = getnullacl ()) == NULL )
808- return svcsyserror (__LINE__ , ERROR_ACCESS_DENIED , L"SetSecurityDescriptorDacl" );
787+ sa .nLength = DSIZEOF (SECURITY_ATTRIBUTES );
788+ sa .lpSecurityDescriptor = NULL ;
789+ sa .bInheritHandle = TRUE;
809790 /**
810791 * Create stdin pipe, with write side
811792 * of the pipe as non inheritable.
812793 */
813- if (!CreatePipe (& (si -> hStdInput ), & sh , sa , 0 ))
794+ if (!CreatePipe (& (si -> hStdInput ), & sh , & sa , 0 ))
814795 return svcsyserror (__LINE__ , GetLastError (), L"CreatePipe" );
815796 if (!DuplicateHandle (cp , sh , cp ,
816797 & inputpipewrs , FALSE, 0 ,
@@ -824,7 +805,7 @@ static DWORD createiopipes(LPSTARTUPINFOW si)
824805 * Create stdout/stderr pipe, with read side
825806 * of the pipe as non inheritable
826807 */
827- if (!CreatePipe (& sh , & (si -> hStdError ), sa , 0 ))
808+ if (!CreatePipe (& sh , & (si -> hStdError ), & sa , 0 ))
828809 return svcsyserror (__LINE__ , GetLastError (), L"CreatePipe" );
829810 if (!DuplicateHandle (cp , sh , cp ,
830811 & outputpiperd , FALSE, 0 ,
0 commit comments