Last active
March 31, 2024 13:37
-
-
Save ismailkocacan/830c459b5e7b5b392b43f89c68fee017 to your computer and use it in GitHub Desktop.
LIST_ENTRY - CONTAINING_RECORD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <Windows.h> | |
typedef struct tagPERSON { | |
char name[255]; | |
PLIST_ENTRY link; | |
} PERSON, * PPERSON; | |
int main() | |
{ | |
PPERSON person = new PERSON(); | |
strcpy_s(person->name, "test"); | |
PPERSON record = CONTAINING_RECORD(&person->link, PERSON, link); | |
std::cout << record->name << "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment