Anything related to MS Windows Kernel API (part of Windows API), residing in the `kernel32.dll` library. This library provides basic kernel services to user code, e.g. copying or locking a file, creating a mutex or a process, allocating memory, etc. This library is used by both 32-bit and 64-bit Windows, despite the name.
Questions tagged [kernel32]
307 questions
3
votes
1 answer
Windows Kernel32.BatteryLifePercent = 255
I'm trying to build a Java app that reads the status of a laptop battery and sends a notification to the user if it's low. In order to do this, I'm using jna with Kernel32 native library as explained in the first answer of this question:
How to get…

Aurasphere
- 3,841
- 12
- 44
- 71
3
votes
2 answers
Get filename by process
I'm trying to retrieve the filename of a current process.
ie: If i have the file "test.txt" opened in Notepad, I need to get something like "c:\folder\test.txt"
The code below returns process informations, including the software path. (ie:…

Andre Felipe
- 169
- 1
- 7
3
votes
3 answers
How to tell if WOW file system redirection is on for a thread?
Say, I can use Wow64DisableWow64FsRedirection API to disable file system redirection, but is there a way to know if the thread is currently being redirected? In other words, is there an API like GetWow64FsRedirection?

c00000fd
- 20,994
- 29
- 177
- 400
3
votes
2 answers
Unable to attach to the process in the debuggeer
I followed the Grey Hat Python and made a debugger, but it can't work well.
I ran the calc.exe and find the PID. However, the debugger can't attach to the process. I copied the code from the book and also downloaded the code from the Internet. Both…

chensunn
- 155
- 1
- 2
- 8
3
votes
1 answer
Play Framework: java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32
I installed play framework, and created an application use the template of hello-play-java. when I compile, it has an error:
Refreshing list of source files to watch for changes...
[ERROR] Terminal initialization failed; falling back to…

Sealter
- 301
- 3
- 7
3
votes
1 answer
How to get Directory information via Windows native API?
I can get the created date, file size etc for a file using the following code:
// Error handling removed for brevity
HANDLE hFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);…

MalcomTucker
- 7,407
- 14
- 72
- 93
3
votes
2 answers
Low-Level C++ App Crashes on Windows Vista/7 Unless Run in XP Compatibility Mode
I have a low-level (like really low-level, it's basically all IOCTL calls and several calls to enumeration APIs) that crashes sporadically on Windows Vista/7 on clients' machines. Unfortunately, I have not been able to procure any crash dumps but…

Mahmoud Al-Qudsi
- 28,357
- 12
- 85
- 125
3
votes
2 answers
GetPrivateProfileString not working .NET
I want to make an INI reader with GetPrivateProfileString. What I'm using:
public class Config
{
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string Section, string Key, string Default, StringBuilder RetVal, int…

user2528595
- 75
- 2
- 5
3
votes
1 answer
Are kernel32.dll and shell32.dll supported in ARM?
I've a Metro App (C#) which is running fine on ARM (Surface), but a component is not working on ARM, when I checked my app compatibility on Windows App Cert Kits its showing this:
AreFileApisANSI , CopyFileW , CreateFileMappingW , CreateFileW ,…

Prashant
- 33
- 5
3
votes
2 answers
ReadProcessMemory fails on some Pages (GetLastError()=299)
I try to read all commited pages of a process (Win7-64). On most pages it works but it fails for a few pages. I cannot explain why. Here is my test programme (compiled x32, tested in Win7-64):
#include
void main()
{
HANDLE hProc =…

Arno Nühm
- 93
- 1
- 9
2
votes
0 answers
Creating a windows named pipe with security permissions
I want to create a named pipe from a java process and give full permissions to a user from different security group to connect to the pipe and use it.
The way i create the pipe is:
INSTANCE = (Kernel32)Native.loadLibrary("Kernel32",…

Erik Sapir
- 23,209
- 28
- 81
- 141
2
votes
2 answers
List of Kernel32.dll versions that ship with various Windows versions?
I'm trying to find out the true Windows version. For some reason my Wise installer sometimes reports the an XP version # on Windows 7.
One solution is to look at the kernel32.dll version as mentioned here:
How to detect true Windows version?
I'm…

Clay Nichols
- 11,848
- 30
- 109
- 170
2
votes
0 answers
Error while running .Net core 6.0 application in ubuntu using wine
We have .net framework based application which connects with backend using REST API. When we run this application using Wine on Ubuntu 20.04 it works perfectly well. Our requirement is that we need to covert this .net framework based application to…

Shalz
- 29
- 2
2
votes
1 answer
Unable to load shared library 'kernel32.dll'
I'm running a dotnet webapp in my local (windows machine) and it works just fine. When I deploy the same application to an AKS container and try running it, it fails with
System.TypeInitializationException: The type initializer for…

user1455116
- 2,034
- 4
- 24
- 48
2
votes
0 answers
FreeLibrary not working on Loaded C++ DLL
I'm using an external DLL which is written in C++. It's a cURL Wrapper. I do not have access the code, just DLL.
//Import kernel32 DLL
static class NativeMethods
{
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string…

Mre Sie
- 31
- 1