api-ms-win-core-wow64-l1-1-1.dll on Windows 10 - windows

I'm trying to revive some old software: it was developed on Windows XP, and I'm trying to get it working on Windows 10.
However, this software is dependent on api-ms-win-core-wow64-l1-1-1.dll, which isn't co-operating: Dependencies states that api-ms-win-core-wow64-l1-1-1.dll is missing imports, while Visual Studio's dumpbin states that it has no dependencies.
I'm aware that Microsoft has migrated its functionality and that nobody should link to the implementations directly, but is there any way to get api-ms-win-core-wow64-l1-1-1.dll functionality for this old software on Windows 10? Alternatively, is there an accessible way to rewrite old .dlls to link to Microsoft's Win32 APIs?
(For those who need the file: I got api-ms-win-core-wow64-l1-1-1.dll by running $ locate api-ms-win-core-wow64-l1-1-1.dll on a linux machine with wine installed on it.)

I'm not sure whether this directly addresses your issue. I'm supporting a Java app which uses JNI with some native Windows libraries. I used Dependencies to check what was missing and it turned out to be api-ms-win-core-wow64-l1-1-1.dll (through WS2_32.dll).
The solution for me was to install the latest VC redistributable from MS.

Getting libraries from Wine is probably not a solution, in case you seek to use them outside the linux environment. (They are wrappers and obviously not using native Windows assemblies)
You can get some success by using extracting them from the ReactOS live CD. However, you should be aware that many of these are umbrella libraries, as explained here:
An umbrella library is a single static-link library that exports a subset of Win32 APIs. For example, an umbrella library named OneCore.lib provides the exports for the subset of Win32 APIs that are common to all Windows 10 devices.
https://learn.microsoft.com/en-us/windows/win32/apiindex/windows-umbrella-libraries
https://learn.microsoft.com/en-us/windows/win32/apiindex/windows-apisets
https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis

Related

How to use Windows 7 APIs in an application that should also run on Windows XP

I'd like to use some functions that are only available in Windows 7 or higher in my application but I also want my app to remain compatible with Windows XP. The app should check at runtime if at least Windows 7 is available and offer some advanced features (like Media Foundation support) in that case.
Is the only way to do this to manually check for Windows 7-only DLLs using LoadLibrary and then importing all the functions I need using GetProcAddress()? This would be very inconvenient but I don't see any other way. Statically linking against Windows 7+ DLLs will cause the application to refuse to start on XP because of missing DLLs so this won't work. But doesn't the Windows SDK offer some more convenient technique for programmers who want to remain compatible with older Windows versions and optionally use features of newer Windows versions?
Note that my application is written in plain C so I'm looking for a solution in C.
Don't ever check for OS versions. Check for available features instead.
The most convenient way to keep your code compatible with earlier versions of Windows while still allowing it to opt-in to newer features is to use delay-loading of modules (see Linker Support for Delay-Loaded DLLs). This allows you to benefit from import resolution as you would with compile-time dynamic linking, yet allows you to respond to import failures at runtime.
There are 2 options:
LoadLibrary / GetProcAddress. It is not so inconvenient - you can define and assign function pointers and use them like normal functions.
Compile 2 versions for XP and 7. The installer chooses the right executable or XP version is started by default and it runs second executable if OS is Win7.

Why Qt is making developers to include their dlls for every application?

