summaryrefslogtreecommitdiffstats
path: root/win/tclWinTest.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinTest.c')
-rw-r--r--win/tclWinTest.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/win/tclWinTest.c b/win/tclWinTest.c
index 186d308..0ddd76b 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -538,7 +538,7 @@ TestplatformChmod(CONST char *nativePath, int pmode)
| FILE_ADD_SUBDIRECTORY | FILE_WRITE_EA | FILE_APPEND_DATA
| FILE_WRITE_DATA | DELETE;
- BYTE *secDesc = 0;
+ PSECURITY_DESCRIPTOR secDesc = 0;
DWORD secDescLen;
const BOOL set_readOnly = !(pmode & 0222);
@@ -670,9 +670,8 @@ TestplatformChmod(CONST char *nativePath, int pmode)
if (!getFileSecurityProc(nativePath, infoBits, NULL, 0, &secDescLen)) {
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
DWORD secDescLen2 = 0;
- secDesc = (BYTE *) ckalloc(secDescLen);
- if (!getFileSecurityProc(nativePath, infoBits,
- (PSECURITY_DESCRIPTOR)secDesc,
+ secDesc = (PSECURITY_DESCRIPTOR) ckalloc(secDescLen);
+ if (!getFileSecurityProc(nativePath, infoBits, secDesc,
secDescLen, &secDescLen2)
|| (secDescLen < secDescLen2)) {
goto done;