diff options
author | George Hazan <george.hazan@gmail.com> | 2014-11-08 21:43:09 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-11-08 21:43:09 +0000 |
commit | 20885736f969af9eb55f30c373dc465ecfb481ea (patch) | |
tree | 8abe92e3958a4948d2e5eba3fd0d33e760e3fbf4 /plugins/AVS/src/services.cpp | |
parent | 75b84796d6d14b9df136f4ea47d87aff3cfa5c90 (diff) |
- fix for the global avatar's redrawing;
- more _taccess;
- version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@10933 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AVS/src/services.cpp')
-rw-r--r-- | plugins/AVS/src/services.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 035eb83cdb..3206546bee 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -157,13 +157,10 @@ static INT_PTR avSetAvatar(MCONTACT hContact, TCHAR *tszPath) else szFinalName = tszPath;
// filename is now set, check it and perform all needed action
- HANDLE hFile = CreateFile(szFinalName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (hFile == INVALID_HANDLE_VALUE)
+ if (_taccess(szFinalName, 4) == -1)
return 0;
// file exists...
- CloseHandle(hFile);
-
TCHAR szBackupName[MAX_PATH];
PathToRelativeT(szFinalName, szBackupName, g_szDataPath);
db_set_ts(hContact, "ContactPhoto", "Backup", szBackupName);
@@ -499,16 +496,11 @@ static int SetProtoMyAvatar(char *protocol, HBITMAP hBmp, TCHAR *originalFilenam static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHookData &data, BOOL allAcceptXML, BOOL allAcceptSWF)
{
- HANDLE hFile = 0;
-
int format = ProtoGetAvatarFormat(szFinalName);
- if (format == PA_FORMAT_UNKNOWN || (hFile = CreateFile(szFinalName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE)
+ if (format == PA_FORMAT_UNKNOWN || _taccess(szFinalName, 4) == -1)
return -3;
- CloseHandle(hFile);
-
// file exists...
-
HBITMAP hBmp = NULL;
if (format == PA_FORMAT_SWF) {
|