亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? os_win.c

?? 新版輕量級嵌入式數據庫
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*** 2004 May 22**** The author disclaims copyright to this source code.  In place of** a legal notice, here is a blessing:****    May you do good and not evil.**    May you find forgiveness for yourself and forgive others.**    May you share freely, never taking more than you give.************************************************************************************ This file contains code that is specific to windows.*/#include "sqliteInt.h"#include "os.h"#if OS_WIN               /* This file is used for windows only */#include <winbase.h>#ifdef __CYGWIN__# include <sys/cygwin.h>#endif/*** Macros used to determine whether or not to use threads.*/#if defined(THREADSAFE) && THREADSAFE# define SQLITE_W32_THREADS 1#endif/*** Include code that is common to all os_*.c files*/#include "os_common.h"/*** Determine if we are dealing with WindowsCE - which has a much** reduced API.*/#if defined(_WIN32_WCE)# define OS_WINCE 1#else# define OS_WINCE 0#endif/*** WinCE lacks native support for file locking so we have to fake it** with some code of our own.*/#if OS_WINCEtypedef struct winceLock {  int nReaders;       /* Number of reader locks obtained */  BOOL bPending;      /* Indicates a pending lock has been obtained */  BOOL bReserved;     /* Indicates a reserved lock has been obtained */  BOOL bExclusive;    /* Indicates an exclusive lock has been obtained */} winceLock;#endif/*** The winFile structure is a subclass of OsFile specific to the win32** portability layer.*/typedef struct winFile winFile;struct winFile {  IoMethod const *pMethod;/* Must be first */  HANDLE h;               /* Handle for accessing the file */  unsigned char locktype; /* Type of lock currently held on this file */  short sharedLockByte;   /* Randomly chosen byte used as a shared lock */#if OS_WINCE  WCHAR *zDeleteOnClose;  /* Name of file to delete when closing */  HANDLE hMutex;          /* Mutex used to control access to shared lock */    HANDLE hShared;         /* Shared memory segment used for locking */  winceLock local;        /* Locks obtained by this instance of winFile */  winceLock *shared;      /* Global shared lock memory for the file  */#endif};/*** Do not include any of the File I/O interface procedures if the** SQLITE_OMIT_DISKIO macro is defined (indicating that there database** will be in-memory only)*/#ifndef SQLITE_OMIT_DISKIO/*** The following variable is (normally) set once and never changes** thereafter.  It records whether the operating system is Win95** or WinNT.**** 0:   Operating system unknown.** 1:   Operating system is Win95.** 2:   Operating system is WinNT.**** In order to facilitate testing on a WinNT system, the test fixture** can manually set this value to 1 to emulate Win98 behavior.*/int sqlite3_os_type = 0;/*** Return true (non-zero) if we are running under WinNT, Win2K, WinXP,** or WinCE.  Return false (zero) for Win95, Win98, or WinME.**** Here is an interesting observation:  Win95, Win98, and WinME lack** the LockFileEx() API.  But we can still statically link against that** API as long as we don't call it win running Win95/98/ME.  A call to** this routine is used to determine if the host is Win95/98/ME or** WinNT/2K/XP so that we will know whether or not we can safely call** the LockFileEx() API.*/#if OS_WINCE# define isNT()  (1)#else  static int isNT(void){    if( sqlite3_os_type==0 ){      OSVERSIONINFO sInfo;      sInfo.dwOSVersionInfoSize = sizeof(sInfo);      GetVersionEx(&sInfo);      sqlite3_os_type = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT ? 2 : 1;    }    return sqlite3_os_type==2;  }#endif /* OS_WINCE *//*** Convert a UTF-8 string to UTF-32.  Space to hold the returned string** is obtained from sqliteMalloc.*/static WCHAR *utf8ToUnicode(const char *zFilename){  int nChar;  WCHAR *zWideFilename;  if( !isNT() ){    return 0;  }  nChar = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0);  zWideFilename = sqliteMalloc( nChar*sizeof(zWideFilename[0]) );  if( zWideFilename==0 ){    return 0;  }  nChar = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, zWideFilename, nChar);  if( nChar==0 ){    sqliteFree(zWideFilename);    zWideFilename = 0;  }  return zWideFilename;}/*** Convert UTF-32 to UTF-8.  Space to hold the returned string is** obtained from sqliteMalloc().*/static char *unicodeToUtf8(const WCHAR *zWideFilename){  int nByte;  char *zFilename;  nByte = WideCharToMultiByte(CP_UTF8, 0, zWideFilename, -1, 0, 0, 0, 0);  zFilename = sqliteMalloc( nByte );  if( zFilename==0 ){    return 0;  }  nByte = WideCharToMultiByte(CP_UTF8, 0, zWideFilename, -1, zFilename, nByte,                              0, 0);  if( nByte == 0 ){    sqliteFree(zFilename);    zFilename = 0;  }  return zFilename;}#if OS_WINCE/*************************************************************************** This section contains code for WinCE only.*//*** WindowsCE does not have a localtime() function.  So create a** substitute.*/#include <time.h>struct tm *__cdecl localtime(const time_t *t){  static struct tm y;  FILETIME uTm, lTm;  SYSTEMTIME pTm;  i64 t64;  t64 = *t;  t64 = (t64 + 11644473600)*10000000;  uTm.dwLowDateTime = t64 & 0xFFFFFFFF;  uTm.dwHighDateTime= t64 >> 32;  FileTimeToLocalFileTime(&uTm,&lTm);  FileTimeToSystemTime(&lTm,&pTm);  y.tm_year = pTm.wYear - 1900;  y.tm_mon = pTm.wMonth - 1;  y.tm_wday = pTm.wDayOfWeek;  y.tm_mday = pTm.wDay;  y.tm_hour = pTm.wHour;  y.tm_min = pTm.wMinute;  y.tm_sec = pTm.wSecond;  return &y;}/* This will never be called, but defined to make the code compile */#define GetTempPathA(a,b)#define LockFile(a,b,c,d,e)       winceLockFile(&a, b, c, d, e)#define UnlockFile(a,b,c,d,e)     winceUnlockFile(&a, b, c, d, e)#define LockFileEx(a,b,c,d,e,f)   winceLockFileEx(&a, b, c, d, e, f)#define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-offsetof(winFile,h)]/*** Acquire a lock on the handle h*/static void winceMutexAcquire(HANDLE h){   DWORD dwErr;   do {     dwErr = WaitForSingleObject(h, INFINITE);   } while (dwErr != WAIT_OBJECT_0 && dwErr != WAIT_ABANDONED);}/*** Release a lock acquired by winceMutexAcquire()*/#define winceMutexRelease(h) ReleaseMutex(h)/*** Create the mutex and shared memory used for locking in the file** descriptor pFile*/static BOOL winceCreateLock(const char *zFilename, winFile *pFile){  WCHAR *zTok;  WCHAR *zName = utf8ToUnicode(zFilename);  BOOL bInit = TRUE;  /* Initialize the local lockdata */  ZeroMemory(&pFile->local, sizeof(pFile->local));  /* Replace the backslashes from the filename and lowercase it  ** to derive a mutex name. */  zTok = CharLowerW(zName);  for (;*zTok;zTok++){    if (*zTok == '\\') *zTok = '_';  }  /* Create/open the named mutex */  pFile->hMutex = CreateMutexW(NULL, FALSE, zName);  if (!pFile->hMutex){    sqliteFree(zName);    return FALSE;  }  /* Acquire the mutex before continuing */  winceMutexAcquire(pFile->hMutex);    /* Since the names of named mutexes, semaphores, file mappings etc are   ** case-sensitive, take advantage of that by uppercasing the mutex name  ** and using that as the shared filemapping name.  */  CharUpperW(zName);  pFile->hShared = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL,                                       PAGE_READWRITE, 0, sizeof(winceLock),                                       zName);    /* Set a flag that indicates we're the first to create the memory so it   ** must be zero-initialized */  if (GetLastError() == ERROR_ALREADY_EXISTS){    bInit = FALSE;  }  sqliteFree(zName);  /* If we succeeded in making the shared memory handle, map it. */  if (pFile->hShared){    pFile->shared = (winceLock*)MapViewOfFile(pFile->hShared,              FILE_MAP_READ|FILE_MAP_WRITE, 0, 0, sizeof(winceLock));    /* If mapping failed, close the shared memory handle and erase it */    if (!pFile->shared){      CloseHandle(pFile->hShared);      pFile->hShared = NULL;    }  }  /* If shared memory could not be created, then close the mutex and fail */  if (pFile->hShared == NULL){    winceMutexRelease(pFile->hMutex);    CloseHandle(pFile->hMutex);    pFile->hMutex = NULL;    return FALSE;  }    /* Initialize the shared memory if we're supposed to */  if (bInit) {    ZeroMemory(pFile->shared, sizeof(winceLock));  }  winceMutexRelease(pFile->hMutex);  return TRUE;}/*** Destroy the part of winFile that deals with wince locks*/static void winceDestroyLock(winFile *pFile){  if (pFile->hMutex){    /* Acquire the mutex */    winceMutexAcquire(pFile->hMutex);    /* The following blocks should probably assert in debug mode, but they       are to cleanup in case any locks remained open */    if (pFile->local.nReaders){      pFile->shared->nReaders --;    }    if (pFile->local.bReserved){      pFile->shared->bReserved = FALSE;    }    if (pFile->local.bPending){      pFile->shared->bPending = FALSE;    }    if (pFile->local.bExclusive){      pFile->shared->bExclusive = FALSE;    }    /* De-reference and close our copy of the shared memory handle */    UnmapViewOfFile(pFile->shared);    CloseHandle(pFile->hShared);    /* Done with the mutex */    winceMutexRelease(pFile->hMutex);        CloseHandle(pFile->hMutex);    pFile->hMutex = NULL;  }}/* ** An implementation of the LockFile() API of windows for wince*/static BOOL winceLockFile(  HANDLE *phFile,  DWORD dwFileOffsetLow,  DWORD dwFileOffsetHigh,  DWORD nNumberOfBytesToLockLow,  DWORD nNumberOfBytesToLockHigh){  winFile *pFile = HANDLE_TO_WINFILE(phFile);  BOOL bReturn = FALSE;  if (!pFile->hMutex) return TRUE;  winceMutexAcquire(pFile->hMutex);  /* Wanting an exclusive lock? */  if (dwFileOffsetLow == SHARED_FIRST       && nNumberOfBytesToLockLow == SHARED_SIZE){    if (pFile->shared->nReaders == 0 && pFile->shared->bExclusive == 0){       pFile->shared->bExclusive = TRUE;       pFile->local.bExclusive = TRUE;       bReturn = TRUE;    }  }  /* Want a read-only lock? */  else if ((dwFileOffsetLow >= SHARED_FIRST &&            dwFileOffsetLow < SHARED_FIRST + SHARED_SIZE) &&            nNumberOfBytesToLockLow == 1){    if (pFile->shared->bExclusive == 0){      pFile->local.nReaders ++;      if (pFile->local.nReaders == 1){        pFile->shared->nReaders ++;      }      bReturn = TRUE;    }  }  /* Want a pending lock? */  else if (dwFileOffsetLow == PENDING_BYTE && nNumberOfBytesToLockLow == 1){    /* If no pending lock has been acquired, then acquire it */    if (pFile->shared->bPending == 0) {      pFile->shared->bPending = TRUE;      pFile->local.bPending = TRUE;      bReturn = TRUE;    }  }  /* Want a reserved lock? */  else if (dwFileOffsetLow == RESERVED_BYTE && nNumberOfBytesToLockLow == 1){    if (pFile->shared->bReserved == 0) {      pFile->shared->bReserved = TRUE;      pFile->local.bReserved = TRUE;      bReturn = TRUE;    }  }  winceMutexRelease(pFile->hMutex);  return bReturn;}/*** An implementation of the UnlockFile API of windows for wince*/static BOOL winceUnlockFile(  HANDLE *phFile,  DWORD dwFileOffsetLow,  DWORD dwFileOffsetHigh,  DWORD nNumberOfBytesToUnlockLow,  DWORD nNumberOfBytesToUnlockHigh){  winFile *pFile = HANDLE_TO_WINFILE(phFile);  BOOL bReturn = FALSE;  if (!pFile->hMutex) return TRUE;  winceMutexAcquire(pFile->hMutex);  /* Releasing a reader lock or an exclusive lock */  if (dwFileOffsetLow >= SHARED_FIRST &&       dwFileOffsetLow < SHARED_FIRST + SHARED_SIZE){    /* Did we have an exclusive lock? */    if (pFile->local.bExclusive){      pFile->local.bExclusive = FALSE;      pFile->shared->bExclusive = FALSE;      bReturn = TRUE;    }    /* Did we just have a reader lock? */    else if (pFile->local.nReaders){      pFile->local.nReaders --;      if (pFile->local.nReaders == 0)      {        pFile->shared->nReaders --;      }      bReturn = TRUE;    }  }  /* Releasing a pending lock */  else if (dwFileOffsetLow == PENDING_BYTE && nNumberOfBytesToUnlockLow == 1){    if (pFile->local.bPending){      pFile->local.bPending = FALSE;      pFile->shared->bPending = FALSE;      bReturn = TRUE;    }  }  /* Releasing a reserved lock */  else if (dwFileOffsetLow == RESERVED_BYTE && nNumberOfBytesToUnlockLow == 1){    if (pFile->local.bReserved) {      pFile->local.bReserved = FALSE;      pFile->shared->bReserved = FALSE;      bReturn = TRUE;    }  }  winceMutexRelease(pFile->hMutex);  return bReturn;}/*** An implementation of the LockFileEx() API of windows for wince*/static BOOL winceLockFileEx(  HANDLE *phFile,  DWORD dwFlags,  DWORD dwReserved,  DWORD nNumberOfBytesToLockLow,  DWORD nNumberOfBytesToLockHigh,  LPOVERLAPPED lpOverlapped){  /* If the caller wants a shared read lock, forward this call  ** to winceLockFile */  if (lpOverlapped->Offset == SHARED_FIRST &&      dwFlags == 1 &&      nNumberOfBytesToLockLow == SHARED_SIZE){    return winceLockFile(phFile, SHARED_FIRST, 0, 1, 0);  }  return FALSE;}/*** End of the special code for wince*****************************************************************************/#endif /* OS_WINCE *//*** Delete the named file*/int sqlite3WinDelete(const char *zFilename){  WCHAR *zWide = utf8ToUnicode(zFilename);  if( zWide ){    DeleteFileW(zWide);    sqliteFree(zWide);  }else{#if OS_WINCE    return SQLITE_NOMEM;#else    DeleteFileA(zFilename);#endif  }  TRACE2("DELETE \"%s\"\n", zFilename);  return SQLITE_OK;}/*** Return TRUE if the named file exists.*/int sqlite3WinFileExists(const char *zFilename){  int exists = 0;  WCHAR *zWide = utf8ToUnicode(zFilename);  if( zWide ){    exists = GetFileAttributesW(zWide) != 0xffffffff;    sqliteFree(zWide);  }else{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费视频播放| 国产一区二区三区香蕉| 在线看日韩精品电影| 亚洲一区二三区| 欧美日韩国产综合视频在线观看| 亚洲一区二区三区视频在线| 欧美三级午夜理伦三级中视频| 亚洲成人av一区二区| 91精品国产入口在线| 国产在线播放一区三区四| 国产欧美日韩中文久久| 99久久精品国产观看| 亚洲444eee在线观看| 日韩精品一区二区三区视频| 国产精品一品视频| 亚洲免费在线视频| 欧美日韩精品一区二区三区四区| 日韩激情av在线| 欧美国产一区在线| 色94色欧美sute亚洲线路二| 日韩高清在线一区| 国产欧美精品一区二区色综合朱莉| 成人午夜电影网站| 亚洲激情网站免费观看| 日韩精品一区二区在线| 99在线精品视频| 天堂在线一区二区| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 秋霞午夜av一区二区三区| 精品久久久久久无| 一本一道波多野结衣一区二区| 五月激情六月综合| 国产欧美日韩三级| 欧美日韩亚洲不卡| 风间由美一区二区av101 | 天天影视涩香欲综合网| 久久久久久久久久电影| 欧美视频在线一区二区三区| 韩国欧美国产1区| 一区二区三区国产精华| 欧美精品一区二区久久婷婷| 欧美专区亚洲专区| 国产成人鲁色资源国产91色综| 亚洲精品免费一二三区| 久久久久久**毛片大全| 欧美日韩成人综合| bt7086福利一区国产| 久久99精品一区二区三区| 亚洲精品第一国产综合野| 久久久久久久久久久久久久久99| 欧洲一区在线电影| av一区二区三区在线| 国产乱人伦偷精品视频不卡| 日韩在线一二三区| 亚洲精品国产成人久久av盗摄 | 欧美一区二区私人影院日本| 91在线国产福利| 国产成人超碰人人澡人人澡| 免费av网站大全久久| 亚洲午夜av在线| 亚洲乱码日产精品bd| 国产精品福利一区二区三区| 久久精品一级爱片| 2020日本不卡一区二区视频| 欧美精品 国产精品| 欧美日韩一区二区在线视频| 91亚洲精品乱码久久久久久蜜桃| 国产经典欧美精品| 国产精一区二区三区| 国产麻豆成人精品| 国产综合色在线视频区| 精品亚洲porn| 韩国午夜理伦三级不卡影院| 国产综合久久久久久鬼色| 美女网站在线免费欧美精品| 日本女人一区二区三区| 视频一区欧美精品| 日本特黄久久久高潮| 午夜精品一区二区三区电影天堂 | 国产精品久久精品日日| 国产蜜臀av在线一区二区三区| www日韩大片| 久久综合久久久久88| 精品欧美一区二区在线观看| 欧美电影免费提供在线观看| 欧美一区二区三区播放老司机| 欧美一级在线视频| 精品福利在线导航| 久久精品一区二区三区不卡牛牛| 国产清纯在线一区二区www| 国产欧美一区二区精品性色| 国产精品国产精品国产专区不片| 亚洲欧美日韩国产综合| 亚洲一区二区欧美激情| 日韩国产欧美在线观看| 久久 天天综合| 国产成人免费视频网站| 97超碰欧美中文字幕| 欧美在线制服丝袜| 制服视频三区第一页精品| 欧美tickle裸体挠脚心vk| 久久久www成人免费毛片麻豆 | 国产麻豆欧美日韩一区| 不卡的av中国片| 欧美日韩一区在线| 欧美精品一区二区三区一线天视频 | 亚洲第一在线综合网站| 蜜臀av一区二区| 成人一区二区在线观看| 色婷婷国产精品久久包臀 | 欧美精品一区男女天堂| 国产精品黄色在线观看| 亚洲综合免费观看高清完整版 | 蜜桃91丨九色丨蝌蚪91桃色| 国产精品中文有码| 一本色道a无线码一区v| 欧美一区二区精品久久911| 中文一区一区三区高中清不卡| 亚洲在线中文字幕| 国产乱理伦片在线观看夜一区| 99精品在线免费| 日韩欧美卡一卡二| 亚洲欧美日韩人成在线播放| 久久99精品久久久久婷婷| 色综合久久综合网97色综合| 欧美一区二区三区免费| 中文字幕在线一区二区三区| 日本一区中文字幕| 99精品1区2区| 久久综合九色综合97婷婷| 夜夜精品视频一区二区| 国产酒店精品激情| 91麻豆精品国产91久久久久 | 日韩成人一级大片| 91在线无精精品入口| 欧美精品一区二区三区四区| 亚洲成人av中文| 97久久精品人人爽人人爽蜜臀| 欧美变态tickling挠脚心| 亚洲一区二区高清| 暴力调教一区二区三区| 精品国产电影一区二区| 性做久久久久久久免费看| 99国产精品一区| 国产婷婷色一区二区三区四区| 午夜视频一区在线观看| www.av精品| 欧美激情一区在线| 久久99精品网久久| 91精品国产手机| 亚洲福利视频三区| 在线一区二区视频| 亚洲人成网站在线| av一本久道久久综合久久鬼色| 久久品道一品道久久精品| 蜜桃免费网站一区二区三区 | 欧美大片顶级少妇| 日韩电影在线免费观看| 欧美午夜理伦三级在线观看| 亚洲免费av高清| 色综合天天综合给合国产| 亚洲欧美自拍偷拍色图| 成人亚洲一区二区一| 国产精品女人毛片| 高清国产一区二区| 国产亚洲欧美一级| 国产精品99久久久久久似苏梦涵 | 一区二区三区在线观看动漫| 99久久久久久| 亚洲精品免费播放| 欧美视频在线一区| 香蕉av福利精品导航 | 久久青草国产手机看片福利盒子| 琪琪久久久久日韩精品| 日韩欧美精品在线| 黄色日韩网站视频| 久久久精品tv| 成人精品gif动图一区| 中文字幕亚洲在| 在线观看三级视频欧美| 日韩国产成人精品| www久久久久| 99久久久精品| 亚洲成人在线观看视频| 日韩午夜电影在线观看| 国产一区二区三区最好精华液| 久久久久国产免费免费| 97久久超碰国产精品电影| 亚洲成av人片在线观看无码| 91精品国产综合久久久蜜臀图片| 麻豆国产91在线播放| 国产性色一区二区| av在线不卡电影| 日韩中文字幕区一区有砖一区| 欧美大片在线观看一区二区| 国产69精品久久777的优势| 亚洲日韩欧美一区二区在线| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 性做久久久久久免费观看 | 91视频免费看|