I am trying to initialize COM security using the standard method:
hres = CoInitializeSecurity( NULL, -1, // COM authentication NULL, // Authentication services NULL, // Reserved RPC_C_AUTHN_LEVEL_DEFAULT, // Default authentication RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation NULL, // Authentication info EOAC_NONE, // Additional capabilities NULL // Reserved ); if (FAILED(hres)) { MessageBoxA(0, "Failed Initialize S", "s2", MB_OK); CoUninitialize(); //return 1; // Program has failed. } The code is executed in the DLL module and returns an error. But when I run it separately from the module in my .exe application, this problem does not arise.
I do not understand how to properly do this inside the library. Do I need to connect via DllMain or something else?
ΠΠ΄Π½Π°ΠΊΠΎ Π½ΠΈΠΊΠ°ΠΊΠΈΡ ΠΏΡΠΎΠ±Π»Π΅ΠΌ ΠΏΡΠΈ ΠΎΠ±ΡΠ°ΡΠ΅Π½ΠΈΠΈ ΠΊ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ΅ ΠΈΠ· EXE-ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ Π½Π΅ Π²ΠΎΠ·Π½ΠΈΠΊΠ°Π΅Ρβ this means that the level of security created by COM by default is enough to access the objects implemented by the library. - ίίί€ί