Visual FoxPro and Windows XP SP2 (by John Koziol)
There have been some questions in the VFP community about what issues there are with Visual FoxPro applications under Windows XP SP2. At this time, we're still testing but we do know some basic information. Basically, the vast majority of applications will be unaffected. I'll be adding to this thread if other issues crop up.
First off, you should read https://msdn.microsoft.com/security/productinfo/XPSP2/introduction.aspx and then https://www.microsoft.com/technet/prodtechnol/winxppro/maintain/winxpsp2.mspx to get a grasp of what SP2 does.
Here's what we know so far.....
There's a switch in SP2 called the NX (No Execute) switch. It is set for the system as a whole but can be set per process. When on, it limits access to areas of memory allocated as data by throwing an access violation.
Two types of uses of VFP are affected when this switch is on:
1. Calling a COM server via early binding.
2. Implementing an interface that will be called via early binding.
Now, this switch is only supported on the AMD K8 64-bit processor at this time; NX cannot be switched on for Intel processors. Therefore, there should be no effect on VFP EXEs and DLLs on Intel machines.
I'll update this blog with code samples and any other pertinent information as it becomes known. For now, I'd summarize with the phrase “don't worry - be happy“
Comments
Anonymous
March 09, 2004
Hi John,
Great post! This is the kind of blog posting I like the most: information from experts you don't find anywhere else. Congratulations!Anonymous
March 09, 2004
Welcome to you as well. :-)Anonymous
March 09, 2004
Thanks, Fabio! I'll be posting some "no-no" code samples shortly...but the gist is, most VFP apps will be unaffected.
If you are utilizing Web Services, there are some ICF issues but they're generic and not specific to VFP - please read the links I posted.Anonymous
March 09, 2004
The comment has been removedAnonymous
March 10, 2004
ICF = Internet Connection FirewallAnonymous
March 10, 2004
Hi Ted,
I dunno - this could affect them but I have to admit to being lazy and not researching what these AMD chips are. As aforementioned, you can always set the NX switch off for specific processes if it becomes an issue - please read the documents I linked to. IMHO, it's not that big of a deal if you plan ahead and I think - personally - it's much ado about nothing.Anonymous
March 15, 2004
OK, here's the right way and the wrong way to create a COM object in VFP under NX. Note that most of this code is simply creating a DLL to instance.
BTW, here's a link to a paper by Calvin that adds more information to this discussion...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfoxgen7/html/vfpandcom.asp
:
:*
: Simple DLL call with earlybinding and late binding
:
: John Koziol and Calvin Hsia
:
:
:
:* Create a simple VFP DLL
:***********************************
IF FILE("testnx.dll")
DECLARE integer DllUnregisterServer IN testnx.dll
?DllUnregisterServer()
CLEAR DLLS
ENDIF
SET TEXTMERGE TO testnx.prg
SET TEXTMERGE ON NOSHOW
DEFINE CLASS testnx AS Session OLEPUBLIC
PROCEDURE MyEval(cExpr)
RETURN &cExpr
ENDPROC
ENDDEFINE
SET TEXTMERGE TO
BUILD PROJECT testnx FROM testnx
BUILD DLL testnx FROM testnx
:
: Here's a good way to create the COM object -
: no early binding. NX compatible.
:
ox=NEWOBJECT("testnx.testnx")
?ox.myeval("_VFP.ServerName")
RELEASE ox,oy
:
: Here's early binding, NOT NX compatible
:
ox=CREATEOBJECTEX("testnx.testnx","","")
?ox.myeval("_VFP.ServerName")
RELEASE ox,oy
:*************************************
RETURNAnonymous
June 18, 2004
The comment has been removedAnonymous
November 13, 2007
PingBack from http://foxpro.ntsl119.com/scr/archives/74Anonymous
January 17, 2009
PingBack from http://www.hilpers.fr/1026703-appli-vfp-bloquer-par-windowsAnonymous
January 17, 2009
The comment has been removedAnonymous
January 22, 2009
PingBack from http://www.hilpers.fr/833030-blocage-appli-vfp9