Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows 10 and Server 2016 running VFP compiled exe 1

Status
Not open for further replies.

John Stephen

Programmer
Jan 29, 2019
50
AU
I am posting this as general information in case someone has trouble in the future.
I have a client with a server running my (VFP compiled executable) and numerous PC's running on a network using mapped drives. The client updated to Windows Server 2016 and the trouble started. The errors were to do with "Can't find xxx on Users/John etc" (the original computer I work on). In short it appeared the network was dropping out.
The technician blamed my app of course so I showed him it worked fine when running through a VPN and Remote Desktop.
It wasn't until I Googled and found that Windows 10 (or Server 2016) drops Mapped Drives when they are idle for a time. The answer was to use a UNC path in the shortcut instead of an address via the mapped drive.
It is fine now running the UNC path. Never a dull moment
Cheers
John
 
Ha ha you are on the ball Olaf, I will add that to my box of tricks thanks.
There is another one that has foxed me for years. When Optimistic buffering is enabled it often corrupts my cdx files and worse. Forever I have tried to find a way to detect whether Write Caching is enabled on a PC so I can correct it. You got any ideas on that ?

Thanks and regards
John
 
Thank you but while this article deals with how to disable oplocks I couldn't find anywhere that describes how to programmatically detect their status if enabled.
Cheers
John
 
Hi Mike
No confusion, buffering is the problem (write caching etc being the most common)

Cheers
John
 
Sorry just wanted to share what we did do deal with corrupting indexes etc.
Thought this might help here too.

Wibenji
 
Winendji - Disable write caching on the C: drive

Cheers
John
 
Nowadays oplocks can't be disabled. It's a really high risc to run an old enough Server where SMB can be configured about that, as RANSOMWARE exploits vulnerabilities in older SMB versions. So forget about learning whether that's turned on or off. You should assume it's always on and set these keys on each client within setup of your application:

Code:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters]
"FileInfoCacheLifetime"=dword:00000000
"FileNotFoundCacheLifetime"=dword:00000000
"DirectoryCacheLifetime"=dword:00000000

Bye, Olaf.



Olaf Doschke Software Engineering
 
Hi Olaf, thank you very much. You have an amazing knowledge of this stuff. I wish some of my client's engineers had anywhere near as much. Can I ask a couple of questions please:
Should I use these registry entries on the Server only or on the workstations as well ? Bearing in mind all the data resides on the server, but temporary workspace is on each workstation so buffering happens when saving data to the server (or lost in a workstation outage).
I will probably have to check if the entries exist on each start up of the app because workstations get replaced.
Next I will have to learn how to check the registry and insert these values into it.
Thanks agai
John
 
This isn't even affecting servers. It's a client registry setting, as I said:

myself said:
set these keys on each client within setup of your application

It could suffice to set these keys in normal elevation within the application, generally, keys in HKEY_LOCAL_MACHINE\Software get virtualized and redirected to HKEY_CLASSES_ROOT\VirtualStore\Machine\Software
(see
If you try you'll see when looking into the registry at the desired location, when starting regedit elevated.

I still wish it would be an application setting, though it's not a per process but a per file thing. In most cases only one application uses a set of its own files like database files. So when it's known oplocks harm the files, there is no benefit insisting on them.

That it's a per-client setting makes it harder, but if not all clients use your software some still profit from oplocks, they're not overall having such bad effects as they have on DBFs and especially CDX and other database files. I know what you're talking about, that was the strongest effect I had once. We didn't solve it this way, way back then the only solution was to stay with Server 2003 for some databases, I don't even know if these settings applied with windows Vista, as I didn't know them back at the time, only you couldn't turn off oplocks and so the straight forward solution was using some file server not knowing them. That customer was weird, they used XP, Vista, Windows 8. They skipped the best Window Versions 7 and don't know whether they moved to 10 by now (which I think of as strong progress) or still use 8.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Thanks Olaf, this is all a bit (a lot) above my head but I will try to learn how to get and set registry items. Then maybe do some practice runs.
Regards, John
 
If you run regedit, you'll automatically be asked to elevate, so keys get to where they need to be.
If you have a setup and use ISE's way of defining registry keys the same applies.

There is code in the FFC samples about registry keys. So it's easy enough to set keys. The ffc class doesn't cover all type of keys, especially not dword keys, but search this site and you'll find a way to do that: thread184-869241

Anyway, it should best be a step the setup makes and not your application.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top