GetMangledSiteSid Entry Point error

When building an exe using Windows in MinGW g++, I get an error when I run it:

The procedure entry point GetMangledSiteSid could not be located in the dynamic library

My linker flags are this:
lws2_32 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -lshlwapi
Last edited on
Do you really get the error while building, or when you try to run the program?

This sounds like an error you would get at runtime!

Anyway, I can not find any information/docs about the GetMangledSiteSid() function. What exactly do you use this function for?

BTW: Which "MinGW" do you use? Do you use latest Mingw-w64, or the long abandoned original
Last edited on
AFAIK GetMangledSiteSid() is not an exported function (although 'defined' in advapi32.dll) and neither is it MS documented. How are you calling this function?
My advapi32.dll, on Windows 10 22H2, does not export this function. Just checked that.

Might be one of those cases where the actual DLL entry point is called, e.g., "SystemFunctionXYZ" and you have to use LoadLibrary() + GetProcAddress() trickery to call it. But then you wouldn't get a "The procedure entry point could not be located" error at startup!

RtlGenRandom example:
HMODULE advapi = LoadLibraryW(L"advapi32.dll");
if (advapi != NULL)
  BOOLEAN (APIENTRY *RtlGenRandom)(void *, ULONG) =
        (BOOLEAN (APIENTRY*)(void*, ULONG))GetProcAddress(advapi, "SystemFunction036");
  if (RtlGenRandom != NULL)
    if (RtlGenRandom(&seed, sizeof(seed)))
      return seed;

However, a full-text search for "GetMangledSiteSid" on latest MSYS2/MinGW does not find anything either. So, apparently, there is no header file that declares this function. Makes it even more dubious how the OP actually calls this function...
Last edited on
It looks like that function is only available in ADVAPI32 v5.0, the version shipped with Win 2000.
It looks like that function is only available in ADVAPI32 v5.0, the version shipped with Win 2000.

This seems to confirm:

So, its an old undocumented function that has long been removed.

This explains why there is no sign of GetMangledSiteSid() in current Mingw-w64. I don't know how the OP managed to get a dependency on this function, because there seems to be no header file (or import library) that contains the function in question 🤔

Two possibilities come to my mind:
• OP is using a very old MinGW version from the early 2000's
• It's an indirect dependency that was induced by some 3rd-party DLL, one that was made to run on Windows 2000

Dependencies may help to figure out what's going on:
Last edited on
That was one of the links I read for my comment, kigar. :Þ
Topic archived. No new replies allowed.