From 366442f1250c92480c25f30eeef0b1f3337692fc Mon Sep 17 00:00:00 2001 From: hvlad Date: Mon, 25 May 2009 10:57:22 +0000 Subject: [PATCH] Use COMMONAPPDATA folder on Windows for shared memory files placement (lock table, even table, etc). --- src/jrd/blp.h | 12 ++++++------ src/jrd/gds.cpp | 13 +++++++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/jrd/blp.h b/src/jrd/blp.h index 05bd07b45d..5163751b2f 100644 --- a/src/jrd/blp.h +++ b/src/jrd/blp.h @@ -30,7 +30,7 @@ static const struct {"begin", begin}, {"declare", declare}, {"message", message}, - {"erase", byte}, + {"erase", byte_line}, {"fetch", two}, {"for", two}, {"if", three}, @@ -43,11 +43,11 @@ static const struct {"store", two}, {NULL, NULL}, {"label", byte_verb}, - {"leave", byte}, + {"leave", byte_line}, {"store2", three}, {"post", one}, // 20 {"literal", literal}, - {"dbkey", byte}, + {"dbkey", byte_line}, {"field", field}, {"fid", parm}, {"parameter", parm}, @@ -179,7 +179,7 @@ static const struct {"ansi_any", one}, {"exists", one}, {NULL, NULL}, - {"record_version", byte}, + {"record_version", byte_line}, {"stall", zero}, {NULL, NULL}, {NULL, NULL}, @@ -194,8 +194,8 @@ static const struct {"user_savepoint", user_savepoint}, {"dcl_cursor", dcl_cursor}, {"cursor_stmt", cursor_stmt}, - {"current_timestamp2", byte}, - {"current_time2", byte}, + {"current_timestamp2", byte_line}, + {"current_time2", byte_line}, {"agg_list", two}, // 170 {"agg_list_distinct", two}, /*** diff --git a/src/jrd/gds.cpp b/src/jrd/gds.cpp index 3abc7c1028..f1a59abc51 100644 --- a/src/jrd/gds.cpp +++ b/src/jrd/gds.cpp @@ -121,6 +121,7 @@ static const char* FB_PID_FILE = "fb_%d"; #include "../jrd/os/isc_i_proto.h" #ifdef WIN_NT +#include #define _WINSOCKAPI_ #include #include "err_proto.h" @@ -285,7 +286,7 @@ static const UCHAR two[] = { op_line, op_verb, op_verb, 0}, three[] = { op_line, op_verb, op_verb, op_verb, 0}, field[] = { op_byte, op_byte, op_literal, op_pad, op_line, 0}, - byte[] = { op_byte, op_line, 0}, + byte_line[] = { op_byte, op_line, 0}, byte_args[] = { op_byte, op_line, op_args, 0}, byte_verb[] = { op_byte, op_line, op_verb, 0}, byte_verb_verb[] = { op_byte, op_line, op_verb, op_verb, 0}, @@ -3685,7 +3686,15 @@ public: Firebird::PathName lockPrefix; if (!fb_utils::readenv(FB_LOCK_ENV, lockPrefix)) { - PathUtils::concatPath(lockPrefix, fbTempDir, LOCKDIR); +#ifdef WIN_NT + char cmnData[MAXPATHLEN]; + if (!SHGetSpecialFolderPath(NULL, cmnData, CSIDL_COMMON_APPDATA, TRUE)) { + Firebird::system_call_failed::raise("SHGetSpecialFolderPath"); + } + PathUtils::concatPath(lockPrefix, cmnData, LOCKDIR); +#else + PathUtils::concatPath(lockPrefix, WORKFILE, LOCKDIR); +#endif } lockPrefix.copyTo(fb_prefix_lock_val, sizeof(fb_prefix_lock_val)); fb_prefix_lock = fb_prefix_lock_val;