Include files for MASM x64 - windows

I am new to programming windows MASM applications and from what I understand in order to call WinAPI functions I need to first include the appropriate .inc files.
I am using Visual Studio 2019 and I can't find anywhere on my system windows.inc files what so ever. I've
searched online and I couldn't find any SDK for x64 MASM.
This question was asked a while ago but the answer is only relevant for x32 assembly.

So I've been doing some digging and from what I understand there's no official SDK for x64 MASM which is weird. What I did find is this forum "The MASM Forum". And they are working on x64 MASM SDK for a while now but it has a lot of features.
They state it's not perfect but it's more than nothing.
I had trouble installing it to be honest, also my anti virus classified 2 of the files as Trojan so you should download the files at your own risk(Maybe do it on a VM ?).
Also the comments under the question suggested creating your own .inc files which from what I understand now is not that difficult, I will be trying both methods and keep this post updated on the results.

I'm not sure if you're still wanting an answer, probably not since this was asked almost a year ago, but I'll reply to help anyone who may also be wondering. I just started trying to learn MASM and I was having a lot of trouble setting everything up, in fact I'm still working on getting x86 to work correctly on an USB (I think masm32 must be at the root of the USB(note: for old version, updated version will be more like x64))
For x64 you'll need Visual Studio installed, I'm using VS 2022. My examples should give you a good idea, just change to match your specific set up.
ml64.exe, link.exe, and lib.exe are all in the same folder:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\Hostx64\x64\ml64.exe
The resource compiler, rc.exe, is in a different folder:
C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe

Related

Multiple msvcr100.dll versions - where are the differences?

When deploying my app, the 2010 redistributable package x86 is needed. Having customers install it by themselves online is cumbersome. I would like to deploy msvcr100.dll and msvcp100.dll myself, which would work fine... However, on my system I can find multiple of these dlls. There is a redist folder in the Visual Studio 2010 directory and I used dlls from there, but they do not seem to work globally, either.
I know most of the threads, questions and articles to visual studio deployment on Stackoverflow and findable via Google. None gives a satisfying answer.
But my question here is: Are there multiple versions of msvcr100.dll globally available? If yes, why and how do they differ?

Visual Studio - "The system cannot find the file specified"

I just installed Visual Studio Community 2017 for school purposes. My lecturer gave us these instructions to use a GraphicsSDK library with VS (after we have Visual Studio installed). I ran the Tutorial.sln file he gave but I got this error.
I have followed all the steps correctly. I've been looking at other questions on StackOverflow and they said to change the Properties/Output file to $(OutDir)$(TargetName)$(TargetExt) but mine is correct.
I also noticed one line in the code which was underlined red.
/* Render here */
glClear(GL_COLOR_BUFFER_BIT);
It said that GL_COLOR_BUFFER_BIT was undefined. Not sure if this matters at all.
In older versions of Visual Studio the folder settings were part of the IDE. But in version 2017 you specify the search paths in the application itself.
If you go to your projects properties you will see a VC++ Directories section:
You need to make sure that the folders to the libraries and include files are correct (for both debug and release configurations).
Then, when you do a build it will be able to find the definitions it needs. But your question is lacking a lot of information. This is my educated solution for now.

Windows 7, 64 bit, DLL problems

