private int GetInterfaceInt(Wlan.WlanIntfOpcode opCode)
            {
                int    dataSize;
                IntPtr ppData;

                Wlan.WlanOpcodeValueType wlanOpcodeValueType;
                Wlan.ThrowIfError(Wlan.WlanQueryInterface(this.client.clientHandle, this.info.interfaceGuid, opCode, IntPtr.Zero, out dataSize, out ppData, out wlanOpcodeValueType));
                try
                {
                    return(Marshal.ReadInt32(ppData));
                }
                finally
                {
                    Wlan.WlanFreeMemory(ppData);
                }
            }
Exemple #2
0
            /// <summary>
            /// Gets a parameter of the interface whose data type is <see cref="int"/>.
            /// </summary>
            /// <param name="opCode">The opcode of the parameter.</param>
            /// <returns>The integer value.</returns>
            private int GetInterfaceInt(Wlan.WlanIntfOpcode opCode)
            {
                IntPtr valuePtr;
                int    valueSize;

                Wlan.WlanOpcodeValueType opcodeValueType;
                Wlan.ThrowIfError(
                    Wlan.WlanQueryInterface(client.clientHandle, info.interfaceGuid, opCode, IntPtr.Zero, out valueSize, out valuePtr, out opcodeValueType));
                try
                {
                    return(Marshal.ReadInt32(valuePtr));
                }
                finally
                {
                    Wlan.WlanFreeMemory(valuePtr);
                }
            }