Hi.

I got a problem when compiling SQLte 3.7.2 for Windows CE 4.2 (Windows Mobile 
2003) - it cannot be done.

In the function winShmSystemLock(...) is called API-function UnlockFileEx(...), 
but it is implemented only in Windows CE 5.0 and later (and there in 
winShmSystemLock(...) is used constant LOCKFILE_EXCLUSIVE_LOCK - it is not 
exists in WM 2003 SDK).

I suggest solution (2 "patches" in winShmSystemLock(...)):
1.
old code:
  if( lockType == _SHM_WRLCK ) dwFlags |= LOCKFILE_EXCLUSIVE_LOCK;

new code:
#if SQLITE_OS_WINCE==1 && _WIN32_WCE!=0x420 && _WIN32_WCE!=420
  if( lockType == _SHM_WRLCK ) dwFlags |= LOCKFILE_EXCLUSIVE_LOCK;
#endif // WinCE 4.20?

2.
old code:
  if( lockType==_SHM_UNLCK ){
    rc = UnlockFileEx(pFile->hFile.h, 0, nByte, 0, &ovlp);
  }else{

new code:
  if( lockType==_SHM_UNLCK ){
#if SQLITE_OS_WINCE==1 && _WIN32_WCE!=0x420 && _WIN32_WCE!=420
    rc = UnlockFileEx(pFile->hFile.h, 0, nByte, 0, &ovlp);
#else // WinCE 4.20?
    rc = UnlockFile(pFile->hFile.h, ovlp.Offset, ovlp.OffsetHigh, nByte, 0);
#endif // WinCE 4.20?
  }else{

I'm not sure whether I pass "right" parameters to the UnlockFile(...), it 
should be checked

Why 2 conditions ("0x420" and "420")? In eVC 4.0 variable $(CEVER) (_WIN32_WCE 
get value from it) has "decimal form", but in VS2005 and later this variable 
has "hex. form".

---
WBR,
Aleksandr Jr.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to