Avoid prompting users to redial when PPTP connection has been disconnected - c++

I am establishing PPTP connection to the remote server programmatically using RAS api in Windows. The problem is that when server disconnects (for example server stopped) windows automatically prompts user to redial (see screenshot), I don't want this prompt to be shown since my app handles everything by itself but couldn't find any options in RASENTRY to do so. This behavior occurs only on Windows 7, how this could be solved?

The problem was the RASEO2_ReconnectIfDropped option that I used for creating a connection. After removing it - prompt does not appear.

Related

Why is my AWS DeepLens unable to connect to WiFi?

I am setting up my AWS DeepLens and all the steps have been successful until I try to connect to my home WiFi. How do I fix this issue?
I created a hotspot on my phone to test against a different network and this connection was successful. Then, I switched back to my home WiFi and it connected successfully.
This section of the troubleshooting guide will also fix the problem.
We found that the AWS DeepLens only has one network adapter which it uses both for its own hotspot and connecting to the network. If you are connected to it via any other means (e.g. via a phone) it will throw a hissy and start dropping the connection, repeatedly and seemingly randomly.
When we connected a monitor directly we then found it was stuck on a viewable password prompt, hence why it was not connecting to our network.
Best method by far (and from our experience, only usable option) is to connect directly to the device so you can see what it is doing. To do this you need USB keyboard and mouse, and a mini-HDMI to HDMI cable to hook up a monitor. This will free up the network card to do only one thing.
When connecting please note that the default admin password on ours was "aws_cam". This does not seem to be noted anywhere in the documentation. This will change when you go through the setup process and sync it with your AWS account.
Repeat the process by inserting a pin in the hole at the back of DeepLens. Wait for a few seconds, the wifi indicator (the middle light) would blink and then you can connect with Deeplens wireless network. Then you can open http://deeplens.config where you can configure your home wifi and complete the setup.

Winsock client / server tutorial fails with desktop as client, but works with laptop as client

I have successfully built the client and server modules from the Getting Started with Winsock tutorial.
I have a desktop and a laptop both connected to my wireless router – both running Windows 10.
Running the client module on the laptop, I am able to successfully transmit data back-and-forth to the desktop (running the server module) using the desktop's IP address.
Running the client module on the desktop with the laptop's IP address as the command line argument, I get an "Unable to connect to server!" message after a ten second delay.
If I try to run both modules on the desktop in separate console windows using the "localhost" command line argument, the client console displays "Bytes sent: 14" and hangs waiting for a response from the server – however this works if I use either the desktop name or the desktop IP address in place of "localhost".
I am able to run both modules on the laptop using either "localhost", the laptop name, or the laptop IP address as arguments.
I have gone through the same motions with port 27015 forwarded on the router and incoming and outgoing firewall exceptions added to both the desktop and the laptop – there is no difference either way.
Any assistance would be greatly appreciated as I cannot figure out why this works in one direction but not the other.
Thank you for the suggestions Karsten and Andriy. I first tried getting the two computers to ping each other and neither was successful. After researching online, I was able to get them to ping after turning on "echo requests" in the firewall settings, but my original problem persisted. I then tried turning off both firewalls and I was able to get my server and client programs to work both ways. That wasn't a great long-term solution, so I tried selectively disabling the firewalls and realized it was an issue on the laptop's end. I noticed that my "server.exe" program was in the allowed apps list twice – one instance granting private access and one granting public access – but only one instance was active. I deleted both and added "server.exe" again with both public and private access boxes checked, which solved my issue.

ODBC SQL Driver Locked to Single User On Windows 2008 x64

I have two different C++ ISAPI DLLs that have been setup and configured for IIS 7 to use as web applications. They are setup using different application pools that are running under different domain user accounts. The problem that I am having is that, once one of the applications connects to SQL, the other application cannot. There are no differences in code between how the applications attempt to establish the connection – they both call the same static library method with identical parameters. The only way to get the second application to connect to SQL is to set its Application Pool user to the same domain user as the first application or vice versa (which rules out one user having insufficient permissions). I have double checked that ODBC connection pooling is turned on for the SQL Driver and I've monitored the ODBC Data Source Administrator Trace logs. If I monitor the trace log while both application pools are running under different users, SQLAllocHandle shows up successfully for both enter and exit in the Trace, but SQLDriverConnect will only succeed for both enter and exit for the first application that calls it. When the second application calls SQLDriverConnect with the exact same parameters, the trace only shows enter and debug logs also indicate that this function call never returns. Packet traces indicate that the second application never even attempts to connect to the SQL server. However, the first application will connect just fine and running a profiler in SQL will show proper execution of SQL statements. These applications ran just fine using the same multi-user configuration on Windows 2003 x86 under IIS 6 and older versions of the ODBC drivers.
I am hoping that there is a simple ODBC setting that I've missed, but my searches come up empty. Any help anyone can provide would be greatly appreciated, thanks in advance.
After over a week of troubleshooting and talking with Microsoft, we've finally found a solution. From what Microsoft told us, they changed the way that processes can interact with each other between 2003 and 2008 and using our static linked library like we were was causing a locking issue when it was running under different users. When we introduced a new thread before calling the ODBC connector, everything works fine.

communicating with windows service using SERVICE_USER_DEFINED_CONTROL

I am looking forward for an example for using a user defined control code in services. I want to send a user defined command to my windows service. At this command windows service will create a named-pipe for client process, and client will establish a connection with this named-pipe by CreateFile function. My custom control sometimes works well but later it shows error for invalidation.
So how can I establish information exchange between a service and various clients?
SERVICE_USER_DEFINED_CONTROL is rarely used. When it is used, it is generally to prompt the service to re-read its configuration file. (On unix SIGHUP is generally used for the same purpose).
In your case the correct answer is to simply create the named pipe on startup and keep listening, and wait for someone to connect if they ever do.

a ntservice c++ program can work well in xp but error in windows7

i wrote a program in c++ of win32, unicode; it uses socket to read data from another program;
i tested it in a local pc; i compiled it with vs2008;
when used as a console mode, it works properly in both winxp and win7;
when used as a ntservice, it works in xp, but fails in windows7;
in win7, that is, its socket is work well, and it can output logs used logcplus, but it can not access another program's api to read data; meanwhile, its logs cannot show in debugview, though i output logs used OutputDebugString under debug mode;
http://technet.microsoft.com/zh-cn/query/bb203962(v=VS.71) says:
Session 0 Isolation
Services have always run in session 0. Before Windows Vista, the first user to log on was also assigned to session 0. Now, session 0 is reserved exclusively for services and other applications not associated with an interactive user session. (The first user to log on is connected to session 1, the second user to log on is connected to session 2, and so on.) Session 0 does not support processes that interact with the user.
This change means that a service cannot post or send a message to an application and an application cannot send or post a message to a service. In addition, services cannot display a user interface item such as a dialog box directly. A service can use the WTSSendMessage function to display a dialog box in another session.
if it is the reason, how to resolve it?
thanks