#2045 wtsapi32.h not working for _WIN32_WINNT_WINXP

WSL
closed
Earnie Boyd
4.0.2 (1)
Bug
fixed
Feature_in_WSL_4.0
True
2014-03-26
2013-09-15
Janne Rönkkö
No

Changes made in commit 73f6ac0c5a3c485b0bcea20e05f06dc9f705bf6c (Redo the filters based on assumptions discussed in mingw-dvlpr list.) cause compilation errors. The issue is located in wtsapi32.h.

There are currently multiple issues that are triggered when _WIN32_WINNT is set to, for example, _WIN32_WINNT_WINXP (0x0501).

To reproduce, create the following C++ program:

#define _WIN32_WINNT _WIN32_WINNT_WINXP
#include <Windows.h>
#include <Wtsapi32.h>
int main()
{
  return 0;
}

And then compile it with: g++ -o test test.cpp (assuming that the source is in test.cpp)

The attached patch fixes the issue. The patch was made using cygwin tools so newlines might need conversion depending on the tools you use.

1 Attachments

Discussion

1 2 > >> (Page 1 of 2)
  • Janne Rönkkö
    Janne Rönkkö
    2013-09-15

    I forgot to mention that the patch should be run in the include directory containing wtsapi32.h

     
  • Earnie Boyd
    Earnie Boyd
    2013-09-15

    • status: unread --> assigned
    • assigned_to: Earnie Boyd
     
  • Earnie Boyd
    Earnie Boyd
    2013-09-15

    I thought I got rid of those silly __in/__out things. This will cause a 4.0.2 to exist. In the meantime you can either remove the __in/__out or define them in _mingw.h as empty macros.

     
    Last edit: Earnie Boyd 2013-09-15
  • Janne Rönkkö
    Janne Rönkkö
    2013-09-15

    I fixed things with the patch I attached. There was also another issue that the WTS_CONNECTSTATE_CLASS was not defined when it was first used. The patch moves some declarations at the beginning of the file where those were earlier.

     
  • Earnie Boyd
    Earnie Boyd
    2013-09-15

    It also begs the question as to why we want specstrings.h since we don't use it but I'll leave that for now.

     
  • Earnie Boyd
    Earnie Boyd
    2013-09-15

    Here is the patch that I've applied. Your patch wasn't extensive enough to the supported OS and you changed the natural ordering of the OS filters.

     
    Attachments
  • Earnie Boyd
    Earnie Boyd
    2013-09-15

    • labels: --> 4.0.2
    • status: assigned --> open
    • Category: Unknown --> Feature_in_WSL_4.0
     
  • Earnie Boyd
    Earnie Boyd
    2013-09-15

    Janne, I want to give you credit for the work. What is a good reference to your SF profile page, the link they provide in this ticket doesn't go to a page I can access.

     
  • Keith Marshall
    Keith Marshall
    2013-09-15

    Although not strictly related, I'd like to document an issue with Janne's test case. This:

    #include <Windows.h>
    #include <Wtsapi32.h>
    

    is fundamentally broken. You should never capitalize the header file names, such as Windows.h. Correct usage demands windows.h. The capitalized form breaks, big time, for any user cross compiling on a $build with a case-sensitive file system.

     
  • Janne Rönkkö
    Janne Rönkkö
    2013-09-15

    I do not use sourceforge otherwise but for reporting bugs so I guess there is no good SF page for me.

    You can just use my email (jroo@iki.fi) or link to my BitBucket account (that currently only hosts single non-private project): https://bitbucket.org/janneron

     
1 2 > >> (Page 1 of 2)