How to know wifi connection has internet enabled using windows apis - c

I am using Windows XP. I am using wlanapi dll for getting API of wifi. When I connected with any wifi interface, How to know wifi connection has internet connection enabled or not?
Is there any API or way to know??

You could try pinging a known server
http://msdn.microsoft.com/en-us/library/windows/desktop/aa366050(v=vs.85).aspx
If not that I'm sure you could find something else in that library

Related

Error connecting to workgroup Remote Desktop client printer from domain host computer

I'm connecting remotely from home (Workgroup) Win7 PC to an office (Domain) Win7 PC using VPN and Remote Desktop. Remote Desktop connects fine but doesn't share my local resources no matter what I do. So to print from host (office) to client (home) I've set up printer network sharing (it's an HP printer connected at home via USB) and created a separate regular user without login privileges. Every several weeks something happens and the connection stops working.
Most recently, connection attempts to the remote printer return error 0x00000709.
Troubleshooting I've done:
Turned off firewall on both RDP client (home) and host (office) computers
Confirmed \\x.x.x.x\c$ is accessible from host to client
Cleared all connections using "net use" in command prompt (\\x.x.x.x\IPC$ usually appears after I open explorer to the client machine IP address and authenticate with the workgroup user account)
Confirmed the client VPN IP address is the same (when it changes, I have to reconnect the printer via explorer)
On client, tried to connect to printer via \\localhost in explorer and got the same error.
It drives me crazy that this works for a while and then stops with no apparent rhyme or reason. Windows updates might be the cause but the last update since this last happened was Microsoft Removal Tool (this morning) and it doesn't make sense this would cause the problem.
Any ideas what to try next?
Thanks
Ultimately, disabling IPv6 on the home PC's Local Connection adapter resolved the issue.
During troubleshooting, I was able to connect the office PC to another home PC (connected over AnyConnect VPN client) for file and print sharing, further complicating root cause analysis. I used WireShark to check outgoing packets from the office PC but was unable to check incoming packets on either home PC due to encryption on the VPN interface. WireShark revealed SMB connections were being successfully requested, opened AFAIK, and closed.
The issue was temporarily resolved when I rebooted both the target home PC and the Cisco ASA. This resulted in a new VPN IP address being assigned to the home PC. The issue returned 1-2 days later. Logging into the office PC with a different domain account did not resolve the issue. Disabling IPv6 on the home PC's Local Connection adapter did resolve it. I thought to do this after noticing the public IP address given on whatismyip.net was an IPv6 address, where in the past I've always seen an IPv4 address.
I hope this helps someone.

Cannot Connect to RDP from Laptop on Ethernet, WiFi and Phone are OK?

What I can do:
can connect to desktop Win10pro from phone (wifi/data)
can connect to desktop Win10pro from laptop Win10pro (wifi only)
can connect to desktop Win10pro from work Win7 (desktop)
can connect to desktop Win10pro from TeamViewer
Problem:
When I try to connect to my desktop from my laptop using the usb ethernet dongle, everything listed above seizes to function; only a black screen after logging in. Keep in mind, this setup did work 5 months ago, only thing that changed was that I reset/refresh my laptop because it became bogged down and switched from college to home.
What I've tried:
System Restore on the host desktop
sfc /scannow both host and laptop
resetting network adapter and settings on laptop
checking regedit to make sure 3389 was listening on laptop
disabled/enabled NLA
disabled/enabled RDP on host desktop
enabled RDP on latop
uninstalled network adapter and reinstalled on laptop
turning off wifi on laptop and then trying to connect
If anyone has any other suggestions, that would be awesome.
UPDATE: As someone suggest to get a new USB Dongle, went out and bought one. Still does not work. Extremely laggy and black boxes everywhere.
What solved my issue was using the internal ipv4 address when I am on the local network; else, using the external ipv4 when I am away from home.
Thing to note is that even when I was internally using ipv6, I had a huge issue with this and could not connect to it internally using external ipv4 with :3389 at the end of it.
Hope this helps someone.

138 Connection Timed out on NoMachine Client - always

I am trying to connect from a NoMachine client on a Windows 7 machine to an OpenSUSE machine. I can only connect via NX however I keep running into Error 138:Connection Timed out. I can connect via SSH on my Command prompt however Seem to be unable to connect via here. Does anyone know a solution - been doing this since morning with no light in sight!
Routers supporting UPnP or NAT-PMP are configured automatically to pass connections to NoMachine and all required information is displayed at initial screen (Welcome to NoMachine).
Routers not supporting UPnP or NAT-PMP and Firewalls have to be configured manually to pass traffic to port 4000 (NX protocol), 22 (SSH protocol on Linux/MacOSX) or (4022) (SSH protocol on Windows).
So, check the configuration first.
I have a similar issue setting up my ftp server.
There are a couple of possibilities why the connection was not established, but in my case, and perhaps yours, you must allow the service you're trying to execute in your firewall settings.
In my case I allowed the ftp port and some other specific port for tcp communication.
This (and the proper service, router, etc setup) allowed the communication to be established.

Opening ports for Windows Azure Virtual Machine

I have a Sql Server instance installed on my Azure Virtual Machine. I've changed the port for Sql Server to...let's say 4849. I opened this port in Windows Firewall and established the endpoint for both TCP and UDP. I check to see if the port is open via http://www.yougetsignal.com/tools/open-ports/ and it's still closed. What am I missing here?
I'm utilizing SQL Server 2012 SP1 on Windows Server 2012.
Thanks in advance!
Not sure how this service checks for opened ports, but if it doing so by sending "ping" command then it may not work. You would need to do additional stuff for that to work. Please check this blog post for more details: http://blogs.biztalk360.com/windows-azure-virtual-machines-virtual-network-may-not-ping-automatically/.
Does this need to be accessible to the outside world? If so, you will need to open it on your firewall and have the firewall forward traffic on that port to your VM.
Also, you might need to check the config of your VM network adapter, if it's using NAT to share the hosts IP address, you might encounter problems, depending on what host you're using, I find that bridged mode works best so that the VM can use it's own IP address on the network.
I think you can also try this one to enable PING command for Azure virtual machine: http://blogs.biztalk360.com/windows-azure-virtual-machines-virtual-network-may-not-ping-automatically/

Remote usb connection C

I'm trying to connect to an USB device that's on a remote PC (because there is no 64-bit driver for it, remote PC is 32-bit).
I know the commands that I need to send to make settings on the device but I don't know how I can get connected to it. Is there a C++ or C# library that makes it possible to connect to this device on a remote PC?
You might be able to build something using Microsoft's RemoteFX technology, assuming Windows is your target platform.

Resources