I noticed that deployed on windows Qt applications are always including the dlls they needed.
Why did they made it that way?
Why can't they do it like on linux? - You install needed Qt version to system, and then every application that need it - can use it, e.g. only one instance of libraries(excluding different versions like qt4/qt5).
Wouldn't it be better to make it like Java/.Net, e.g. you install Java/.Net then you run/develop applications using only one instance of libraries(dlls).
I find it kinda "unconservating": I have 7 applications that use Qt5, and all of them have Qt5Core.dll, Qt5GUI.dll, etc. and every of them takes some space. Feels like I have 7 packs of Qt5 libraries... x_x
While on linux these same applications use only "one" Qt library.
I noticed that deployed on windows Qt applications are always including the dlls they needed.
This is called "local deployment".
Why did they made it that way?
I can think of a few reasons.
To avoid DLL Hell.
It is sanctioned by Microsoft. They wrote, "You can use this deployment method to enable installation by users who don't have administrator rights, or for applications that can be run from a network share." (see https://learn.microsoft.com/en-us/cpp/windows/choosing-a-deployment-method?view=vs-2019)
You install needed Qt version to system, and then every application that need it - can use it, e.g. only one instance of libraries(excluding different versions like qt4/qt5)
Qt is a C++ library. C++ DLLs can differ by more than just a major version number. The DLLs could be built with MinGW, or they could be built with MSVC; They could be 32-bit, or they could be 64-bit. The different variants are incompatible with each other.
Example: if you force a PC to have one global copy of Qt 5.14.1 MSVC 32-bit and put that in your PATH, then:
Other Qt apps on that PC that are built with MinGW cannot run.
Other Qt apps on that PC that are 64-bit cannot run.
Apps that must use Qt 5.13 might be broken. (For example, if a critical bug exists in Qt 5.14)
Why can't they do it like on linux? .... on linux these same applications use only "one" Qt library.
I listed a few disadvantages of this approach above. In addition, the version of Qt in Linux distros are usually a few versions behind so applications in the distro repository cannot make use the latest features, bugfixes, or improvements.
That's part of the reason why systems like AppImage and Snapcraft were invented. Sometimes, Linux users also want an app to contain a copy of its libraries, instead of having a single global copy of the libraries.

Porting Linux project to windows platform with VS2015 using “mussel" library

I could find that vs2015 comes with mussel library which is more like to use POSIX calls. I went through the installation guide provided and through the official link, came to know that I need to run configuration file followed by make.
But the configuration file has not been provided with vs2015.
I request you to let me know the procedure if someone has done this before.
musl doesn't support Windows; from the FAQ page:
What are musl’s dependencies?
Linux 2.6 or later. Earlier versions will suffice for running most simple single-threaded programs, but due to bugs and conformance issues at the kernel level, musl is not offically supported on earlier kernels.
(now, Windows 10 does support running Linux binaries through WSL, but in that case you would be building musl through gcc inside the Linux "container" and it would be another kind of game entirely)
As it comes as VS2015 along with third party license I thought there should be a way to get it done. The folder location is Microsoft Visual Studio 14.0\VC\vcpackages\IntelliSense\iOS\OSS\musl-1.1.10
As said in the comment, from the folder name it seems that it's there just to aid IntelliSense when editing code for iOS targets.

How to build boost for ARM (to use on Windows Phone)

I am trying to use Boost for Windows phone 8 (or 8.1). How can I build and generate boost libraries to be used by Windows Phone?
Boost contains many libraries, some of which use banned APIs not allowed in Windows Phone. Here is a list of all the valid Phone APIs. Whether or not you can use an individual Boost library on Windows Phone will depend.
For header file only libraries, assuming there are no banned APIs in use, you don't need to do anything different from using in any other C++ Windows application. Just setup header file include path.
I've recently added a feature to Boost.Build to help targeting Windows Store and Phone applications. When building you can use windows-api=phone to specify you want to target Windows Phone. To see how to build Boost in general, take a look a previous question. Just like with a header file only library, if any banned APIs are in use you won't be able to use unless you replace the API in the sources. For example the following command can be used to build for the ARM architecture targeting Windows Phone 8.0:
b2 toolset=msvc-11.0 variant=release architecture=arm windows-api=phone

Bundling the Windows Mono runtime with an application

Regarding my earlier question about the Point of Mono on Windows, let's say that I develop an app against the windows mono runtime so that it will also run on Linux, OSX, etc.. and to make it more complicated, I use GTK# so that I don't have to deal with WinForms. Is there then an easy way to bundle the Windows Mono runtimes with my Windows version of the application so that it can all be installed at once? Or, is there no point to this? Once I develop against the Windows Mono runtime, would it still run fine against the MS .NET runtime? (I assume I would still need GTK# installed though).
The short answer is Yes.
The things you should take care about while programming are
Not to use platform API
Don't hardcode directory & file name separators, i.e. don't hardcode file paths, but use appropraite class to obtain path separator then concat the names.
Keep in mind that file names on *nx are case sensitve and on Windows are not. While programming don't refer to the same file as log.txt and Log.txt but keep it all small.
Other then that, if you created GTK# application on *nx system, you will be able to run it on Windows if you installed GTK# assembly, and vice-versa.
I did this myself, and it worked like expected. I had a problem to find specific assembly dll version of GTK# on Windows and that took me few hours.
In general, you probably would just use the .Net runtime on Windows. The installer for GTK# for .Net is available from Mono's download page. Your users would need this installed, and then could run you app using the regular .Net runtime.

Resources