e1 and e are always zero
|
DWORD e1 = GetLastError();
DWORD e;
if(!Result.IsValid)
{
Result.UpdateAndRender = 0;
Result.GetSoundSamples = 0;
e = GetLastError();
}
|
LoadLibraryA() is inside the "if" that fails when checking for lock file.
UPDATE: SOLUTION?
Well, it´s all a mather of time. When I put a breakpoint right at GetFileAttributesEx(...) it works fine every time.
But if the code is running without a BP ... it crashes.
1
2
3
4
5
6
7
8
9
10
11
12 | if exist lock.tmp (
echo file exists
) else (
echo file doesn't exist
)
del lock.tmp
ping 127.0.0.1 -n 5 > nul
if exist lock.tmp (
echo FILE EXISTS
) else (
echo FILE DOSEN'T EXISTS
)
|
I tried to put some delays in the build file, but for no avail. The prompt shows the file does not exists correctly, but the code then belives it exists.
UPDATE 2: SOLUTION!!
Inside the main loop the first time after a Live compile it shows that the lock file exists
1
2
3
4
5
6
7
8
9
10
11
12 | while (GlobalRunning)
{
FILETIME LockFileTime = Win32GetLastWriteTime(GameCodeLockFullPath);
if (CompareFileTime(&OldLockFileTime , &LockFileTime)){
OutputDebugStringA("LOCK FILE TIME IS NOT THE SAME\n");
Sleep(1000);
}
.
.
.
}
|
So, finaly, add a 1 sec sleep when I the lock file still exists fix the problem. I also PDBs files are working fine with break points after reload.
Well ,only 259 days to catch you guys. Thank you.