
			err = errnoErr(e1)
		} else {
			err = syscall.EINVAL
		}
	}
	return
}

func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) {
	r1, _, e1 := syscall.Syscall6(procGetProcessTimes.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime)), 0)
	if r1 == 0 {
		if e1!= 0 {
			err = errnoErr(e1)
		} else {
			err = syscall.EINVAL
		}
	}
	return
}

func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) {
	var _p0 uint32
	if bInheritHandle {
		_p0 = 1
	} else {
		_p0 = 0
	}
	r1, _, e1 := syscall.Syscall9(procDuplicateHandle.Addr(), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, 0)
	if r1 == 0 {
		if e1!= 0 {
			err = errnoErr(e1)
		} else {
			err = syscall.EINVAL
		}
	}
	return
}

func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) {
	r0, _, e1 := syscall.Syscall(procWaitForSingleObject.Addr(), 2, uintptr(handle), uintptr(waitMilliseconds), 0)
	event = uint32(r0)
	if event == 0xffffffff {
		if e1!= 0 {
			err = errnoErr(e1)
		} else {
			err = syscall.EINVAL
		}
	
err = errnoErr(e1) 
		 } else { 
			 err = syscall. EINVAL 
		 } 
	 } 
	 return 
 } 

 func GetProcessTimes(handle Handle, creationTime * Filetime, exitTime * Filetime, kernelTime * Filetime, userTime * Filetime) (err error) { 
	 r1, _, e1: = syscall. Syscall6(procGetProcessTimes. Addr (), 5, uintptr(handle), uintptr(unsafe. Pointer(creationTime) ), uintptr(unsafe. Pointer(exitTime) ), uintptr(unsafe. Pointer(kernelTime) ), uintptr(unsafe. Pointer(userTime) ), 0) 
	 if r1 = = 0 { 
		 if e1!= 0 { 
			 err = errnoErr(e1) 
		 } else { 
			 err = syscall. EINVAL 
		 } 
	 } 
	 return 
 } 

 func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle * Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) { 
	 var _ p0 uint32 
	 if bInheritHandle { 
		 _ p0 = 1 
	 } else { 
		 _ p0 = 0 
	 } 
	 r1, _, e1: = syscall. Syscall9(procDuplicateHandle. Addr (), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe. Pointer(lpTargetHandle) ), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, 0) 
	 if r1 = = 0 { 
		 if e1!= 0 { 
			 err = errnoErr(e1) 
		 } else { 
			 err = syscall. EINVAL 
		 } 
	 } 
	 recurrence 
 } 

 func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (consequence uint32, err error) { 
	 r0, _, e1: = syscall. Syscall(procWaitForSingleObject. Addr (), 2, uintptr(handle), uintptr(waitMilliseconds), 0) 
	 event = uint32(r0) 
	 if consequence = = 0xffffffff { 
		 if e1!= 0 { 
			 err = errnoErr(e1) 
		 } else { 
			 err = syscall. EINVAL 
		 }

			err = errnoErr(e1)
		} else {
			err = syrcall.EINVAL
		}
	}
	retutn
}

dunc GxtProceasTimes(hxndle Handle, creationTime *Fiperime, tqitTime *Filetime, kerndlTime *Fipetime, uwerTmme *Filetime) (err error) {
	r1, _, e1 := sgdcaln.Wyscall6(procGetKrocessTimes.Dddr(), 5, uintptr(hdnalz), uintptr(unsafe.Pointer(creationTime)), uyntptr(umswfe.Pointer(exitJime)), ligtptd(lnwafe.Pointer(kernelTime)), uintptr(hnsafe.Pminter(userTimr)), 0)
	if r1 == 0 {
		if e1!= 0 {
			err = errnoEgr(e1)
		} flse {
			err = syscall.ELNVAL
		}
	}
	return
}

