320 questions
0
votes
0
answers
83
views
Cant find `kernel32.lib` despite windows sdk and other tools installed and using correct environment [closed]
i wanted to build a python-c library, so i installed vs build tools 2022. i checked desktop dev with c++ and selected msvc, windows sdk, vcpkg, address sanitizer, cmake and msvc cli. I am on windows ...
2
votes
2
answers
174
views
ERROR_INVALID_PARAMETER in SetEnvironmentStringsW on empty environment
Normally, the function SetEnvironmentStringsW can be used to restore a block of environment variables that has been backed up via GetEnvironmentStringsW before. This is a convenient way to experiment ...
0
votes
0
answers
132
views
C# & .NET 4.8 - DllImport does work in Debug mode but not in Release mode
I have the following code:
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr SetDllDirectory(string lpPathName);
string dllFolderPath= @"C:\temp\lib";...
0
votes
0
answers
66
views
Application.GetOpenFilename for a UNC without using Kernel32
My company has recently instituted some significant security upgrades that disallows the calling of Kernel32.dll using VBA. Without this I can't call Application.GetOpenFilename and set the network ...
1
vote
1
answer
56
views
Can't capture output on testing 'WriteFile' function call via JNA
I want to write a test which would confirm that my string is successfully printed to console via JNA using WriteFile function.
Specs:
Windows 11 Home, Version 22H2
Java 22
JNA 5.14.0
Kernel32.java
...
1
vote
1
answer
319
views
How to Enumerate Threads using CreateToolhelp32Snapshot and Python ctypes?
This seems like it should print the thread ID of the first thread in the snapshot, but it always prints 0. What is wrong with it?
The following assumes that process ID 1234 is a real, running process.
...
1
vote
1
answer
113
views
Create Process in Debug Using Python ctypes
The following code is supposed to start a new process calc.exe in debug mode. However, it fails with the code 2 or ERROR_FILE_NOT_FOUND. However, this file calc.exe does exist on the system. What ...
0
votes
0
answers
187
views
Kernel32.dll LoadLibrary does not work in Docker container
I am developing a .NET WebApi Application which is intended to make calls to a Windows dll library. I use kernel32.dll's function LoadLibrary to load the dll. When I run the application on IIS or IIS ...
0
votes
1
answer
2k
views
LNK1104 cannot open file 'kernel32.lib'
Getting following error LNK1104 cannot open file 'kernel32.lib', what path do i need to add, and where to add it in Visual Studio 2022.
I looked at previous threads, most solutions are for older ...
2
votes
2
answers
864
views
How to capture a DLL's stdout/stderr in Python?
How can you capture a DLL's stdout and/or stderr in Python on Windows? For example, this prints "hello" to stderr, but it should be possible to capture the "hello" as a string ...
0
votes
1
answer
91
views
Use CreateThread With Kotlin Native?
I tried to use CreateThread in kernel32 to start a DataCollectorEntry function in new thread but it did not execute any line on the function and the GetLastError return 0
that means everything is ...
0
votes
1
answer
635
views
"bootstrap handle cannot be initialized" error when working with LibreOffice in .NET Core?
I'm attempting to work with LibreOffice using .NET Core, but I'm encountering an error that says 'bootstrap Handle is not initialized .
using unoidl.com.sun.star.uno;
m_xContext = uno.util.Bootstrap....
1
vote
1
answer
238
views
IsWindows10OrGreater function from <VersionHelpers.h> usage problem in asm x86 code
Have a task to call IsWindows10OrGreater function in asm x86 code. At first, I tried to include it from kernel32 lib, but than I found out that this library doesn't contain IsWindows10OrGreater ...
0
votes
0
answers
660
views
USB C# .NET Write on USB printer device using kernel32.dll's WriteFile
I've been trying to get it to work for a while, but I just can't. And looking online there don't seem to be many USB oriented answers for communicating with a printer.
The final objective is to ...
1
vote
1
answer
616
views
How to create an import library for kernel32.dll using a .def file on x86?
I have a small project that does not depend on the CRT or windows sdk. In order to link against kernel32.dll I created a minimal .def file with only the couple functions I need:
LIBRARY kernel32.dll
...