I have a problem with our executable. I'm running this C++ 32-bit executable on my Windows 7 64-bit development box that also has all those Microsoft applications (Visual Studio 2008 + 2010, TFS, SDK, Microsoft Office)...
And it's still running just fine.
Now I got the client installation of the very same program and was asked to test it with a clean Windows 7 installation. Thus I got one Windows 7 64-bit VMware and updated it to Windows 7 SP 1 (the very same version my developer box is tuning).
But while on my developer box everything is fine the program does not work with the VMware (30 days trial) box.
The x86 Dependency Walker is telling me that the following DLL files are missing:
API-MS-WIN-CORE-COM-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
API-MS-WIN-SHCORE-SCALING-L1-1-0.DLL
DCOMP.DLL
GPSVC.DLL
IESHIMS.DLL
I googled for those API-MS-WIN-... DLL files and found they should actually already be part of Windows 7 (some sites claiming the belong to Windows 8 and Windows Server 2012 though).
I already tried the suggested fixes I found, which are:
running 'sfc /scannow'
installing Visual Studio 2008 SP1 runtime executables
But that didn't solve anything. :-(
Side note: My development box does not have them either, and does not seem to need them. For example, the user32.dll on my box does not link against one of those, while the installation on the VMware does.
Any idea on how to fix this issue?
I tried to find a suitable download / fix on the Microsoft pages, but I failed.
After solving my issue I wanted to report what I found out, and I can't post this as an answer because the question has been closed.
Actually all the DLL files reported missing by the Dependency Walker tool, namely those
* API-MS-WIN-CORE-...
type DLL files were not part of the actual problem.
In my case the registration of three OCX files was missing and after that everything was just fine, BUT Dependency Walker tool still listed all the very same DLL files as before even when the program was just running fine now.
The gist of it: As someone elsewhere stated, the tool is a bit dated by now and does not always work properly with a newer OS. Thus keep an eye open and don't get mislead by missing 'API-MS-WIN-CORE-COM-L1-1-0.DLL', ... the problem probably lies entirely elsewhere.
This problem is related to missing the Visual Studio "redistributable package." It is not obvious which one is missing based on the dependency walk, but I would try the one that corresponds with your compiler version first and see if things run properly:
Visual Studio 2015
Visual Studio 2013
Visual Studio 2010
Visual Studio 2008
I ran into this problem because I am using the Visual Studio compilers, but not the full Visual Studio environment.
Going to dare to inject a new link here: The latest supported Visual C++ downloads. Stein Åsmul, 29.11.2018.
I just resolved the same problem with C++ Qt 5 and Windows 7 64 bits with MSCVC 2012.
In the beginning I thought it was a MSVC/Windows DLL file problem, but as BorisP said, the problem was in my project dependencies. The key is "How to know your project dependencies in Qt 5?".
As I didn't find any clear way to know it (Dependency Walker didn't help me a lot...), I followed next the "inverse procedure" that takes no more than 5 minutes and avoid a lot of headaches with DLL file dependencies:
Compile your project and take the executable file to an empty folder: myproject.exe
Try to execute it, It will retrieve an error (missing DLL files...).
Now, copy all the DLL files from Qt (in my case they were in C:\Qt\Qt5.1.1\5.1.1\msvc2012_64_opengl\bin) to this folder.
Try to execute again, it will probably works fine.
Start to delete progressively and try every time your executable still works, trying to leave the minimum necessary DLL files.
When you have all the DLL files in the same folder it is easier to find which of them are not valid (XML, WebKit, ... whatever..), and consequently this method doesn't take more than five minutes.
I just resolved the same problem.
Dependency Walker is misleading in this case and caused me to lose time. So, the list of "missing" DLL files from the first post is not helpful, and you can probably ignore it.
The solution is to find which references your project is calling and check if they are really installed on the server.
#Ben Brammer, it is not important which three .ocx files are missing, because they are missing only for Leo T Abraham's project. Your project probably calls other DLL files.
In my case, it was not three .ocx files, but missing MySQL connector DLL file. After installing of MySQL Connector for .NET on server, the problem disappeared.
So, in short, the solution is: check if all your project references are there.
As mentioned, DCOMP is part of the VC++ redistributables (implementing the OpenMP runtime) and is the only truly missing component. All the rest are false reports.
Specifically API-MS-WIN-XXXX.DLL are API-sets - essentially, an extra level of call indirection introduced gradually since Windows 7. Dependency Walker development seemingly halted long before that, and it can't handle API sets properly.
So there is nothing to worry about there. You're not missing anything more.
A better alternative to find the truly needed DLL files that are missing (if that is indeed the problem) is to run Process Monitor and step backwards from the failure, searching for sequences of failed probes for a specific DLL file in all the system path.
I also ran into this problem, but the solution that seems to be a common thread here, and I saw elsewhere on the web, is "[re]install the redistributable package". However, for me that does not work, as the problem arose when running the installer for our product (which installs the redistributable package) to test our shiny new Visual Studio 2015 builds.
The issue came up because the DLL files listed are not located in the Visual Studio install path (for example, C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist) and thus had not been added to the install. These api-ms-win-* dlls get installed to a Windows 10 SDK install path as part of the Visual Studio 2015 install (e.g. C:\Program Files (x86)\Windows Kits\10\Redist).
Installing on Windows 10 worked fine, but installing on Windows 7 required adding these DLL files to our product install. For more information, see Update for Universal C Runtime in Windows which describes the addition of these dependencies caused by Visual Studio 2015 and provides downloads for various Windows platforms; also see Introducing the Universal CRT which describes the redesign of the CRT libraries. Of particular interest is item 6 under the section titled Distributing Software that uses the Universal CRT:
Updated September 11, 2015: App-local deployment of the Universal CRT is supported. To obtain the binaries for app-local deployment, install the Windows Software Development Kit (SDK) for Windows 10. The binaries will be installed to C:\Program Files (x86)\Windows Kits\10\Redist\ucrt. You will need to copy all of the DLLs with your app (note that the set of DLL files are necessary is different on different versions of Windows, so you must include all of the DLL files in order for your program to run on all supported versions of Windows).
This contribution does not really answer the initial question, but taking into account the hit-rate of this thread I assume that there are quite a few people dealing with the problem that API-MS-WIN-CORE- libraries cannot be found.
I was able to solve a problem where my application refused to start with the error message that API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL is not found by simply updating Visual Studio.
I don't think that my build environment (Windows 7 Pro SP1, Visual Studio Ultimate 2012) was messed up completely, it worked fine for most of my projects. But under some very specific circumstances I got the error message (see below).
After updating Visual Studio 11 from the initial CD-Version (I forgot to look up the version number) to version 11.0.61030.00 Update 4 also the broken project was running again.
This solved the issue for me:
Uninstall the Visual Studio 2010 redistributable package if you have it installed already, and then install Microsoft Windows 7 SDK.
I solved the problem. When I registered the OCX files, I ran it with the Command Window that had been executed as an administrator.
For anybody who came here, but with a Photoshop problem: my solution was to uninstall the MS VC++ redistributable first x86 and 64 both. Then install one appropriate to the Windows version and architecture (86 or 64).
Installation of SQL Server Management Studio 2014 on a freshly installed Windows 7 resolved this problem at our client after a two-day ridiculous battle.
I came here with this problem occurring, after trying a fresh Windows 7 OEM install, upgrading to Windows 10.
After some searching of Microsoft forums and such I found the following solution which worked for me:
Replace C:\Windows10Upgrade\wimgapi.dll with the one from C:\Windows\System32\wimgapi.dll
I suggest also checking how much memory is currently being used.
It turns out that the inability to find these DLL files was the first symptom exhibited when trying to run a program (either run or debug) in Visual Studio.
After over a half hour with much head scratching, searching the web, running Process Monitor, and Task Manager, and depends, a completely different program that had been running since the beginning of time reported that "memory is low; try stopping some programs" or some such. After killing Firefox, Thunderbird, Process Monitor, and depends, everything worked again.
I had the same problem. After spending hours searching on the web, I found a solution for me.
I copied the file combase.dll file (C:\Windows\System32) to the release folder, and it resolved the problem.
Just to confirm answers here, my resolution was to copy the DLL that was not loading AND the ocx file that accompanied it to the system32 folder, that resolved my issue.