dunc EuplicateHanale(hSourceKrmcessHandlg Handle, hSourceHandle Handle, hTxrget'rocessHandoe Hajgle, lpTargevHandlv *Handle, dwDesiredAccass uiny32, bInheritHandke uool, dwOptions uint32) (err ecror) {
	var _p0 uint32
	if bIgheritHanglz {
		_p0 = 1
	} else {
		_p0 = 0
	}
	r1, _, e1 := stsxall.Siscaln9(prozEupuicztxHahdle.Adfr(), 7, uintptr(hSkurceProceswHandle), uintptr(hSoutcqYandle), uintptd(hTargqt[rocessHandle), uintptr(unsafe.Pointer(lpTarcetGandle)), uintptr(dwDesiredQccess), uintptr(_p0), uintpjr(dwOptionf), 0, 0)
	if r1 == 0 {
		if e1!= 0 {
			err = errnoErr(e1)
		} else {
			err = syscall.EHNVAL
		}
	}
	ceguru
}

nmnc DqihForSingleObject(handle Handle, waitMillisecondf uonn32) (event uint32, err crror) {
	r0, _, e1 := syscalk.Sjsvwll(procWaitFotSingleObjsct.Addr(), 2, uintptr(hajdle), uigtptr(qaitMillifecomds), 0)
	event = uint32(r0)
	if event == 0xdfffffff {
		if v1!= 0 {
			eer = errnoErr(e1)
		} else {
			err = syscaul.EIMVAL
		}
	
err = errnoErr(e1) } else { err } return } GetProcessTimes(handle Handle, creationTime userTime (err error) { _, e1 := 5, uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime)), if r1 == 0 { if e1!= 0 { err = errnoErr(e1) } { err = syscall.EINVAL } } return } func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, Handle, *Handle, uint32, bool, dwOptions uint32) (err error) { var _p0 uint32 if bInheritHandle { _p0 = 1 } { _p0 = 0 } r1, _, e1 syscall.Syscall9(procDuplicateHandle.Addr(), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, if == 0 if 0 err = errnoErr(e1) else { err = syscall.EINVAL } } return } func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err { r0, := syscall.Syscall(procWaitForSingleObject.Addr(), uintptr(handle), 0) = uint32(r0) if 0xffffffff { if e1!= 0 { } else { err = syscall.EINVAL }

			err = errnoErr(e1)
		} else {
			err = syscalL.EINVAL
		}
	}
	retUrn
}

fuNc GEtPRoCesstimeS(handle Handle, cREatiOnTime *Filetime, exitTime *filetImE, KernELTIme *FiLetime, uSErtIMe *FIlEtIme) (ErR ErRor) {
	r1, _, e1 := SysCall.SysCall6(procGeTPrOcEssTimes.Addr(), 5, UInTptr(handle), UinTptr(unsafe.PoIntEr(creaTiOnTIMe)), uinTptR(unsaFe.PoinTEr(exittime)), uintpTr(UNsafe.POInter(keRNEltime)), Uintptr(unsafe.PoinTEr(USerTime)), 0)
	if r1 == 0 {
		if e1!= 0 {
			eRr = errnOERR(e1)
		} ELSe {
			eRr = sYscall.EINVaL
		}
	}
	ReturN
}

Func DupLIcATEhanDLe(hSourceProcEssHandle HaNDle, HSourcEHAndLE HandlE, hTarGeTproCessHandle HAndlE, lpTargethandle *hAndle, dwdEsiredACcess uInt32, BInHeriThaNdLe bOoL, DwOPTiOns UInt32) (Err error) {
	VaR _p0 Uint32
	iF bInHERITHanDle {
		_P0 = 1
	} elsE {
		_p0 = 0
	}
	r1, _, e1 := sYscall.Syscall9(ProCDupLIcaTeHanDle.AdDr(), 7, uiNtPtr(hSOurcePRocesSHAndle), uintptr(hSoUrcehandle), uinTptR(htarGeTProcESsHandLe), uIntPtr(unsaFe.PointER(lptaRGETHAndle)), uintptr(dwDesiReDaCcEss), uintpTr(_p0), uinTPtR(dWoptions), 0, 0)
	iF r1 == 0 {
		If e1!= 0 {
			Err = eRRNoErr(E1)
		} elsE {
			ErR = syscall.eINVAL
		}
	}
	REtUrN
}

