2

We are working on borland delphi 5 on windows 2003 R2x64 bit Server OS.

Now we are going to upgrade our Windows OS from 2003 to 2012. I would like to know whether borland delphi 5 version is compatible with windows 2012 server OS.

Thanks In advance

Mannual Joseph

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
Mannual
  • 21
  • 1
  • 2
  • for application- and terminal servers see also [Recommended PE header settings for Delphi 7 application running on terminal server?](http://stackoverflow.com/questions/14378674/) – mjn Jul 14 '15 at 14:46
  • 1
    As already said, yes you can. However, it also depends on which Windows API calls your app might be using, as well as any drivers your app might be using. – Jerry Dodge Jul 14 '15 at 16:19
  • As @JerryDodge stated...the API's are where the gotcha's are...I remember working on some Windows Security API...and there was no way to make it work in 32bit...because MS had an internal structure that held a 64 bit data type and there was no way to pass a value to this internal data structure...but if you don't do anything weird...you should be fine... – House of Dexter Jul 14 '15 at 16:30
  • @House You can work with 64 bit data in a 32 bit process – David Heffernan Jul 15 '15 at 03:22
  • @David yes you can...but you can't if you can't get to the 64bit data...i.e internal data structure with no properties to access it...It was a bug in MS code for accessing Security Tokens and you needed to get higher privileges, the API after you passed your data did a sizeof and of course it failed because internally they stored it as 64 bits but gave you no access to it...MS workaround was to compile in 64bits. Don't remember the API call but I banged my head on it about 2 years ago... – House of Dexter Jul 15 '15 at 15:07
  • @HouseofDexter You can do anything you like with 64 bit data in Delphi 5. If you decided that it was impossible then I think you were mistaken. – David Heffernan Jul 15 '15 at 15:24
  • @David...I agree with you...I'm doing a terrible job of explaining...I wish I could remember what API call it was...I just remember I was trying to Raise Token privileges...and it wouldn't work if you called from a 32 program on a 64 bit Windows. MS knew about the issue and their response was to recompile in 64 bit if you wanted to use that API call. – House of Dexter Jul 15 '15 at 19:30
  • @David finally found it... WTSQueryUserToken https://support.microsoft.com/en-us/kb/920754 love MS workaround: WORKAROUND To work around this issue, you must port the functionality to a native 64-bit version. Depending on the functionality that is required, you may also encapsulate the Terminal Services API functions inside a native 64-bit out-of-process COM server. – House of Dexter Jul 20 '15 at 22:46

3 Answers3

2

Delphi 5 applications are 32 bit applications, using the Win32 API, which would run on Windows Server 2012.

But in respect to your application:

  • As a compiler, Delphi 5 apps would run on Windows Server 2010;
  • You would have to check all your third-party components (visual or DB);
  • Be aware that system-level expectations did change since Vista and Windows Server 2008 (e.g. how the common folders work);
  • Also note that your VCL UI won't be themed by default, and may have some refreshing issues.

The upcoming Nano Server edition of Windows 2016 will only provide Win64 APIs, and won't allow 32 bit code execution any more. So you would not be able to run Delphi 5 application in Nano Server - even if Windows 2016 (with its full APIs and GDI) was told to be still Win32 compatible - so Delphi 5 compatible.

Community
  • 1
  • 1
Arnaud Bouchez
  • 42,305
  • 3
  • 71
  • 159
  • Wait, so does this mean Windows Server 2016 is introducing 128bit? Because every version of windows has always supported an emulator of the prior bit-wise. – Jerry Dodge Jul 14 '15 at 18:45
  • Also, Server 2003 is comparable to XP. Why are you claiming that it's of the same compatibility as Vista? Vista was equivalent to Server 2008, whereas Windows 7 was equivalent to Server 2008 R2. Just like Windows 8 is equivalent to Server 2012. – Jerry Dodge Jul 15 '15 at 00:24
  • @Jerry ask yourself where the 128 bit hardware is? – David Heffernan Jul 15 '15 at 03:19
  • @JerryDodge I made a typo. Yes, WS2008 broke WS2003 compatibility, just like Vista broke XP compatibility about folders. – Arnaud Bouchez Jul 15 '15 at 09:07
1

Delphi 5 produces executables that can be run on any 32 bit or 64 bit version of Windows. So yes, Delphi 5 can produce executables that are compatible with Windows 2012 server.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • 2
    To add, it can run on Windows 64bit, but only in its 32bit emulator. Delphi 5 cannot compile native 64bit apps. – Jerry Dodge Jul 14 '15 at 16:20
  • @JerryDodge AFAIK this is not an "emulator", but an API translator, executed in the CPU switched in 32 bit mode, for the duration of each call. There is no emulation, just using low-level CPU trickery, with some API level plumbing. See https://en.wikipedia.org/wiki/WoW64 – Arnaud Bouchez Jul 14 '15 at 17:52
  • 1
    @ArnaudBouchez Microsoft disagree. They [say](https://msdn.microsoft.com/en-us/library/windows/desktop/aa384249.aspx): *WOW64 is the x86 emulator that allows 32-bit Windows-based applications to run seamlessly on 64-bit Windows.* And then more here: https://msdn.microsoft.com/en-us/library/windows/desktop/aa384274.aspx – David Heffernan Jul 14 '15 at 18:30
  • @DavidHeffernan Please read furhter: WOW64 is shipped and documented as an [emulator](https://en.wikipedia.org/wiki/Emulator), but it is not when run on x64 CPUs. Under Itanium, it *emulates* the CPU, but under x64, it does not *emulate* anything, but translates the API calls and execute the x86 code directly in the CPU, with *no emulation*. Just like [wine](http://wiki.winehq.org/Debunking_Wine_Myths#head-a97295d7364a2a87f5769eeff9b5105b61b85761), we may create a WOINE recursive acronym: WOW64 On Intelx64 is Not an Emulator. :) – Arnaud Bouchez Jul 15 '15 at 09:04
  • @ArnaudBouchez Clearly your definition of emulator does not match Microsoft's. I don't think you can claim authority on the meaning of that word. WOW64 is not an emulator according to your definition. WOW64 is an emulator according to Microsoft's definition. – David Heffernan Jul 15 '15 at 09:51
  • @DavidHeffernan This is not "my" definition, I just followed the most used understanding of "emulator" - this is why I put a link to [emulator](https://en.wikipedia.org/wiki/Emulator) in Wikipedia. I never ever take Microsoft wording as a reference for such concepts, since it is a reference in the Microsoft world, but not in the Computer world: the most obvious is about MS' error messages in Windows UI, or higher levels of MSDN documentation... – Arnaud Bouchez Jul 15 '15 at 16:20
  • @arnaud I think if we are all in agreement. If we use MS terminology then WOW64 is an emulator. There exist other definitions by which WOW64 is not an emulator. – David Heffernan Jul 15 '15 at 16:38
0

For the most part, if your application purely uses things built-in to Delphi, then you shouldn't have any problems at all. Delphi automatically uses the Windows API to be backwards-compatible. Therefore, if you have a very simple application using only the things which Delphi provides to you, then chances are your app should work in any (current) version of Windows.

On the other hand, if your app makes use of any direct Windows API calls, or if it uses other third-party libraries (such as ones requiring additional DLL's), then you may be in for an upgrade.

The Windows controls for a forms application are extremely standard, and adapt to all versions of Windows - and even can even automatically style to whatever version of Windows you're using. However, if you have any third-party custom controls, or anything which access the Windows API directly, then you will need to make sure those calls are compatible.

When using the Windows API, it's safe to assume that most of the calls are backwards compatible. Microsoft is very good at this. Again, if using the standard components/controls available in Delphi, and not directly accessing the Windows API, then you should be safe.

When it comes to 32/64bit applications... Every version of Windows supports an emulator of the prior bit-wise version. So, for example, all 64bit versions of Windows support running 32bit applications. On that same note, all 32bit versions of Windows support running 16bit applications. This support is through an emulator (WOW64) allowing even further support of backwards-compatibility.

In the end, as long as your application is purely using what Delphi makes available to you, and you aren't importing any additional third-party libraries, then you should be safe to go. I would say a 98% guarantee. The other 2% has to do with whether your app is using anything which relies on particular 32bit libraries.

When it comes to third-party libraries, the rule of thumb is to just make sure the library vendor claims they support the version of Delphi you're using. That still doesn't always mean it will work with 64bit though. For example, things which directly use drivers will also have to be sure to support either 32bit or 64bit drivers.

Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327