All Questions
5,360
questions
1
vote
0
answers
104
views
Concatenate pages of memory without copying the memory (by e.g. memcpy)
How to concatenate pages of memory without copying the memory (by eg.: memcpy()) ?
Take this example in which 3 regions of memory pages are allocated:
size_t GetStuff(char* Dest, size_t MaximumSize);
...
1
vote
0
answers
50
views
Linking GetUILanguageFallbackList API with MinGW-w64
I'm trying to use the Windows GetUILanguageFallbackList API with MinGW-w64.
Here is a very minimalistic example of calling the API:
#include <windows.h>
#include <muiload.h>
int main() {
...
-10
votes
0
answers
72
views
"undefined reference to `WinMain@16'" error in VS Code. Same program runs fine in online compilers [closed]
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
This error happens every ...
2
votes
0
answers
127
views
How to manually unwind the stack with RtlUnwind without using exceptions or error handling
I'm looking to unwind the stack conditionally and at a predetermined number of layers.
doing this with RtlUnwind gives one of two errors depending on how you use it.
A malformed function table was ...
1
vote
1
answer
69
views
d3d10 C interface not available
I am porting an application from D3D7 to D3D10.
Even though the C interface for D3D10 exists, It does not seem to be visible when compiling/linking.
The D3D7 version uses the C interface and I do not ...
0
votes
0
answers
83
views
Is it possible to turn the display off knowing the monitor handle [duplicate]
I can control the monitor brightness using DeviceIoControl and handle to the display device:
handle = CreateFile(monitor, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
But I also ...
2
votes
0
answers
105
views
Unable to recv data that recv(PEEK) returned
I was debugging some 64 bit, native C code using WinSock2 for TCP and after eliminating all of the errors I expected, I found out that WinSock2 was doing something I did not expect. Simplified for ...
4
votes
1
answer
195
views
WIN32 game loop is slow, can't handle 60HZ or 30HZ. What to do?
I'm just trying to learn to program a few things, and a game loop is one of those.
This game loop only process Windows messages, but it can not even handle 30 fps.
This is true also if the message ...
0
votes
1
answer
55
views
Can I keep the handle open for the whole program lifetime
I have a class for my Windows application which controls the panel brightness.
h = CreateFile(displayName,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
...
1
vote
0
answers
80
views
CreateFileTransactedW fail, and error code is 6725
I successfully got a transaction handle by CreateTransaction function, then I try to call CreateFileTransactedW with the transaction handle, but failed and get error code 6725 (...
1
vote
1
answer
108
views
What is the correct usage of InterlockedCompareExchange for optimistic synchronization to avoid the new C28112 warning in MSVC?
I've written optimistic thread-synchronization routines lots of times before, but today, the pattern that I've used for years now generates a warning in recent versions of VC++ (using VS 2022, v17.9.5)...
0
votes
1
answer
85
views
Win32 API (C): Window permanently disappearing at runtime after changing focus?
I am creating a windowed application, and I am currently working on a Windows platform layer in C. I want the application update loop to be suspended when its window is not in focus, and not suspended ...
1
vote
0
answers
106
views
Where to find WINAPI for Windows health indices?
Due to some weird WiFi problems, I've developed a background app to keep WiFi busy and report disturbances in the EventLog.
//**** Ping router ****************
char replay[128] = { 0 };
...
0
votes
1
answer
196
views
How to get detailed Windows OS namestring, version and kernel-version via win32 API?
I am aware of versionifo and versinfoex structures, %OS% environment variable, and some other API calls via win32, for example these: https://learn.microsoft.com/en-us/windows/win32/sysinfo/system-...
0
votes
1
answer
66
views
How can i get handle information from PreOperationCallback?
I am currently curious about anti-cheat development and am currenley experimenting and writing a kernel driver. I have found out that OB Register Callbacks can let you intercept handle creation, and ...