php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54407 Incorrectly defined NTDDI_VERSION macro
Submitted: 2011-03-28 11:38 UTC Modified: 2012-03-04 15:23 UTC
From: pvasilevich at parallels dot com Assigned: pajoye (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.3.6 OS: Windows Server 2008
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pvasilevich at parallels dot com
New email:
PHP Version: OS:

 

 [2011-03-28 11:38 UTC] pvasilevich at parallels dot com
Description:
------------
win32\build\config.w32.h.in  file contains the following code:

/* Define the minimum supported version */
#undef _WIN32_WINNT
#undef NTDDI_VERSION
#define _WIN32_WINNT 0x500
#define NTDDI_VERSION  _WIN32_WIN2K

Now look at some Windows Platform SDK file, for example ShlObj.h:

#if (NTDDI_VERSION >= NTDDI_WIN2K)

you see that NTDDI_VERSION is compared to NTDDI_WIN2K, but NTDDI_WIN2K is defined in the following way:

#define NTDDI_WIN2K  0x05000000

So, macro NTDDI_VERSION defined in php config.w32.h equals to 0x500
, but compared to 0x05000000.

This is incorrect behavior and should be fixed.

Test script:
---------------
Schematic script:

#defined _WIN32_WINNT 0x500

#include "zend.h"
#include "ShlObj.h"

...
TCHAR ret[MAX_PATH + 1];
SHGetFolderPath(NULL, CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, ret);

Expected result:
----------------
NTDDI_VERSION is defined like:
#define NTDDI_WIN2K  0x05000000

OR

do not unset _WIN32_WINNT and NTDDI_VERSION if they are defined.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-06-05 23:24 UTC] iliaa@php.net
-Assigned To: +Assigned To: pajoye
 [2012-03-04 15:23 UTC] pajoye@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=323866
Log: - fix bug #54407, Incorrectly defined NTDDI_VERSION macro
 [2012-03-04 15:23 UTC] pajoye@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-03-04 15:23 UTC] pajoye@php.net
-Status: Assigned +Status: Closed
 [2012-03-04 22:15 UTC] pajoye@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=323903
Log: - fix bug #54407, Incorrectly defined NTDDI_VERSION macro
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun May 04 02:01:29 2025 UTC