Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
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); ...
George Robinson's user avatar
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() { ...
Simon Kissane's user avatar
-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 ...
Utkarsh Kumar's user avatar
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 ...
Badasahog's user avatar
  • 659
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 ...
Raildex's user avatar
  • 4,468
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 ...
0___________'s user avatar
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 ...
Steve Valliere's user avatar
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 ...
WhyNot's user avatar
  • 69
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, ...
0___________'s user avatar
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 (...
Pink's user avatar
  • 11
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)...
Sean Werkema's user avatar
  • 6,006
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 ...
Oh Fiveight's user avatar
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 }; ...
Kalle Svensson's user avatar
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-...
myname's user avatar
  • 131
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 ...
Yellow's user avatar
  • 13

15 30 50 per page
1
2 3 4 5
358