public static WlanOpcodeValueType QueryEnabled(out bool enabled)
        {
            uint   dataSize;
            IntPtr dataPtr;
            WlanOpcodeValueType opcode;

            Helper.ThrowExceptionForHR(WlanNativeMethods.WlanHostedNetworkQueryProperty(wlanHandle,
                                                                                        WlanHostedNetworkOpcode.Enable,
                                                                                        out dataSize, out dataPtr, out opcode, IntPtr.Zero));
            enabled = Marshal.PtrToStructure <bool>(dataPtr);
            return(opcode);
        }
        public static WlanOpcodeValueType QuerySecuritySettings(out WlanHostedNetworkSecuritySettings settings)
        {
            uint   dataSize;
            IntPtr dataPtr;
            WlanOpcodeValueType opcode;

            Helper.ThrowExceptionForHR(WlanNativeMethods.WlanHostedNetworkQueryProperty(wlanHandle,
                                                                                        WlanHostedNetworkOpcode.SecuritySettings,
                                                                                        out dataSize, out dataPtr, out opcode, IntPtr.Zero));
            settings = Marshal.PtrToStructure <WlanHostedNetworkSecuritySettings>(dataPtr);
            return(opcode);
        }
        public static WlanOpcodeValueType QueryStationProfile(out string profile)
        {
            uint   dataSize;
            IntPtr dataPtr;
            WlanOpcodeValueType opcode;
            var hr = WlanNativeMethods.WlanHostedNetworkQueryProperty(wlanHandle,
                                                                      WlanHostedNetworkOpcode.StationProfile,
                                                                      out dataSize, out dataPtr, out opcode, IntPtr.Zero);

            if (hr == 1610)
            {
                throw new BadConfigurationException();
            }
            Helper.ThrowExceptionForHR(hr);
            profile = Marshal.PtrToStringUni(dataPtr, (int)(dataSize >> 1));
            return(opcode);
        }
        public static WlanOpcodeValueType QueryConnectionSettings(out WlanHostedNetworkConnectionSettings settings)
        {
            uint   dataSize;
            IntPtr dataPtr;
            WlanOpcodeValueType opcode;
            var hr = WlanNativeMethods.WlanHostedNetworkQueryProperty(wlanHandle,
                                                                      WlanHostedNetworkOpcode.ConnectionSettings,
                                                                      out dataSize, out dataPtr, out opcode, IntPtr.Zero);

            if (hr == 1610)
            {
                throw new BadConfigurationException();
            }
            Helper.ThrowExceptionForHR(hr);
            settings = Marshal.PtrToStructure <WlanHostedNetworkConnectionSettings>(dataPtr);
            return(opcode);
        }