[Bug 51524] New: szExeFile is different from Windows

WineHQ Bugzilla wine-bugs at winehq.org
Mon Jul 26 12:12:08 CDT 2021


https://bugs.winehq.org/show_bug.cgi?id=51524

            Bug ID: 51524
           Summary: szExeFile is different from Windows
           Product: Wine
           Version: 6.13
          Hardware: x86-64
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: -unknown
          Assignee: wine-bugs at winehq.org
          Reporter: lahvuun at gmail.com
      Distribution: ---

When calling Process32Next, szExeFile in the returned structure is different
from Windows.

Here is the source code for programs I used to test this:
// app.cpp
// i686-w64-mingw32-gcc app.cpp -o app.file
#include <windows.h>

int main() {
  Sleep(5000);
}


// test.cpp
// i686-w64-mingw32-g++ -static-libstdc++ -static-libgcc test.cpp -o test.exe
#include <cstdio>
#include <windows.h>
#include <tlhelp32.h>

int main() {
  STARTUPINFOW sinfo;
  memset(&sinfo, '\0', sizeof(sinfo));
  sinfo.cb = sizeof(sinfo);
  PROCESS_INFORMATION info = {0};
  wchar_t str[] = L"App.file";
  CreateProcessW(NULL, str, NULL, NULL, FALSE, 0, NULL, NULL, &sinfo, &info);

  HANDLE snapshotHandle = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  LPPROCESSENTRY32 lppe;
  if (Process32First(snapshotHandle, lppe)) {
    while (Process32Next(snapshotHandle, lppe)) {
      if (!_stricmp("App.file", lppe->szExeFile)) {
        printf("%s\n", lppe->szExeFile);
      }
    }
  }
}


Running test.exe with wine I get the following output:
lahvuun at lahvuun ~/git/winebug wine test.exe
App.file

On Windows 10 with powershell and the same pair of binaries I get:
PS D:\app> ./test.exe
app.file

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list