8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 08:03:03 +01:00

Use COMMONAPPDATA folder on Windows for shared memory files placement (lock table, even table, etc).

This commit is contained in:
hvlad 2009-05-25 10:57:22 +00:00
parent 04b4c28ce2
commit 366442f125
2 changed files with 17 additions and 8 deletions

View File

@ -30,7 +30,7 @@ static const struct
{"begin", begin}, {"begin", begin},
{"declare", declare}, {"declare", declare},
{"message", message}, {"message", message},
{"erase", byte}, {"erase", byte_line},
{"fetch", two}, {"fetch", two},
{"for", two}, {"for", two},
{"if", three}, {"if", three},
@ -43,11 +43,11 @@ static const struct
{"store", two}, {"store", two},
{NULL, NULL}, {NULL, NULL},
{"label", byte_verb}, {"label", byte_verb},
{"leave", byte}, {"leave", byte_line},
{"store2", three}, {"store2", three},
{"post", one}, // 20 {"post", one}, // 20
{"literal", literal}, {"literal", literal},
{"dbkey", byte}, {"dbkey", byte_line},
{"field", field}, {"field", field},
{"fid", parm}, {"fid", parm},
{"parameter", parm}, {"parameter", parm},
@ -179,7 +179,7 @@ static const struct
{"ansi_any", one}, {"ansi_any", one},
{"exists", one}, {"exists", one},
{NULL, NULL}, {NULL, NULL},
{"record_version", byte}, {"record_version", byte_line},
{"stall", zero}, {"stall", zero},
{NULL, NULL}, {NULL, NULL},
{NULL, NULL}, {NULL, NULL},
@ -194,8 +194,8 @@ static const struct
{"user_savepoint", user_savepoint}, {"user_savepoint", user_savepoint},
{"dcl_cursor", dcl_cursor}, {"dcl_cursor", dcl_cursor},
{"cursor_stmt", cursor_stmt}, {"cursor_stmt", cursor_stmt},
{"current_timestamp2", byte}, {"current_timestamp2", byte_line},
{"current_time2", byte}, {"current_time2", byte_line},
{"agg_list", two}, // 170 {"agg_list", two}, // 170
{"agg_list_distinct", two}, {"agg_list_distinct", two},
/*** /***

View File

@ -121,6 +121,7 @@ static const char* FB_PID_FILE = "fb_%d";
#include "../jrd/os/isc_i_proto.h" #include "../jrd/os/isc_i_proto.h"
#ifdef WIN_NT #ifdef WIN_NT
#include <shlobj.h>
#define _WINSOCKAPI_ #define _WINSOCKAPI_
#include <share.h> #include <share.h>
#include "err_proto.h" #include "err_proto.h"
@ -285,7 +286,7 @@ static const UCHAR
two[] = { op_line, op_verb, op_verb, 0}, two[] = { op_line, op_verb, op_verb, 0},
three[] = { op_line, op_verb, 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}, 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_args[] = { op_byte, op_line, op_args, 0},
byte_verb[] = { op_byte, op_line, op_verb, 0}, byte_verb[] = { op_byte, op_line, op_verb, 0},
byte_verb_verb[] = { op_byte, op_line, op_verb, op_verb, 0}, byte_verb_verb[] = { op_byte, op_line, op_verb, op_verb, 0},
@ -3685,7 +3686,15 @@ public:
Firebird::PathName lockPrefix; Firebird::PathName lockPrefix;
if (!fb_utils::readenv(FB_LOCK_ENV, 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)); lockPrefix.copyTo(fb_prefix_lock_val, sizeof(fb_prefix_lock_val));
fb_prefix_lock = fb_prefix_lock_val; fb_prefix_lock = fb_prefix_lock_val;