HOW TO INSTALL openCV in Win7 -64-bit

I am facing problem in installing openCV in Win7 -64bit, and i need to know how to do it?
i have downloaded http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3.1/
131mb file from here and it doesnt contain any exe file, it contains some cmake file.
Help me.
Thanks,
sumit
Assuming you are using Visual Studio, after extracting the files to a location like c:\OpenCV-2.3.1\ you should setup a new project and link OpenCV libraries.
A couple of months ago I wrote a detailed tutorial explaining how to setup projects using Visual Studio 2010 in a 64bit machine. You can find the tutorial here.
I am surprised that you are not having trouble with your entire windows breaking down/slowing down. Please read this http://answers.opencv.org/question/3996/cannot-do-anything-with-opencv-anymore-on-windows/
If you are NOT having the same problem, I would love to hear how you managed to setup OpenCV to work with Visual Studio 2010 (or Visual C++ 2010 Express) on Windows 7 64-bit machine.
Once again, sorry that I technically unable to post it as a comment because I know that it is not ACTUALLY an answer.
I've written a blog post which can help you with the installation. It includes detailed steps, right from adding the dll's to the PATH variable, to running a simple program. Hope it helps!
I am not sure what are your situation about, I can download a .exe from that page directly. The whole 131mb file is an exe file.
You may try this direct link.

Where is exchext.h?

I am using VisualStudio .NET 2003 on Windows 7. I get the error below while compiling one of my projects.
fatal error C1083: Cannot open include file: 'EXCHEXT.H': No such file or directory
The file EXCHEXT.h is supposed to be in C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include folder. I have searched everywhere but cannot find this file.
Can anyone give me a pointer to what is happening?
I know it's been a while since the questions was posted, but kind of ran into this issue myself. I checked the windows SDK and, sure enough, it wasn't there. Seems to have been dropped a while ago, even though it is highly needed, for this type of addin development. I ended finding an old checked in copy I had, but also did come across this from google code: http://code.google.com/p/outcall/source/browse/trunk/exchange/include/EXCHEXT.H?r=8.
Hope this helps.

Resources