Apparently it has to do with the Azure Web App sandbox restrictions.
LoadImageW fails with error code 0x06 (ERROR_INVALID_HANDLE) in Azure App Service
Madalin
1
Reputation point
Hello,
I've just published my ASP.NET Framework 4.6.2 Web application (x64) to Azure App Service. I also have some additional native DLLs and bitmap images, all manually copied to the "bin" root folder.
The problem is that LoadImageW returns "invalid handle" error code (dw is 0x06):
HBITMAP hBMP = (HBITMAP)LoadImageW(NULL, file, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
if (hBMP == NULL) {
DWORD dw = GetLastError();
But if I just do this, it works, "result" is 0:
FILE* pFile;
int result = _wfopen_s(&pFile, file, L"wb");
So the path is ok, the file can be accessed, it is only LoadImage which doesn't work, and it happens only in Azure, locally everything is ok.
I would very much appreciate any help, any idea.
Thank you!