Bug 505032. Fix compilation of nsWifiScannerWin on MinGW. r=biesi

--HG--
extra : rebase_source : 1cc3dfd4a7cee3b62441370e511e2acc41327974
This commit is contained in:
Jacek Caban 2009-08-05 14:39:06 +12:00
parent 1728ef417e
commit df73bbb021
2 changed files with 10 additions and 11 deletions

View File

@ -201,7 +201,7 @@ int PerformQuery(HANDLE adapter_handle,
return ERROR_SUCCESS;
}
HANDLE GetFileHandle(const unsigned short* device_name) {
HANDLE GetFileHandle(const PRUnichar* device_name) {
// We access a device with DOS path \Device\<device_name> at
// \\.\<device_name>.
@ -219,7 +219,7 @@ HANDLE GetFileHandle(const unsigned short* device_name) {
}
bool UndefineDosDevice(const unsigned short* device_name) {
bool UndefineDosDevice(const PRUnichar* device_name) {
// We remove only the mapping we use, that is \Device\<device_name>.
nsString target_path;
target_path.Assign(L"\\Device\\");
@ -230,14 +230,14 @@ bool UndefineDosDevice(const unsigned short* device_name) {
target_path.get()) == TRUE;
}
bool DefineDosDeviceIfNotExists(unsigned short* device_name, bool* dosDeviceDefined) {
bool DefineDosDeviceIfNotExists(const PRUnichar* device_name, bool* dosDeviceDefined) {
// We create a DOS device name for the device at \Device\<device_name>.
nsString target_path;
target_path.Assign(L"\\Device\\");
target_path.Append(device_name);
unsigned short target[kStringLength];
WCHAR target[kStringLength];
if (QueryDosDeviceW(device_name, target, kStringLength) > 0 && target_path.Equals(target)) {
// Device already exists.
@ -273,7 +273,7 @@ void GetNetworkInterfaces(nsStringArray& interfaces)
}
for (int i = 0; ; ++i) {
unsigned short name[kStringLength];
WCHAR name[kStringLength];
DWORD name_size = kStringLength;
FILETIME time;
@ -299,7 +299,7 @@ void GetNetworkInterfaces(nsStringArray& interfaces)
break;
}
unsigned short service_name[kStringLength];
PRUnichar service_name[kStringLength];
DWORD service_name_size = kStringLength;
DWORD type = 0;
@ -362,7 +362,7 @@ nsWifiMonitor::DoScan()
for (int i = 0; i < interfaces.Count(); i++) {
nsString *s = interfaces.StringAt(i);
unsigned short *service_name = (PRUnichar*) s->get();
const PRUnichar *service_name = s->get();
#ifndef WINCE
bool dosDeviceDefined = false;
@ -429,7 +429,6 @@ nsWifiMonitor::DoScan()
#endif
// Walk through the BSS IDs.
int found = 0;
const uint8 *iterator = (const uint8*)&bssid_list->Bssid[0];
const uint8 *end_of_buffer = (const uint8*)buffer + oid_buffer_size_;
for (int i = 0; i < static_cast<int>(bssid_list->NumberOfItems); ++i) {

View File

@ -39,7 +39,7 @@ typedef DWORD (WINAPI *WlanOpenHandleFunction)(DWORD dwClientVersion,
// WlanEnumInterfaces
typedef enum _WLAN_INTERFACE_STATE {
WLAN_INTERFACE_STATE_UNUSED,
WLAN_INTERFACE_STATE_UNUSED
} WLAN_INTERFACE_STATE;
typedef struct _WLAN_INTERFACE_INFO {
@ -71,11 +71,11 @@ typedef struct _DOT11_SSID {
typedef UCHAR DOT11_MAC_ADDRESS[6];
typedef enum _DOT11_BSS_TYPE {
DOT11_BSS_TYPE_UNUSED,
DOT11_BSS_TYPE_UNUSED
} DOT11_BSS_TYPE;
typedef enum _DOT11_PHY_TYPE {
DOT11_PHY_TYPE_UNUSED,
DOT11_PHY_TYPE_UNUSED
} DOT11_PHY_TYPE;
#define DOT11_RATE_SET_MAX_LENGTH (126)