I already generated the SSID using this any one of this two method, try to modifie it in order to obtain exactly the string represinting the SSID and not only checking it's existing.
Sorry this source code is in c and not in vb. you can hide them in a dll as it was and call it from your vb application
you can visit this link to get further details
the building of the dll and others informations which can be obtained about the device.
extern "C" __declspec(dllexport) bool _stdcall getMAC(unsigned char bMac[6])
{/*======*/
wchar_t NameDev[256];
HANDLE hAdapter= NULL;
const unsigned short LENGHT_MAC = 6;
/*======*/
bool bRet = false;
const unsigned int iDim = (sizeof(NDISUIO_QUERY_OID) + (sizeof(unsigned char) * LENGHT_MAC));
UCHAR QueryBuffer[iDim];
memset(QueryBuffer, 0x00, iDim);
PNDISUIO_QUERY_OID pQueryOid;
pQueryOid = reinterpret_cast<PNDISUIO_QUERY_OID>(QueryBuffer);
pQueryOid->ptcDeviceName = NameDev;
pQueryOid->Oid = OID_802_3_CURRENT_ADDRESS;
DWORD dwBytesReturned = 0;
int iRetVal = 0;
iRetVal = DeviceIoControl( hAdapter,
IOCTL_NDISUIO_QUERY_OID_VALUE,
(LPVOID) pQueryOid,
sizeof(QueryBuffer),//1024, //sizeof(NDISUIO_QUERY_OID) + sizeof(DWORD),
(LPVOID) pQueryOid,
sizeof(QueryBuffer),//1024,
&dwBytesReturned,
NULL
);
//iRetVal: non-zero indica successo -- zero indica failure
if (bRet = (iRetVal != 0))
{
for (int i =0; i< LENGHT_MAC; i++)
bMac
= pQueryOid->Data;
}
return bRet;
}
/*********************/
extern "C" __declspec(dllexport) bool _stdcall getCurrentBSSID(unsigned char bMac[6])
{ /*======*/
wchar_t NameDev[256];
HANDLE hAdapter= NULL;
const unsigned short LENGHT_MAC = 6;
/*======*/
bool bRet = false;
const unsigned int iDim = (sizeof(NDISUIO_QUERY_OID) + (sizeof(unsigned char) * LENGHT_MAC));
UCHAR QueryBuffer[iDim];
memset(QueryBuffer, 0x00, iDim);
memset(bMac, 0x00, LENGHT_MAC);
PNDISUIO_QUERY_OID pQueryOid;
pQueryOid = reinterpret_cast<PNDISUIO_QUERY_OID>(QueryBuffer);
pQueryOid->ptcDeviceName = NameDev;
pQueryOid->Oid = OID_802_11_BSSID;
DWORD dwBytesReturned = 0;
int iRetVal = 0;
iRetVal = DeviceIoControl( hAdapter,
IOCTL_NDISUIO_QUERY_OID_VALUE,
(LPVOID) pQueryOid,
sizeof(QueryBuffer),//1024, //sizeof(NDISUIO_QUERY_OID) + sizeof(DWORD),
(LPVOID) pQueryOid,
sizeof(QueryBuffer),//1024,
&dwBytesReturned,
NULL
);
//iRetVal: non-zero indica successo -- zero indica failure
if (bRet = (iRetVal != 0))
{
memcpy(bMac, pQueryOid->Data, LENGHT_MAC);
/*
for (int i =0; i< LENGHT_MAC; i++)
bMac = pQueryOid->Data;
*/
}
return bRet;
}
regards