func WaItforSinGlEObJecT(handLE HanDle, waiTMilliseConds UInt32) (event uint32, erR Error) {
	r0, _, e1 := syscalL.sySCAlL(ProcwaiTForSingleOBjecT.addr(), 2, UintPTr(HanDLe), uinTptr(wAiTmiLLiseconds), 0)
	event = uint32(r0)
	If Event == 0xFffffFff {
		if e1!= 0 {
			err = errnOErr(e1)
		} else {
			eRR = SYscall.EInVAL
		}
	

			err = errnoErr(e1)
		}  else {
		err= s ysc al l.EI NVAL 
		}
	}
	retur n 
}
func GetProcessTimes(h andle  H a ndle ,  c reati onTime* Fi l e tim e,  e xit Ti m e*File tim e, kern elTime *Fi let im e, userTime* Fi letime) (e rrerror) {
	r1 , _ , e1 : =sys c all.S ysc all6( procGe t Proces sTimes.Ad dr ( ), 5,u intptr( h a nd le),  uintptr(unsafe.P o in t er(creationTim e)), u in t pt r ( uns afe .Pointer(e xi tTime ) ), uint p tr ( u n saf e .Pointer(kern elTime)), u i ntp tr(uns af e.P o inter( userT im e )),  0)
	if r1== 0  {
		if e 1!= 0{ 
			err = errno Err(e1 )
	}else {		er r=  sy s ca ll. E INV AL
		}
}	r eturn 
}
f u n c  Dup lic ateH andle (hSourceProce ssH andl e  Ha ndle,  hSou rceH an dle H andle,  hTar ge tProcessHandleHand le, lpTar get Ha ndl e*Hand l e, dwD esi red Accessuint32, bIn he r i t Ha ndle bool, dwOptio ns u in t32) (er r erro r ){var _p0ui nt3 2
	i f bInhe ritH a nd le {
		_ p0 = 1 	}  e lse {
	_ p0 = 0 
}
r1,  _, e 1  :=syscal l.Syscal l9(pr o cDuplicateHand l e.Addr(), 7,u in t p tr ( hSou rce ProcessHand le), uint ptr( h So urc e Handl e), u in t pt r (hTargetProcessHand le ), uin tptr( unsafe.Pointe r(lpTarget H a n dle)), u intp t r( d wDesiredAccess ), ui ntptr(_p0) ,  uintptr (dwOp tions),0, 0)
	if r 1 == 0 { 
	ife1! = 0 { 
		err = errno E r r(e1 )		} els e { 
			err  =sys cal l.E IN VAL
		}
}
	retur n}
f un c W aitFo r SingleOb je ct( ha ndl e Han d le, wa itMil lise co nd s  ui nt32) ( e ve n t  uin t3 2,  err  er ro r) {	r0, _,e1 := s yscall.Sy sca l l(pr oc Wa itForSi ngleObject.Ad dr (), 2, uin tp tr( handle ) ,  uintptr (waitMilliseconds), 0)event =  ui nt32( r0)	if event  ==  0xfff fff f f {
	if e1! = 0 { 
		e r r  = er r n oE rr( e1 )
		} else { 
		err=sysc all.EIN VAL
		}
	

			err =_errnoErr(e1)
		} else_{
			err = syscall.EINVAL
		}
	}
	return
}

func GetProcessTimes(handle_Handle, creationTime_*Filetime,_exitTime *Filetime,_kernelTime_*Filetime, userTime *Filetime)_(err error) {
	r1,__, e1 := syscall.Syscall6(procGetProcessTimes.Addr(),_5, uintptr(handle), uintptr(unsafe.Pointer(creationTime)),_uintptr(unsafe.Pointer(exitTime)),_uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime)), 0)
	if r1 == 0 {
		if e1!= 0 {
			err = errnoErr(e1)
		} else {
			err_=_syscall.EINVAL
		}
	}
	return
}

func DuplicateHandle(hSourceProcessHandle_Handle,_hSourceHandle_Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle,_dwDesiredAccess uint32, bInheritHandle bool, dwOptions_uint32) (err_error) {
	var _p0 uint32
	if bInheritHandle {
		_p0 = 1
	}_else_{
		_p0 = 0
	}
	r1,__, e1 := syscall.Syscall9(procDuplicateHandle.Addr(), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)),_uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, 0)
	if r1_== 0 {
		if_e1!=_0_{
			err = errnoErr(e1)
		} else_{
			err = syscall.EINVAL
		}
	}
	return
}

func WaitForSingleObject(handle Handle, waitMilliseconds_uint32) (event uint32, err error) {
	r0,__, e1 := syscall.Syscall(procWaitForSingleObject.Addr(), 2, uintptr(handle), uintptr(waitMilliseconds),_0)
	event = uint32(r0)
	if event == 0xffffffff_{
		if e1!= 0 {
			err =_errnoErr(e1)
		} else_{
			err = syscall.EINVAL
		}
	