GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix C4055 on MSVC. · coderup2u/MemoryModule@cc56221

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • MemoryModule.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎MemoryModule.c‎

Copy file name to clipboardExpand all lines: MemoryModule.c
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data, size_t size,
610610
// get entry point of loaded library
611611
if (result->headers->OptionalHeader.AddressOfEntryPoint != 0) {
612612
if (result->isDLL) {
613-
DllEntryProc DllEntry = (DllEntryProc) (code + result->headers->OptionalHeader.AddressOfEntryPoint);
613+
DllEntryProc DllEntry = (DllEntryProc)(LPVOID)(code + result->headers->OptionalHeader.AddressOfEntryPoint);
614614
// notify library about attaching to process
615615
BOOL successfull = (*DllEntry)((HINSTANCE)code, DLL_PROCESS_ATTACH, 0);
616616
if (!successfull) {
@@ -619,7 +619,7 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data, size_t size,
619619
}
620620
result->initialized = TRUE;
621621
} else {
622-
result->exeEntry = (ExeEntryProc) (code + result->headers->OptionalHeader.AddressOfEntryPoint);
622+
result->exeEntry = (ExeEntryProc)(LPVOID)(code + result->headers->OptionalHeader.AddressOfEntryPoint);
623623
}
624624
} else {
625625
result->exeEntry = NULL;
@@ -688,7 +688,7 @@ FARPROC MemoryGetProcAddress(HMEMORYMODULE module, LPCSTR name)
688688
}
689689

690690
// AddressOfFunctions contains the RVAs to the "real" functions
691-
return (FARPROC) (codeBase + (*(DWORD *) (codeBase + exports->AddressOfFunctions + (idx*4))));
691+
return (FARPROC)(LPVOID)(codeBase + (*(DWORD *) (codeBase + exports->AddressOfFunctions + (idx*4))));
692692
}
693693

694694
void MemoryFreeLibrary(HMEMORYMODULE mod)
@@ -700,7 +700,7 @@ void MemoryFreeLibrary(HMEMORYMODULE mod)
700700
}
701701
if (module->initialized) {
702702
// notify library about detaching from process
703-
DllEntryProc DllEntry = (DllEntryProc) (module->codeBase + module->headers->OptionalHeader.AddressOfEntryPoint);
703+
DllEntryProc DllEntry = (DllEntryProc)(LPVOID)(module->codeBase + module->headers->OptionalHeader.AddressOfEntryPoint);
704704
(*DllEntry)((HINSTANCE)module->codeBase, DLL_PROCESS_DETACH, 0);
705705
}
706706

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.