创建一个EveryOne SECURITY_ATTRIBUTES.(10) SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES(); SECURITY_DESCRIPTOR sd = new SECURITY_DESCRIPTOR(); lpSecurityDescriptor = Marshal.AllocCoTaskMem( Marshal.SizeOf( sd)); Marshal.StructureToPtr( sd,lpSecurityDescriptor,false); if( ! InitializeSecurityDescriptor( lpSecurityDescriptor ,SECURITY_DESCRIPTOR_REVISION))