diff --git a/src/cache.cpp b/src/cache.cpp index 7b92a911..6fca72c6 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -326,9 +326,16 @@ void CCacheData::PrematureDeleteByPlugin(CPluginInterfaceAbstract* ownDeletePlug CCacheDirData::CCacheDirData(const char* path) : Names(100, 50) { + Path[0] = 0; + PathLength = 0; int l = (int)strlen(path); if (l > 0 && path[l - 1] == '\\') l--; + if (l >= MAX_PATH - 1) + { + TRACE_E("CCacheDirData::CCacheDirData(): path is too long."); + return; + } memcpy(Path, path, l); if (l > 0) Path[l++] = '\\'; @@ -345,9 +352,11 @@ CCacheDirData::~CCacheDirData() delete name; } if (PathLength > 0) + { Path[PathLength - 1] = 0; // trimming a backslash - SetFileAttributesUtf8(Path, FILE_ATTRIBUTE_ARCHIVE); - RemoveDirectoryUtf8(Path); + SetFileAttributesUtf8(Path, FILE_ATTRIBUTE_ARCHIVE); + RemoveDirectoryUtf8(Path); + } } BOOL CCacheDirData::ContainTmpName(const char* tmpName, const char* rootTmpPath, @@ -356,6 +365,8 @@ BOOL CCacheDirData::ContainTmpName(const char* tmpName, const char* rootTmpPath, CALL_STACK_MESSAGE2("CCacheDirData::ContainTmpName(%s, , ,)", tmpName); *canContainThisName = FALSE; + if (PathLength <= 0) + return FALSE; if (rootTmpPathLen < PathLength && StrNICmp(Path, rootTmpPath, rootTmpPathLen) == 0) { @@ -470,6 +481,8 @@ void CCacheDirData::RemoveEmptyTmpDirsOnlyFromDisk() { CALL_STACK_MESSAGE1("CCacheDirData::RemoveEmptyTmpDirsOnlyFromDisk()"); + if (PathLength <= 0) + return; if (PathLength > 0) Path[PathLength - 1] = 0; // backslash trimming CStrP pathW(ConvertAllocUtf8ToWide(Path, -1)); @@ -486,6 +499,8 @@ BOOL CCacheDirData::GetName(CDiskCache* monitor, const char* name, BOOL* exists, BOOL canBlock, BOOL onlyAdd, int* errorCode) { CALL_STACK_MESSAGE4("CCacheDirData::GetName(, %s, , , %d, %d,)", name, canBlock, onlyAdd); + if (PathLength <= 0) + return FALSE; int i; if (errorCode != NULL) *errorCode = DCGNE_SUCCESS; @@ -508,6 +523,14 @@ CCacheDirData::GetName(const char* name, const char* tmpName, BOOL* exists, BOOL CALL_STACK_MESSAGE4("CCacheDirData::GetName(%s, %s, , %d, ,)", name, tmpName, ownDelete); if (errorCode != NULL) *errorCode = DCGNE_SUCCESS; + if (PathLength <= 0) + { + TRACE_E("CCacheDirData::GetName(): invalid tmp-directory path."); + *exists = TRUE; + if (errorCode != NULL) + *errorCode = DCGNE_TOOLONGNAME; + return NULL; + } char tmpFullName[MAX_PATH]; memcpy(tmpFullName, Path, PathLength); if (PathLength + strlen(tmpName) + 1 <= MAX_PATH) @@ -653,6 +676,8 @@ void CCacheDirData::AddVictimsToArray(TDirectArray& victArr) BOOL CCacheDirData::DetachTmpFile(const char* tmpName) { + if (PathLength <= 0) + return FALSE; if (StrNICmp(tmpName, Path, PathLength) == 0) // if there's a chance that this is our tmp-file { int i; @@ -1182,7 +1207,7 @@ CDiskCache::GetName(const char* name, const char* tmpName, BOOL* exists, BOOL on if (rootTmpPath != NULL && (SalCheckPath(TRUE, sysTmpDir, ERROR_SUCCESS, TRUE, MainWindow->HWindow) != ERROR_SUCCESS || !CheckAndCreateDirectory(rootTmpPath, NULL, TRUE)) || // if it's not TEMP, tmp-root must be verified and created, if needed - !SalGetTempFileName(rootTmpPath, "SAL", newDirPath, FALSE)) + !SalGetTempFileName(rootTmpPath, "SAL", newDirPath, _countof(newDirPath), FALSE)) { *exists = TRUE; // fatal error Leave(); diff --git a/src/consts.h b/src/consts.h index c9cdd7c1..c0cac2dd 100644 --- a/src/consts.h +++ b/src/consts.h @@ -95,8 +95,10 @@ class CEnterCriticalSection // because Windows GetTempFileName doesn't work, we wrote our own clone: // creates file/directory (based on 'file') at path 'path' (NULL -> Windows TEMP dir), -// with prefix 'prefix', returns name of created file in 'tmpName' (min. size MAX_PATH), +// with prefix 'prefix', returns name of created file in 'tmpName' (size in 'tmpNameLen'), // returns "success?" (on failure returns Windows error code via SetLastError - for compatibility) +BOOL SalGetTempFileName(const char* path, const char* prefix, char* tmpName, int tmpNameLen, BOOL file); +// legacy compatibility overload ('tmpName' must be at least MAX_PATH) BOOL SalGetTempFileName(const char* path, const char* prefix, char* tmpName, BOOL file); // because Windows MoveFile can't rename files with read-only attribute on Novell, @@ -153,6 +155,8 @@ BOOL IsNOVELLDrive(const char* path); // whether file size check is needed after copying); for optimization // purposes uses 'lastLantasticCheckRoot' (for first call "", then don't change) // and 'lastIsLantasticPath' (result for 'lastLantasticCheckRoot') +BOOL IsLantasticDrive(const char* path, char* lastLantasticCheckRoot, int lastLantasticCheckRootBufSize, BOOL& lastIsLantasticPath); +// legacy compatibility overload ('lastLantasticCheckRoot' must be at least MAX_PATH) BOOL IsLantasticDrive(const char* path, char* lastLantasticCheckRoot, BOOL& lastIsLantasticPath); // returns TRUE for network paths @@ -259,8 +263,12 @@ BOOL PathsAreOnTheSameVolume(const char* path1, const char* path2, BOOL* resIsOn BOOL IsTheSamePath(const char* path1, const char* path2); // determines if path is plugin FS type, 'path' is the path being checked, 'fsName' is -// buffer of MAX_PATH characters for FS name (or NULL), returns 'userPart' (if != NULL) - pointer -// into 'path' to first character of plugin-defined path (after first ':') +// optional output buffer for FS name (size in 'fsNameBufSize', can be NULL), +// returns 'userPart' (if != NULL) - pointer into 'path' to first character +// of plugin-defined path (after first ':') +BOOL IsPluginFSPath(const char* path, char* fsName, int fsNameBufSize, const char** userPart = NULL); +BOOL IsPluginFSPath(char* path, char* fsName, int fsNameBufSize, char** userPart = NULL); +// legacy compatibility overloads ('fsName' must be at least MAX_PATH if non-NULL) BOOL IsPluginFSPath(const char* path, char* fsName = NULL, const char** userPart = NULL); BOOL IsPluginFSPath(char* path, char* fsName = NULL, char** userPart = NULL); @@ -272,8 +280,9 @@ BOOL IsFileURLPath(const char* path); int IsFileLink(const char* fileExtension); // gets both UNC and normal root path from 'path', returns path in 'root' in format 'C:\' or '\\SERVER\SHARE\', -// returns number of characters in root path (without null-terminator); 'root' is buffer of at least MAX_PATH characters, for longer -// UNC root paths truncates to MAX_PATH-2 characters and adds backslash (either way it's not 100% a root path) +// returns number of characters in root path (without null-terminator) +int GetRootPath(char* root, int rootBufSize, const char* path); +// legacy compatibility overload ('root' must be at least MAX_PATH) int GetRootPath(char* root, const char* path); // returns pointer after root (more precisely to backslash right after root) of both UNC and normal path 'path' @@ -883,8 +892,11 @@ BOOL ResolveSubsts(char* resPath); // Performs resolve of subst and reparse point for path 'path', then attempts to get GUID path // for the mount-point of the path (if missing, for the root of the path). Returns FALSE on failure. -// On success, returns TRUE and sets 'mountPoint' and 'guidPath' (if different from NULL, must -// point to buffers of size at least MAX_PATH; strings will be terminated with backslash). +// On success, returns TRUE and sets 'mountPoint' and 'guidPath' (if non-NULL; sizes are in +// 'mountPointBufSize' and 'guidPathBufSize'; strings are terminated with backslash). +BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, int mountPointBufSize, + char* guidPath, int guidPathBufSize); +// legacy compatibility overloads ('mountPoint'/'guidPath' must be at least MAX_PATH if non-NULL) BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* guidPath); // attempt to return correct values (also handles reparse points - complete path is specified instead of root) @@ -921,6 +933,8 @@ BOOL GetReparsePointDestination(const char* repPointDir, char* repPointDstBuf, D // in 'currentReparsePoint' (at least MAX_PATH characters) returns current (last) local // reparse point, on failure returns classic root; returns FALSE on failure; if // 'error' is not NULL, TRUE is written to it on error +BOOL GetCurrentLocalReparsePoint(const char* path, char* currentReparsePoint, int currentReparsePointBufSize, BOOL* error = NULL); +// legacy compatibility overload ('currentReparsePoint' must be at least MAX_PATH) BOOL GetCurrentLocalReparsePoint(const char* path, char* currentReparsePoint, BOOL* error = NULL); // call only for paths 'path' whose root (after removing subst) is DRIVE_FIXED (elsewhere it makes no sense to search for @@ -2369,8 +2383,10 @@ void ShellActionAux6(CFilesWindow* panel); //****************************************************************************** -// returns in 'path' (buffer at least MAX_PATH characters) the path Configuration.IfPathIsInaccessibleGoTo; +// returns in 'path' the path Configuration.IfPathIsInaccessibleGoTo; // takes into account Configuration.IfPathIsInaccessibleGoToIsMyDocs setting +void GetIfPathIsInaccessibleGoTo(char* path, int pathBufSize, BOOL forceIsMyDocs); +// legacy compatibility overload ('path' must be at least 2 * MAX_PATH) void GetIfPathIsInaccessibleGoTo(char* path, BOOL forceIsMyDocs = FALSE); // loads icon overlay handler configuration from registry configuration @@ -2399,19 +2415,25 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN LPNETRESOURCE lpNetResource = NULL); // constructs text for Type column in panel for unassociated file (e.g. "AAA File" or "File") +void GetCommonFileTypeStr(char* buf, int bufSize, int* resLen, const char* ext); +// legacy compatibility overload ('buf' must be at least TRANSFER_BUFFER_MAX) void GetCommonFileTypeStr(char* buf, int* resLen, const char* ext); // finds doubled separators and removes unnecessary ones (on Vista I encountered doubled // separators in context menu on .bar files) void RemoveUselessSeparatorsFromMenu(HMENU h); -// returns "Open Salamander" directory on path CSIDL_APPDATA in 'buf' (buffer of size MAX_PATH) +// returns "Open Salamander" directory on path CSIDL_APPDATA in 'buf' +BOOL GetOurPathInRoamingAPPDATA(char* buf, int bufSize); +// legacy compatibility overload ('buf' must be at least MAX_PATH) BOOL GetOurPathInRoamingAPPDATA(char* buf); // creates "Open Salamander" directory on path CSIDL_APPDATA; returns TRUE if path // fits in MAX_PATH (its existence is not guaranteed, CreateDirectory result is not checked); -// if 'buf' is not NULL, it is buffer of size MAX_PATH, in which this path is returned +// if 'buf' is not NULL, it is output buffer of size 'bufSize', in which this path is returned // WARNING: use only Vista+ +BOOL CreateOurPathInRoamingAPPDATA(char* buf, int bufSize); +// legacy compatibility overload ('buf' must be at least MAX_PATH if non-NULL) BOOL CreateOurPathInRoamingAPPDATA(char* buf); #ifndef _WIN64 diff --git a/src/dialogs3.cpp b/src/dialogs3.cpp index 75ac91c8..7b74e5d7 100644 --- a/src/dialogs3.cpp +++ b/src/dialogs3.cpp @@ -1370,7 +1370,7 @@ void CDriveInfo::Transfer(CTransferInfo& ti) char guidPath[MAX_PATH]; mountPoint[0] = 0; guidPath[0] = 0; - if (GetResolvedPathMountPointAndGUID(VolumePath, mountPoint, guidPath)) + if (GetResolvedPathMountPointAndGUID(VolumePath, mountPoint, _countof(mountPoint), guidPath, _countof(guidPath))) { SetDlgItemTextUtf8(HWindow, IDT_MOUNTPOINT, mountPoint); SetDlgItemTextUtf8(HWindow, IDT_GUIDPATH, guidPath); diff --git a/src/dialogs5.cpp b/src/dialogs5.cpp index 468175bc..8e9cfe6b 100644 --- a/src/dialogs5.cpp +++ b/src/dialogs5.cpp @@ -1827,7 +1827,7 @@ void CCfgPageDrives::Transfer(CTransferInfo& ti) char newPath[MAX_PATH]; if (ti.Type == ttDataToWindow) { - GetIfPathIsInaccessibleGoTo(path); + GetIfPathIsInaccessibleGoTo(path, _countof(path), FALSE); ti.EditLine(IDE_DRVSPEC_ONERRGOTO, path, MAX_PATH); IfPathIsInaccessibleGoToChanged = FALSE; } @@ -1836,7 +1836,7 @@ void CCfgPageDrives::Transfer(CTransferInfo& ti) if (IfPathIsInaccessibleGoToChanged) // change only if the user actually edited the path { ti.EditLine(IDE_DRVSPEC_ONERRGOTO, newPath, MAX_PATH); - GetIfPathIsInaccessibleGoTo(path, TRUE); + GetIfPathIsInaccessibleGoTo(path, _countof(path), TRUE); if (IsTheSamePath(path, newPath)) // user wants to go to My Documents { Configuration.IfPathIsInaccessibleGoToIsMyDocs = TRUE; diff --git a/src/dialogs6.cpp b/src/dialogs6.cpp index d5cba58d..18177235 100644 --- a/src/dialogs6.cpp +++ b/src/dialogs6.cpp @@ -2434,7 +2434,7 @@ CDriveSelectErrDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case DRIVE_FIXED: // mount-point, determine the root of removable drive { - if (!GetCurrentLocalReparsePoint(DrvPath, root)) + if (!GetCurrentLocalReparsePoint(DrvPath, root, _countof(root))) setTimer = FALSE; // can't be a mount-point, no periodic tests break; } diff --git a/src/fileswn2.cpp b/src/fileswn2.cpp index 96dfd922..1065e46d 100644 --- a/src/fileswn2.cpp +++ b/src/fileswn2.cpp @@ -647,7 +647,7 @@ BOOL CFilesWindow::ChangeToRescuePathOrFixedDrive(HWND parent, BOOL* noChange, B refreshListBox, canForce, tryCloseReason); BOOL noChangeUsed = FALSE; char ifPathIsInaccessibleGoTo[MAX_PATH]; - GetIfPathIsInaccessibleGoTo(ifPathIsInaccessibleGoTo); + GetIfPathIsInaccessibleGoTo(ifPathIsInaccessibleGoTo, _countof(ifPathIsInaccessibleGoTo), FALSE); if (ifPathIsInaccessibleGoTo[0] == '\\' && ifPathIsInaccessibleGoTo[1] == '\\' || ifPathIsInaccessibleGoTo[0] != 0 && ifPathIsInaccessibleGoTo[1] == ':') { @@ -1704,7 +1704,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested BOOL canTryUserRescuePath = FALSE; // allows using Configuration.IfPathIsInaccessibleGoTo right before the fixed-drive path BOOL openIfPathIsInaccessibleGoToCfg = FALSE; char ifPathIsInaccessibleGoTo[2 * MAX_PATH]; - GetIfPathIsInaccessibleGoTo(ifPathIsInaccessibleGoTo); + GetIfPathIsInaccessibleGoTo(ifPathIsInaccessibleGoTo, _countof(ifPathIsInaccessibleGoTo), FALSE); if ((ifPathIsInaccessibleGoTo[0] == '\\' && ifPathIsInaccessibleGoTo[1] == '\\' || ifPathIsInaccessibleGoTo[0] != 0 && ifPathIsInaccessibleGoTo[1] == ':') && !IsTheSamePath(path, ifPathIsInaccessibleGoTo)) @@ -1822,7 +1822,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested canTryUserRescuePath = FALSE; // we won't try it more than once openIfPathIsInaccessibleGoToCfg = TRUE; fixedDrive = FALSE; // we'll allow switching to a fixed-drive (perhaps it was tried already but the user path had priority) - GetIfPathIsInaccessibleGoTo(changedPath); + GetIfPathIsInaccessibleGoTo(changedPath, _countof(changedPath), FALSE); shorterPathWarning = TRUE; // we want to see errors for the "rescue" path change = TRUE; } @@ -1934,7 +1934,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested } if (drvType != DRIVE_REMOTE) { - GetCurrentLocalReparsePoint(changedPath, CheckPathRootWithRetryMsgBox); + GetCurrentLocalReparsePoint(changedPath, CheckPathRootWithRetryMsgBox, MAX_PATH); if (strlen(CheckPathRootWithRetryMsgBox) > 3) { lstrcpyn(drive, CheckPathRootWithRetryMsgBox, MAX_PATH); @@ -3483,8 +3483,18 @@ void CFilesWindow::GetContextMenuPos(POINT* p) ClientToScreen(GetListBoxHWND(), p); } -void GetCommonFileTypeStr(char* buf, int* resLen, const char* ext) +void GetCommonFileTypeStr(char* buf, int bufSize, int* resLen, const char* ext) { + if (buf == NULL || resLen == NULL || ext == NULL || bufSize <= 0) + { + TRACE_E("GetCommonFileTypeStr(): invalid parameter."); + if (buf != NULL && bufSize > 0) + buf[0] = 0; + if (resLen != NULL) + *resLen = 0; + return; + } + char uppercaseExt[MAX_PATH]; char* d = uppercaseExt; char* end = uppercaseExt + MAX_PATH - 1; @@ -3493,17 +3503,22 @@ void GetCommonFileTypeStr(char* buf, int* resLen, const char* ext) *d = 0; if (*ext == 0 && uppercaseExt[0] != 0) { // we have the entire extension in uppercase (no spaces and shorter than MAX_PATH) + it is not empty - *resLen = _snprintf_s(buf, TRANSFER_BUFFER_MAX, _TRUNCATE, CommonFileTypeName2, uppercaseExt); + *resLen = _snprintf_s(buf, bufSize, _TRUNCATE, CommonFileTypeName2, uppercaseExt); if (*resLen < 0) - *resLen = TRANSFER_BUFFER_MAX - 1; // _snprintf_s reports truncation to the buffer size + *resLen = bufSize - 1; // _snprintf_s reports truncation to the buffer size } else { - memcpy(buf, CommonFileTypeName, CommonFileTypeNameLen + 1); - *resLen = CommonFileTypeNameLen; + lstrcpyn(buf, CommonFileTypeName, bufSize); + *resLen = (int)strlen(buf); } } +void GetCommonFileTypeStr(char* buf, int* resLen, const char* ext) +{ + GetCommonFileTypeStr(buf, TRANSFER_BUFFER_MAX, resLen, ext); +} + void CFilesWindow::RefreshListBox(int suggestedXOffset, int suggestedTopIndex, int suggestedFocusIndex, BOOL ensureFocusIndexVisible, BOOL wholeItemVisible) @@ -3859,7 +3874,7 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset, if (commonFileType) { int resLen; - GetCommonFileTypeStr(buf, &resLen, f->Ext); + GetCommonFileTypeStr(buf, _countof(buf), &resLen, f->Ext); GetTextExtentPoint32(dc, buf, resLen, &act); act.cx += SPACE_WIDTH; if (columnWidthType < act.cx) diff --git a/src/fileswn3.cpp b/src/fileswn3.cpp index d192eef9..1995bbcf 100644 --- a/src/fileswn3.cpp +++ b/src/fileswn3.cpp @@ -450,7 +450,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) } if (drvType2 != DRIVE_REMOTE) { - GetCurrentLocalReparsePoint(GetPath(), CheckPathRootWithRetryMsgBox); + GetCurrentLocalReparsePoint(GetPath(), CheckPathRootWithRetryMsgBox, MAX_PATH); if (strlen(CheckPathRootWithRetryMsgBox) > 3) { lstrcpyn(drive, CheckPathRootWithRetryMsgBox, MAX_PATH); @@ -2088,7 +2088,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch char fsName[2 * MAX_PATH]; char* fsUserPart; - if (!sendDirectlyToPluginLocal && IsPluginFSPath(path, fsName, (const char**)&fsUserPart)) + if (!sendDirectlyToPluginLocal && IsPluginFSPath(path, fsName, _countof(fsName), (const char**)&fsUserPart)) { if (strlen(fsUserPart) >= 2 * MAX_PATH) // plugins do not count with longer path { @@ -2553,7 +2553,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch } if (drvType != DRIVE_REMOTE) { - GetCurrentLocalReparsePoint(copy, CheckPathRootWithRetryMsgBox); + GetCurrentLocalReparsePoint(copy, CheckPathRootWithRetryMsgBox, MAX_PATH); if (strlen(CheckPathRootWithRetryMsgBox) > 3) { lstrcpyn(drive, CheckPathRootWithRetryMsgBox, MAX_PATH); diff --git a/src/fileswn8.cpp b/src/fileswn8.cpp index 80135e13..e4862cf4 100644 --- a/src/fileswn8.cpp +++ b/src/fileswn8.cpp @@ -135,7 +135,7 @@ void PluginFSConvertPathToExternal(char* path) char* fsUserPart; int index; int fsNameIndex; - if (IsPluginFSPath(path, fsName, (const char**)&fsUserPart) && + if (IsPluginFSPath(path, fsName, _countof(fsName), (const char**)&fsUserPart) && Plugins.IsPluginFS(fsName, index, fsNameIndex)) { CPluginData* plugin = Plugins.Get(index); diff --git a/src/mainwnd2.cpp b/src/mainwnd2.cpp index 1118ab90..c6b81e85 100644 --- a/src/mainwnd2.cpp +++ b/src/mainwnd2.cpp @@ -3300,7 +3300,7 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* &Configuration.IfPathIsInaccessibleGoToIsMyDocs, sizeof(DWORD))) { char path[MAX_PATH]; - GetIfPathIsInaccessibleGoTo(path, TRUE); + GetIfPathIsInaccessibleGoTo(path, _countof(path), TRUE); if (IsTheSamePath(path, Configuration.IfPathIsInaccessibleGoTo)) // user wants to go to My Documents { Configuration.IfPathIsInaccessibleGoToIsMyDocs = TRUE; diff --git a/src/mainwnd3.cpp b/src/mainwnd3.cpp index c30f187f..2db063e5 100644 --- a/src/mainwnd3.cpp +++ b/src/mainwnd3.cpp @@ -2847,7 +2847,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = if (WindowsVistaAndLater) { - if (!CreateOurPathInRoamingAPPDATA(defDir)) + if (!CreateOurPathInRoamingAPPDATA(defDir, _countof(defDir))) { TRACE_E("CM_EXPORTCONFIG: unexpected situation: unable to get our directory under CSIDL_APPDATA"); return 0; diff --git a/src/mainwnd4.cpp b/src/mainwnd4.cpp index 832a30ad..eeb85638 100644 --- a/src/mainwnd4.cpp +++ b/src/mainwnd4.cpp @@ -247,7 +247,7 @@ void CMainWindow::MakeFileList() case 0: // clipboard case 1: // viewer { - if (!SalGetTempFileName(NULL, "MFL", fileName, TRUE)) + if (!SalGetTempFileName(NULL, "MFL", fileName, _countof(fileName), TRUE)) { DWORD err = GetLastError(); char errorText[200 + 2 * MAX_PATH]; diff --git a/src/pack1.cpp b/src/pack1.cpp index 50db8ab0..14de2907 100644 --- a/src/pack1.cpp +++ b/src/pack1.cpp @@ -1450,7 +1450,7 @@ BOOL PackUniversalUncompress(HWND parent, const char* command, TPackErrorTable* // Create the name of the temporary directory char tmpDirNameBuf[MAX_PATH]; - if (!SalGetTempFileName(targetDir, "PACK", tmpDirNameBuf, FALSE)) + if (!SalGetTempFileName(targetDir, "PACK", tmpDirNameBuf, _countof(tmpDirNameBuf), FALSE)) { char buffer[1000]; strcpy(buffer, "SalGetTempFileName: "); @@ -1464,7 +1464,7 @@ BOOL PackUniversalUncompress(HWND parent, const char* command, TPackErrorTable* // Create the name of the temporary file char tmpListNameBuf[MAX_PATH]; - if (!SalGetTempFileName(NULL, "PACK", tmpListNameBuf, TRUE)) + if (!SalGetTempFileName(NULL, "PACK", tmpListNameBuf, _countof(tmpListNameBuf), TRUE)) { char buffer[1000]; strcpy(buffer, "SalGetTempFileName: "); @@ -1812,7 +1812,7 @@ BOOL PackUnpackOneFile(CFilesWindow* panel, const char* archiveFileName, // buffer for the full name of the temporary directory char tmpDirNameBuf[MAX_PATH]; - if (!SalGetTempFileName(targetDir, "PACK", tmpDirNameBuf, FALSE)) + if (!SalGetTempFileName(targetDir, "PACK", tmpDirNameBuf, _countof(tmpDirNameBuf), FALSE)) { char buffer[1000]; strcpy(buffer, "SalGetTempFileName: "); diff --git a/src/pack2.cpp b/src/pack2.cpp index 90c7f662..e72a2243 100644 --- a/src/pack2.cpp +++ b/src/pack2.cpp @@ -288,7 +288,7 @@ BOOL PackUniversalCompress(HWND parent, const char* command, TPackErrorTable* co // Create the temporary file name char tmpListNameBuf[MAX_PATH]; - if (!SalGetTempFileName(NULL, "PACK", tmpListNameBuf, TRUE)) + if (!SalGetTempFileName(NULL, "PACK", tmpListNameBuf, _countof(tmpListNameBuf), TRUE)) { char buffer[1000]; strcpy(buffer, "SalGetTempFileName: "); @@ -631,7 +631,7 @@ BOOL PackDelFromArc(HWND parent, CFilesWindow* panel, const char* archiveFileNam // // buffer for the full name of the helper file char tmpListNameBuf[MAX_PATH]; - if (!SalGetTempFileName(NULL, "PACK", tmpListNameBuf, TRUE)) + if (!SalGetTempFileName(NULL, "PACK", tmpListNameBuf, _countof(tmpListNameBuf), TRUE)) { char buffer[1000]; strcpy(buffer, "SalGetTempFileName: "); diff --git a/src/plugins/automation/generated/salamander_p.c b/src/plugins/automation/generated/salamander_p.c index b52d3ce8..4e35d89b 100644 --- a/src/plugins/automation/generated/salamander_p.c +++ b/src/plugins/automation/generated/salamander_p.c @@ -4328,11 +4328,6 @@ struct __midl_frag543_t; extern const __midl_frag543_t __midl_frag543; -typedef -NDR64_FORMAT_CHAR -__midl_frag542_t; -extern const __midl_frag542_t __midl_frag542; - typedef struct { @@ -4343,21 +4338,6 @@ struct __midl_frag540_t; extern const __midl_frag540_t __midl_frag540; -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag537_t; -extern const __midl_frag537_t __midl_frag537; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag536_t; -extern const __midl_frag536_t __midl_frag536; - typedef NDR64_FORMAT_CHAR __midl_frag534_t; @@ -4433,46 +4413,6 @@ struct __midl_frag520_t; extern const __midl_frag520_t __midl_frag520; -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag510_t; -extern const __midl_frag510_t __midl_frag510; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag490_t; -extern const __midl_frag490_t __midl_frag490; - -typedef -struct _NDR64_USER_MARSHAL_FORMAT -__midl_frag489_t; -extern const __midl_frag489_t __midl_frag489; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag488_t; -extern const __midl_frag488_t __midl_frag488; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag483_t; -extern const __midl_frag483_t __midl_frag483; - typedef struct { @@ -4517,150 +4457,6 @@ struct __midl_frag460_t; extern const __midl_frag460_t __midl_frag460; -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag450_t; -extern const __midl_frag450_t __midl_frag450; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag447_t; -extern const __midl_frag447_t __midl_frag447; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag444_t; -extern const __midl_frag444_t __midl_frag444; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag443_t; -extern const __midl_frag443_t __midl_frag443; - -typedef -NDR64_FORMAT_CHAR -__midl_frag441_t; -extern const __midl_frag441_t __midl_frag441; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag440_t; -extern const __midl_frag440_t __midl_frag440; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag437_t; -extern const __midl_frag437_t __midl_frag437; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag436_t; -extern const __midl_frag436_t __midl_frag436; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag428_t; -extern const __midl_frag428_t __midl_frag428; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag423_t; -extern const __midl_frag423_t __midl_frag423; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag410_t; -extern const __midl_frag410_t __midl_frag410; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag409_t; -extern const __midl_frag409_t __midl_frag409; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag405_t; -extern const __midl_frag405_t __midl_frag405; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag399_t; -extern const __midl_frag399_t __midl_frag399; - -typedef -struct _NDR64_USER_MARSHAL_FORMAT -__midl_frag398_t; -extern const __midl_frag398_t __midl_frag398; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag397_t; -extern const __midl_frag397_t __midl_frag397; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag396_t; -extern const __midl_frag396_t __midl_frag396; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; -} -__midl_frag394_t; -extern const __midl_frag394_t __midl_frag394; - typedef struct _NDR64_CONSTANT_IID_FORMAT __midl_frag390_t; @@ -4686,21 +4482,6 @@ struct __midl_frag387_t; extern const __midl_frag387_t __midl_frag387; -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag384_t; -extern const __midl_frag384_t __midl_frag384; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag383_t; -extern const __midl_frag383_t __midl_frag383; - typedef struct _NDR64_CONSTANT_IID_FORMAT __midl_frag381_t; @@ -4747,50 +4528,6 @@ struct __midl_frag367_t; extern const __midl_frag367_t __midl_frag367; -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag365_t; -extern const __midl_frag365_t __midl_frag365; - -typedef -struct _NDR64_USER_MARSHAL_FORMAT -__midl_frag364_t; -extern const __midl_frag364_t __midl_frag364; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag363_t; -extern const __midl_frag363_t __midl_frag363; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag362_t; -extern const __midl_frag362_t __midl_frag362; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; -} -__midl_frag350_t; -extern const __midl_frag350_t __midl_frag350; - -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; -} -__midl_frag341_t; -extern const __midl_frag341_t __midl_frag341; - typedef struct _NDR64_CONSTANT_IID_FORMAT __midl_frag337_t; @@ -4816,21 +4553,6 @@ struct __midl_frag334_t; extern const __midl_frag334_t __midl_frag334; -typedef -struct _NDR64_CONSTANT_IID_FORMAT -__midl_frag327_t; -extern const __midl_frag327_t __midl_frag327; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag326_t; -extern const __midl_frag326_t __midl_frag326; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag325_t; -extern const __midl_frag325_t __midl_frag325; - typedef struct { @@ -4966,16 +4688,6 @@ struct __midl_frag243_t; extern const __midl_frag243_t __midl_frag243; -typedef -NDR64_FORMAT_CHAR -__midl_frag239_t; -extern const __midl_frag239_t __midl_frag239; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag238_t; -extern const __midl_frag238_t __midl_frag238; - typedef struct { @@ -4988,17 +4700,6 @@ struct __midl_frag233_t; extern const __midl_frag233_t __midl_frag233; -typedef -struct -{ - struct _NDR64_PROC_FORMAT frag1; - struct _NDR64_PARAM_FORMAT frag2; - struct _NDR64_PARAM_FORMAT frag3; - struct _NDR64_PARAM_FORMAT frag4; -} -__midl_frag226_t; -extern const __midl_frag226_t __midl_frag226; - typedef struct _NDR64_CONSTANT_IID_FORMAT __midl_frag224_t; @@ -5087,21 +4788,6 @@ struct __midl_frag173_t; extern const __midl_frag173_t __midl_frag173; -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag154_t; -extern const __midl_frag154_t __midl_frag154; - -typedef -struct _NDR64_USER_MARSHAL_FORMAT -__midl_frag153_t; -extern const __midl_frag153_t __midl_frag153; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag152_t; -extern const __midl_frag152_t __midl_frag152; - typedef struct _NDR64_POINTER_FORMAT __midl_frag150_t; @@ -5145,21 +4831,6 @@ struct __midl_frag138_t; extern const __midl_frag138_t __midl_frag138; -typedef -NDR64_FORMAT_CHAR -__midl_frag135_t; -extern const __midl_frag135_t __midl_frag135; - -typedef -NDR64_FORMAT_CHAR -__midl_frag132_t; -extern const __midl_frag132_t __midl_frag132; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag131_t; -extern const __midl_frag131_t __midl_frag131; - typedef struct _NDR64_POINTER_FORMAT __midl_frag130_t; @@ -5195,36 +4866,16 @@ struct _NDR64_POINTER_FORMAT __midl_frag124_t; extern const __midl_frag124_t __midl_frag124; -typedef -struct _NDR64_CONSTANT_IID_FORMAT -__midl_frag123_t; -extern const __midl_frag123_t __midl_frag123; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag122_t; -extern const __midl_frag122_t __midl_frag122; - typedef struct _NDR64_POINTER_FORMAT __midl_frag121_t; extern const __midl_frag121_t __midl_frag121; -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag120_t; -extern const __midl_frag120_t __midl_frag120; - typedef struct _NDR64_POINTER_FORMAT __midl_frag119_t; extern const __midl_frag119_t __midl_frag119; -typedef -NDR64_FORMAT_CHAR -__midl_frag118_t; -extern const __midl_frag118_t __midl_frag118; - typedef struct _NDR64_POINTER_FORMAT __midl_frag117_t; @@ -5235,16 +4886,6 @@ struct _NDR64_POINTER_FORMAT __midl_frag116_t; extern const __midl_frag116_t __midl_frag116; -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag114_t; -extern const __midl_frag114_t __midl_frag114; - -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag112_t; -extern const __midl_frag112_t __midl_frag112; - typedef NDR64_FORMAT_CHAR __midl_frag109_t; @@ -5255,11 +4896,6 @@ struct _NDR64_POINTER_FORMAT __midl_frag108_t; extern const __midl_frag108_t __midl_frag108; -typedef -struct _NDR64_POINTER_FORMAT -__midl_frag106_t; -extern const __midl_frag106_t __midl_frag106; - typedef NDR64_FORMAT_CHAR __midl_frag101_t; @@ -5283,11 +4919,6 @@ struct __midl_frag98_t; extern const __midl_frag98_t __midl_frag98; -typedef -NDR64_FORMAT_CHAR -__midl_frag97_t; -extern const __midl_frag97_t __midl_frag97; - typedef struct { @@ -5329,11 +4960,6 @@ struct __midl_frag93_t; extern const __midl_frag93_t __midl_frag93; -typedef -NDR64_FORMAT_CHAR -__midl_frag92_t; -extern const __midl_frag92_t __midl_frag92; - typedef struct { @@ -5366,11 +4992,6 @@ struct __midl_frag88_t; extern const __midl_frag88_t __midl_frag88; -typedef -NDR64_FORMAT_CHAR -__midl_frag87_t; -extern const __midl_frag87_t __midl_frag87; - typedef struct { @@ -5403,11 +5024,6 @@ struct __midl_frag83_t; extern const __midl_frag83_t __midl_frag83; -typedef -NDR64_FORMAT_CHAR -__midl_frag82_t; -extern const __midl_frag82_t __midl_frag82; - typedef struct { @@ -5448,6 +5064,15 @@ struct __midl_frag77_t; extern const __midl_frag77_t __midl_frag77; +typedef +struct +{ + NDR64_FORMAT_UINT32 frag1; + struct _NDR64_EXPR_VAR frag2; +} +__midl_frag73_t; +extern const __midl_frag73_t __midl_frag73; + typedef struct { @@ -5619,6 +5244,15 @@ struct __midl_frag55_t; extern const __midl_frag55_t __midl_frag55; +typedef +struct +{ + NDR64_FORMAT_UINT32 frag1; + struct _NDR64_EXPR_VAR frag2; +} +__midl_frag51_t; +extern const __midl_frag51_t __midl_frag51; + typedef struct { @@ -5653,6 +5287,42 @@ struct __midl_frag49_t; extern const __midl_frag49_t __midl_frag49; +typedef +struct +{ + struct _NDR64_POINTER_FORMAT frag1; +} +__midl_frag48_t; +extern const __midl_frag48_t __midl_frag48; + +typedef +struct +{ + NDR64_FORMAT_UINT32 frag1; + struct _NDR64_EXPR_VAR frag2; +} +__midl_frag44_t; +extern const __midl_frag44_t __midl_frag44; + +typedef +struct +{ + struct _NDR64_CONF_ARRAY_HEADER_FORMAT frag1; + struct + { + struct _NDR64_REPEAT_FORMAT frag1; + struct + { + struct _NDR64_POINTER_INSTANCE_HEADER_FORMAT frag1; + struct _NDR64_POINTER_FORMAT frag2; + } frag2; + NDR64_FORMAT_CHAR frag3; + } frag2; + struct _NDR64_ARRAY_ELEMENT_INFO frag3; +} +__midl_frag43_t; +extern const __midl_frag43_t __midl_frag43; + typedef struct { @@ -5859,6 +5529,15 @@ struct __midl_frag12_t; extern const __midl_frag12_t __midl_frag12; +typedef +struct +{ + NDR64_FORMAT_UINT32 frag1; + struct _NDR64_EXPR_VAR frag2; +} +__midl_frag7_t; +extern const __midl_frag7_t __midl_frag7; + typedef struct { @@ -5876,11 +5555,6 @@ struct __midl_frag5_t; extern const __midl_frag5_t __midl_frag5; -typedef -struct _NDR64_USER_MARSHAL_FORMAT -__midl_frag3_t; -extern const __midl_frag3_t __midl_frag3; - typedef struct { @@ -6769,9 +6443,6 @@ static const __midl_frag543_t __midl_frag543 = } }; -static const __midl_frag542_t __midl_frag542 = -0x5 /* FC64_INT32 */; - static const __midl_frag540_t __midl_frag540 = { /* put_DialogResult */ @@ -6788,7 +6459,7 @@ static const __midl_frag540_t __midl_frag540 = }, { /* val */ /* parameter val */ - &__midl_frag542, + &__midl_frag546, { /* val */ 0, @@ -6812,80 +6483,7 @@ static const __midl_frag540_t __midl_frag540 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag537_t __midl_frag537 = -{ -/* *int */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 12 /* 0xc */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag542 -}; - -static const __midl_frag536_t __midl_frag536 = -{ -/* get_DialogResult */ - { - /* get_DialogResult */ /* procedure get_DialogResult */ - (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 40 /* 0x28 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* val */ /* parameter val */ - &__midl_frag542, - { - /* val */ - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* [out], Basetype, SimpleRef, UseCache */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -6952,7 +6550,7 @@ static const __midl_frag533_t __midl_frag533 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -7025,7 +6623,7 @@ static const __midl_frag529_t __midl_frag529 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -7111,7 +6709,7 @@ static const __midl_frag525_t __midl_frag525 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -7206,7 +6804,7 @@ static const __midl_frag520_t __midl_frag520 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -7230,45 +6828,21 @@ static const __midl_frag520_t __midl_frag520 = } }; -static const __midl_frag510_t __midl_frag510 = +static const __midl_frag472_t __midl_frag472 = { -/* get_Name */ +/* Hide */ { - /* get_Name */ /* procedure get_Name */ - (NDR64_UINT32) 4849987 /* 0x4a0143 */, /* auto handle */ /* IsIntrepreted, [object], ServerMustSize, HasReturn, ClientCorrelation */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ + /* Hide */ /* procedure Hide */ + (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ + (NDR64_UINT32) 16 /* 0x10 */ , /* Stack size */ (NDR64_UINT32) 0 /* 0x0 */, (NDR64_UINT32) 8 /* 0x8 */, (NDR64_UINT16) 0 /* 0x0 */, (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, + (NDR64_UINT16) 1 /* 0x1 */, (NDR64_UINT16) 0 /* 0x0 */ }, { - /* name */ /* parameter name */ - &__midl_frag522, - { - /* name */ - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* MustSize, MustFree, [out], SimpleRef, UseCache */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { /* HRESULT */ /* parameter HRESULT */ &__midl_frag546, { @@ -7290,37 +6864,15 @@ static const __midl_frag510_t __midl_frag510 = 0 }, /* [out], IsReturn, Basetype, ByValue */ (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ + 8 /* 0x8 */, /* Stack offset */ } }; -static const __midl_frag490_t __midl_frag490 = -{ -/* *FLAGGED_WORD_BLOB */ - 0x21, /* FC64_UP */ - (NDR64_UINT8) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag5 -}; - -static const __midl_frag489_t __midl_frag489 = -{ -/* wireBSTR */ - 0xa2, /* FC64_USER_MARSHAL */ - (NDR64_UINT8) 128 /* 0x80 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 7 /* 0x7 */, - (NDR64_UINT16) 8 /* 0x8 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT32) 0 /* 0x0 */, - &__midl_frag490 -}; - -static const __midl_frag488_t __midl_frag488 = +static const __midl_frag465_t __midl_frag465 = { -/* put_Text */ +/* put_TotalMaximum */ { - /* put_Text */ /* procedure put_Text */ + /* put_TotalMaximum */ /* procedure put_TotalMaximum */ (NDR64_UINT32) 2883907 /* 0x2c0143 */, /* auto handle */ /* IsIntrepreted, [object], ClientMustSize, HasReturn, ServerCorrelation */ (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ (NDR64_UINT32) 0 /* 0x0 */, @@ -7331,10 +6883,10 @@ static const __midl_frag488_t __midl_frag488 = (NDR64_UINT16) 0 /* 0x0 */ }, { - /* text */ /* parameter text */ - &__midl_frag489, + /* max */ /* parameter max */ + &__midl_frag549, { - /* text */ + /* max */ 1, 1, 0, @@ -7342,21 +6894,21 @@ static const __midl_frag488_t __midl_frag488 = 0, 0, 0, - 1, 0, + 1, 0, 0, 0, 0, (NDR64_UINT16) 0 /* 0x0 */, 0 - }, /* MustSize, MustFree, [in], ByValue */ + }, /* MustSize, MustFree, [in], SimpleRef */ (NDR64_UINT16) 0 /* 0x0 */, 8 /* 0x8 */, /* Stack offset */ }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -7380,11 +6932,42 @@ static const __midl_frag488_t __midl_frag488 = } }; -static const __midl_frag483_t __midl_frag483 = +static const __midl_frag463_t __midl_frag463 = { -/* get_Text */ +/* *_wireVARIANT */ + 0x22, /* FC64_OP */ + (NDR64_UINT8) 0 /* 0x0 */, + (NDR64_UINT16) 0 /* 0x0 */, + &__midl_frag12 +}; + +static const __midl_frag462_t __midl_frag462 = +{ +/* wireVARIANT */ + 0xa2, /* FC64_USER_MARSHAL */ + (NDR64_UINT8) 128 /* 0x80 */, + (NDR64_UINT16) 1 /* 0x1 */, + (NDR64_UINT16) 7 /* 0x7 */, + (NDR64_UINT16) 8 /* 0x8 */, + (NDR64_UINT32) 24 /* 0x18 */, + (NDR64_UINT32) 0 /* 0x0 */, + &__midl_frag463 +}; + +static const __midl_frag461_t __midl_frag461 = +{ +/* *wireVARIANT */ + 0x20, /* FC64_RP */ + (NDR64_UINT8) 4 /* 0x4 */, + (NDR64_UINT16) 0 /* 0x0 */, + &__midl_frag462 +}; + +static const __midl_frag460_t __midl_frag460 = +{ +/* get_TotalMaximum */ { - /* get_Text */ /* procedure get_Text */ + /* get_TotalMaximum */ /* procedure get_TotalMaximum */ (NDR64_UINT32) 4849987 /* 0x4a0143 */, /* auto handle */ /* IsIntrepreted, [object], ServerMustSize, HasReturn, ClientCorrelation */ (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ (NDR64_UINT32) 0 /* 0x0 */, @@ -7395,10 +6978,10 @@ static const __midl_frag483_t __midl_frag483 = (NDR64_UINT16) 0 /* 0x0 */ }, { - /* text */ /* parameter text */ - &__midl_frag522, + /* max */ /* parameter max */ + &__midl_frag462, { - /* text */ + /* max */ 1, 1, 0, @@ -7420,7 +7003,7 @@ static const __midl_frag483_t __midl_frag483 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -7444,1190 +7027,57 @@ static const __midl_frag483_t __midl_frag483 = } }; -static const __midl_frag472_t __midl_frag472 = -{ -/* Hide */ - { - /* Hide */ /* procedure Hide */ - (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ - (NDR64_UINT32) 16 /* 0x10 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 1 /* 0x1 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - } -}; - -static const __midl_frag465_t __midl_frag465 = -{ -/* put_TotalMaximum */ - { - /* put_TotalMaximum */ /* procedure put_TotalMaximum */ - (NDR64_UINT32) 2883907 /* 0x2c0143 */, /* auto handle */ /* IsIntrepreted, [object], ClientMustSize, HasReturn, ServerCorrelation */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* max */ /* parameter max */ - &__midl_frag560, - { - /* max */ - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* MustSize, MustFree, [in], SimpleRef */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag463_t __midl_frag463 = -{ -/* *_wireVARIANT */ - 0x22, /* FC64_OP */ - (NDR64_UINT8) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag12 -}; - -static const __midl_frag462_t __midl_frag462 = -{ -/* wireVARIANT */ - 0xa2, /* FC64_USER_MARSHAL */ - (NDR64_UINT8) 128 /* 0x80 */, - (NDR64_UINT16) 1 /* 0x1 */, - (NDR64_UINT16) 7 /* 0x7 */, - (NDR64_UINT16) 8 /* 0x8 */, - (NDR64_UINT32) 24 /* 0x18 */, - (NDR64_UINT32) 0 /* 0x0 */, - &__midl_frag463 -}; - -static const __midl_frag461_t __midl_frag461 = -{ -/* *wireVARIANT */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 4 /* 0x4 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag462 -}; - -static const __midl_frag460_t __midl_frag460 = -{ -/* get_TotalMaximum */ - { - /* get_TotalMaximum */ /* procedure get_TotalMaximum */ - (NDR64_UINT32) 4849987 /* 0x4a0143 */, /* auto handle */ /* IsIntrepreted, [object], ServerMustSize, HasReturn, ClientCorrelation */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* max */ /* parameter max */ - &__midl_frag462, - { - /* max */ - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* MustSize, MustFree, [out], SimpleRef, UseCache */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag450_t __midl_frag450 = -{ -/* get_Maximum */ - { - /* get_Maximum */ /* procedure get_Maximum */ - (NDR64_UINT32) 4849987 /* 0x4a0143 */, /* auto handle */ /* IsIntrepreted, [object], ServerMustSize, HasReturn, ClientCorrelation */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* max */ /* parameter max */ - &__midl_frag462, - { - /* max */ - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* MustSize, MustFree, [out], SimpleRef, UseCache */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag554, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag447_t __midl_frag447 = -{ -/* put_Style */ - { - /* put_Style */ /* procedure put_Style */ - (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* barcount */ /* parameter barcount */ - &__midl_frag546, - { - /* barcount */ - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [in], Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag546, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag444_t __midl_frag444 = -{ -/* *int */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 12 /* 0xc */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag546 -}; - -static const __midl_frag443_t __midl_frag443 = -{ -/* get_Style */ - { - /* get_Style */ /* procedure get_Style */ - (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 40 /* 0x28 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* barcount */ /* parameter barcount */ - &__midl_frag546, - { - /* barcount */ - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* [out], Basetype, SimpleRef, UseCache */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag546, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag441_t __midl_frag441 = -0x4 /* FC64_INT16 */; - -static const __midl_frag440_t __midl_frag440 = -{ -/* put_CanCancel */ - { - /* put_CanCancel */ /* procedure put_CanCancel */ - (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 6 /* 0x6 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* enabled */ /* parameter enabled */ - &__midl_frag441, - { - /* enabled */ - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [in], Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag546, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag437_t __midl_frag437 = -{ -/* *VARIANT_BOOL */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 12 /* 0xc */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag441 -}; - -static const __midl_frag436_t __midl_frag436 = -{ -/* get_CanCancel */ - { - /* get_CanCancel */ /* procedure get_CanCancel */ - (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 38 /* 0x26 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* enabled */ /* parameter enabled */ - &__midl_frag441, - { - /* enabled */ - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* [out], Basetype, SimpleRef, UseCache */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag546, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag428_t __midl_frag428 = -{ -/* put_TotalPosition */ - { - /* put_TotalPosition */ /* procedure put_TotalPosition */ - (NDR64_UINT32) 2883907 /* 0x2c0143 */, /* auto handle */ /* IsIntrepreted, [object], ClientMustSize, HasReturn, ServerCorrelation */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* position */ /* parameter position */ - &__midl_frag549, - { - /* position */ - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* MustSize, MustFree, [in], SimpleRef */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag546, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag423_t __midl_frag423 = -{ -/* get_TotalPosition */ - { - /* get_TotalPosition */ /* procedure get_TotalPosition */ - (NDR64_UINT32) 4849987 /* 0x4a0143 */, /* auto handle */ /* IsIntrepreted, [object], ServerMustSize, HasReturn, ClientCorrelation */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* position */ /* parameter position */ - &__midl_frag462, - { - /* position */ - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* MustSize, MustFree, [out], SimpleRef, UseCache */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag546, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag410_t __midl_frag410 = -{ -/* *VARIANT_BOOL */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 12 /* 0xc */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag534 -}; - -static const __midl_frag409_t __midl_frag409 = -{ -/* get_IsCancelled */ - { - /* get_IsCancelled */ /* procedure get_IsCancelled */ - (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 38 /* 0x26 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* cancelled */ /* parameter cancelled */ - &__midl_frag534, - { - /* cancelled */ - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* [out], Basetype, SimpleRef, UseCache */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag405_t __midl_frag405 = -{ -/* AddText */ - { - /* AddText */ /* procedure AddText */ - (NDR64_UINT32) 2883907 /* 0x2c0143 */, /* auto handle */ /* IsIntrepreted, [object], ClientMustSize, HasReturn, ServerCorrelation */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* text */ /* parameter text */ - &__midl_frag489, - { - /* text */ - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* MustSize, MustFree, [in], ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag554, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag399_t __midl_frag399 = -{ -/* *FLAGGED_WORD_BLOB */ - 0x22, /* FC64_OP */ - (NDR64_UINT8) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag5 -}; - -static const __midl_frag398_t __midl_frag398 = -{ -/* wireBSTR */ - 0xa2, /* FC64_USER_MARSHAL */ - (NDR64_UINT8) 128 /* 0x80 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 7 /* 0x7 */, - (NDR64_UINT16) 8 /* 0x8 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT32) 0 /* 0x0 */, - &__midl_frag399 -}; - -static const __midl_frag397_t __midl_frag397 = -{ -/* *wireBSTR */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 4 /* 0x4 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag398 -}; - -static const __midl_frag396_t __midl_frag396 = -{ -/* get_Title */ - { - /* get_Title */ /* procedure get_Title */ - (NDR64_UINT32) 4849987 /* 0x4a0143 */, /* auto handle */ /* IsIntrepreted, [object], ServerMustSize, HasReturn, ClientCorrelation */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* title */ /* parameter title */ - &__midl_frag398, - { - /* title */ - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* MustSize, MustFree, [out], SimpleRef, UseCache */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag554, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag394_t __midl_frag394 = -{ -/* Hide */ - { - /* Hide */ /* procedure Hide */ - (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ - (NDR64_UINT32) 16 /* 0x10 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 1 /* 0x1 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag554, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - } -}; - -static const __midl_frag390_t __midl_frag390 = -{ -/* struct _NDR64_CONSTANT_IID_FORMAT */ - 0x24, /* FC64_IP */ - (NDR64_UINT8) 1 /* 0x1 */, - (NDR64_UINT16) 0 /* 0x0 */, - { - 0x00000000, - 0x0000, - 0x0000, - {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} - } -}; - -static const __midl_frag389_t __midl_frag389 = -{ -/* *struct _NDR64_POINTER_FORMAT */ - 0x24, /* FC64_IP */ - (NDR64_UINT8) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag390 -}; - -static const __midl_frag388_t __midl_frag388 = -{ -/* **struct _NDR64_POINTER_FORMAT */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 16 /* 0x10 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag389 -}; - -static const __midl_frag387_t __midl_frag387 = -{ -/* get__NewEnum */ - { - /* get__NewEnum */ /* procedure get__NewEnum */ - (NDR64_UINT32) 655683 /* 0xa0143 */, /* auto handle */ /* IsIntrepreted, [object], ServerMustSize, HasReturn */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* ppenum */ /* parameter ppenum */ - &__midl_frag388, - { - /* ppenum */ - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* MustSize, MustFree, [out] */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag554, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag384_t __midl_frag384 = -{ -/* *long */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 12 /* 0xc */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag554 -}; - -static const __midl_frag383_t __midl_frag383 = -{ -/* get_Count */ - { - /* get_Count */ /* procedure get_Count */ - (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 40 /* 0x28 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* count */ /* parameter count */ - &__midl_frag554, - { - /* count */ - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* [out], Basetype, SimpleRef, UseCache */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag554, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag381_t __midl_frag381 = +static const __midl_frag390_t __midl_frag390 = { /* struct _NDR64_CONSTANT_IID_FORMAT */ 0x24, /* FC64_IP */ (NDR64_UINT8) 1 /* 0x1 */, (NDR64_UINT16) 0 /* 0x0 */, { - 0x8cd33727, - 0x0a92, - 0x4560, - {0x80, 0xd7, 0x1a, 0x44, 0x65, 0x12, 0x0e, 0x9b} + 0x00000000, + 0x0000, + 0x0000, + {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} } }; -static const __midl_frag380_t __midl_frag380 = +static const __midl_frag389_t __midl_frag389 = { /* *struct _NDR64_POINTER_FORMAT */ 0x24, /* FC64_IP */ (NDR64_UINT8) 0 /* 0x0 */, (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag381 + &__midl_frag390 }; -static const __midl_frag379_t __midl_frag379 = +static const __midl_frag388_t __midl_frag388 = { /* **struct _NDR64_POINTER_FORMAT */ 0x20, /* FC64_RP */ (NDR64_UINT8) 16 /* 0x10 */, (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag380 + &__midl_frag389 }; -static const __midl_frag375_t __midl_frag375 = +static const __midl_frag387_t __midl_frag387 = { -/* get_Item */ +/* get__NewEnum */ { - /* get_Item */ /* procedure get_Item */ - (NDR64_UINT32) 36569411 /* 0x22e0143 */, /* auto handle */ /* IsIntrepreted, [object], ServerMustSize, ClientMustSize, HasReturn, ServerCorrelation, actual guaranteed */ - (NDR64_UINT32) 32 /* 0x20 */ , /* Stack size */ + /* get__NewEnum */ /* procedure get__NewEnum */ + (NDR64_UINT32) 655683 /* 0xa0143 */, /* auto handle */ /* IsIntrepreted, [object], ServerMustSize, HasReturn */ + (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ (NDR64_UINT32) 0 /* 0x0 */, (NDR64_UINT32) 8 /* 0x8 */, (NDR64_UINT16) 0 /* 0x0 */, (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 3 /* 0x3 */, + (NDR64_UINT16) 2 /* 0x2 */, (NDR64_UINT16) 0 /* 0x0 */ }, { - /* key */ /* parameter key */ - &__midl_frag560, - { - /* key */ - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* MustSize, MustFree, [in], SimpleRef */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* item */ /* parameter item */ - &__midl_frag379, + /* ppenum */ /* parameter ppenum */ + &__midl_frag388, { - /* item */ + /* ppenum */ 1, 1, 0, @@ -8645,11 +7095,11 @@ static const __midl_frag375_t __midl_frag375 = 0 }, /* MustSize, MustFree, [out] */ (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ + 8 /* 0x8 */, /* Stack offset */ }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag554, + &__midl_frag546, { /* HRESULT */ 0, @@ -8669,168 +7119,93 @@ static const __midl_frag375_t __midl_frag375 = 0 }, /* [out], IsReturn, Basetype, ByValue */ (NDR64_UINT16) 0 /* 0x0 */, - 24 /* 0x18 */, /* Stack offset */ + 16 /* 0x10 */, /* Stack offset */ } }; -static const __midl_frag369_t __midl_frag369 = -0xc /* FC64_FLOAT64 */; - -static const __midl_frag368_t __midl_frag368 = +static const __midl_frag381_t __midl_frag381 = { -/* *DATE */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 12 /* 0xc */, +/* struct _NDR64_CONSTANT_IID_FORMAT */ + 0x24, /* FC64_IP */ + (NDR64_UINT8) 1 /* 0x1 */, (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag369 -}; - -static const __midl_frag367_t __midl_frag367 = -{ -/* get_DateLastModified */ - { - /* get_DateLastModified */ /* procedure get_DateLastModified */ - (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 48 /* 0x30 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* date */ /* parameter date */ - &__midl_frag369, - { - /* date */ - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* [out], Basetype, SimpleRef, UseCache */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag554, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ + { + 0x8cd33727, + 0x0a92, + 0x4560, + {0x80, 0xd7, 0x1a, 0x44, 0x65, 0x12, 0x0e, 0x9b} } }; -static const __midl_frag365_t __midl_frag365 = +static const __midl_frag380_t __midl_frag380 = { -/* *_wireVARIANT */ - 0x22, /* FC64_OP */ +/* *struct _NDR64_POINTER_FORMAT */ + 0x24, /* FC64_IP */ (NDR64_UINT8) 0 /* 0x0 */, (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag12 -}; - -static const __midl_frag364_t __midl_frag364 = -{ -/* wireVARIANT */ - 0xa2, /* FC64_USER_MARSHAL */ - (NDR64_UINT8) 128 /* 0x80 */, - (NDR64_UINT16) 1 /* 0x1 */, - (NDR64_UINT16) 7 /* 0x7 */, - (NDR64_UINT16) 8 /* 0x8 */, - (NDR64_UINT32) 24 /* 0x18 */, - (NDR64_UINT32) 0 /* 0x0 */, - &__midl_frag365 + &__midl_frag381 }; -static const __midl_frag363_t __midl_frag363 = +static const __midl_frag379_t __midl_frag379 = { -/* *wireVARIANT */ +/* **struct _NDR64_POINTER_FORMAT */ 0x20, /* FC64_RP */ - (NDR64_UINT8) 4 /* 0x4 */, + (NDR64_UINT8) 16 /* 0x10 */, (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag364 + &__midl_frag380 }; -static const __midl_frag362_t __midl_frag362 = +static const __midl_frag375_t __midl_frag375 = { -/* get_Size */ +/* get_Item */ { - /* get_Size */ /* procedure get_Size */ - (NDR64_UINT32) 4849987 /* 0x4a0143 */, /* auto handle */ /* IsIntrepreted, [object], ServerMustSize, HasReturn, ClientCorrelation */ - (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ + /* get_Item */ /* procedure get_Item */ + (NDR64_UINT32) 36569411 /* 0x22e0143 */, /* auto handle */ /* IsIntrepreted, [object], ServerMustSize, ClientMustSize, HasReturn, ServerCorrelation, actual guaranteed */ + (NDR64_UINT32) 32 /* 0x20 */ , /* Stack size */ (NDR64_UINT32) 0 /* 0x0 */, (NDR64_UINT32) 8 /* 0x8 */, (NDR64_UINT16) 0 /* 0x0 */, (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 2 /* 0x2 */, + (NDR64_UINT16) 3 /* 0x3 */, (NDR64_UINT16) 0 /* 0x0 */ }, { - /* size */ /* parameter size */ - &__midl_frag364, + /* key */ /* parameter key */ + &__midl_frag549, { - /* size */ + /* key */ 1, 1, 0, - 0, 1, 0, 0, 0, + 0, 1, 0, 0, 0, 0, (NDR64_UINT16) 0 /* 0x0 */, - 1 - }, /* MustSize, MustFree, [out], SimpleRef, UseCache */ + 0 + }, /* MustSize, MustFree, [in], SimpleRef */ (NDR64_UINT16) 0 /* 0x0 */, 8 /* 0x8 */, /* Stack offset */ }, { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag546, + /* item */ /* parameter item */ + &__midl_frag379, { - /* HRESULT */ + /* item */ + 1, + 1, 0, 0, + 1, + 0, 0, 0, - 1, - 1, - 1, - 1, 0, 0, 0, @@ -8838,29 +7213,13 @@ static const __midl_frag362_t __midl_frag362 = 0, (NDR64_UINT16) 0 /* 0x0 */, 0 - }, /* [out], IsReturn, Basetype, ByValue */ + }, /* MustSize, MustFree, [out] */ (NDR64_UINT16) 0 /* 0x0 */, 16 /* 0x10 */, /* Stack offset */ - } -}; - -static const __midl_frag350_t __midl_frag350 = -{ -/* StoreSelection */ - { - /* StoreSelection */ /* procedure StoreSelection */ - (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ - (NDR64_UINT32) 16 /* 0x10 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 1 /* 0x1 */, - (NDR64_UINT16) 0 /* 0x0 */ }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -8880,36 +7239,48 @@ static const __midl_frag350_t __midl_frag350 = 0 }, /* [out], IsReturn, Basetype, ByValue */ (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ + 24 /* 0x18 */, /* Stack offset */ } }; -static const __midl_frag341_t __midl_frag341 = +static const __midl_frag369_t __midl_frag369 = +0xc /* FC64_FLOAT64 */; + +static const __midl_frag368_t __midl_frag368 = +{ +/* *DATE */ + 0x20, /* FC64_RP */ + (NDR64_UINT8) 12 /* 0xc */, + (NDR64_UINT16) 0 /* 0x0 */, + &__midl_frag369 +}; + +static const __midl_frag367_t __midl_frag367 = { -/* DeselectAll */ +/* get_DateLastModified */ { - /* DeselectAll */ /* procedure DeselectAll */ - (NDR64_UINT32) 2883907 /* 0x2c0143 */, /* auto handle */ /* IsIntrepreted, [object], ClientMustSize, HasReturn, ServerCorrelation */ + /* get_DateLastModified */ /* procedure get_DateLastModified */ + (NDR64_UINT32) 524611 /* 0x80143 */, /* auto handle */ /* IsIntrepreted, [object], HasReturn */ (NDR64_UINT32) 24 /* 0x18 */ , /* Stack size */ (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, + (NDR64_UINT32) 48 /* 0x30 */, (NDR64_UINT16) 0 /* 0x0 */, (NDR64_UINT16) 0 /* 0x0 */, (NDR64_UINT16) 2 /* 0x2 */, (NDR64_UINT16) 0 /* 0x0 */ }, { - /* save */ /* parameter save */ - &__midl_frag549, + /* date */ /* parameter date */ + &__midl_frag369, { - /* save */ - 1, - 1, + /* date */ 0, - 1, 0, 0, 0, + 1, + 0, + 1, 0, 1, 0, @@ -8917,14 +7288,14 @@ static const __midl_frag341_t __midl_frag341 = 0, 0, (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* MustSize, MustFree, [in], SimpleRef */ + 1 + }, /* [out], Basetype, SimpleRef, UseCache */ (NDR64_UINT16) 0 /* 0x0 */, 8 /* 0x8 */, /* Stack offset */ }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -9020,7 +7391,7 @@ static const __midl_frag334_t __midl_frag334 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -9044,38 +7415,6 @@ static const __midl_frag334_t __midl_frag334 = } }; -static const __midl_frag327_t __midl_frag327 = -{ -/* struct _NDR64_CONSTANT_IID_FORMAT */ - 0x24, /* FC64_IP */ - (NDR64_UINT8) 1 /* 0x1 */, - (NDR64_UINT16) 0 /* 0x0 */, - { - 0x8cd33727, - 0x0a92, - 0x4560, - {0x80, 0xd7, 0x1a, 0x44, 0x65, 0x12, 0x0e, 0x9b} - } -}; - -static const __midl_frag326_t __midl_frag326 = -{ -/* *struct _NDR64_POINTER_FORMAT */ - 0x24, /* FC64_IP */ - (NDR64_UINT8) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag327 -}; - -static const __midl_frag325_t __midl_frag325 = -{ -/* **struct _NDR64_POINTER_FORMAT */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 16 /* 0x10 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag326 -}; - static const __midl_frag324_t __midl_frag324 = { /* get_FocusedItem */ @@ -9092,7 +7431,7 @@ static const __midl_frag324_t __midl_frag324 = }, { /* item */ /* parameter item */ - &__midl_frag325, + &__midl_frag379, { /* item */ 1, @@ -9116,7 +7455,7 @@ static const __midl_frag324_t __midl_frag324 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -9228,7 +7567,7 @@ static const __midl_frag305_t __midl_frag305 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -9324,7 +7663,7 @@ static const __midl_frag300_t __midl_frag300 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -9388,7 +7727,7 @@ static const __midl_frag293_t __midl_frag293 = }, { /* val */ /* parameter val */ - &__midl_frag364, + &__midl_frag462, { /* val */ 1, @@ -9412,7 +7751,7 @@ static const __midl_frag293_t __midl_frag293 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -9500,7 +7839,7 @@ static const __midl_frag286_t __midl_frag286 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -9596,7 +7935,7 @@ static const __midl_frag281_t __midl_frag281 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -9684,7 +8023,7 @@ static const __midl_frag270_t __midl_frag270 = }, { /* buttons */ /* parameter buttons */ - &__midl_frag542, + &__midl_frag546, { /* buttons */ 0, @@ -9708,7 +8047,7 @@ static const __midl_frag270_t __midl_frag270 = }, { /* result */ /* parameter result */ - &__midl_frag542, + &__midl_frag546, { /* result */ 0, @@ -9732,7 +8071,7 @@ static const __midl_frag270_t __midl_frag270 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -9820,7 +8159,7 @@ static const __midl_frag257_t __midl_frag257 = }, { /* buttons */ /* parameter buttons */ - &__midl_frag542, + &__midl_frag546, { /* buttons */ 0, @@ -9868,7 +8207,7 @@ static const __midl_frag257_t __midl_frag257 = }, { /* result */ /* parameter result */ - &__midl_frag542, + &__midl_frag546, { /* result */ 0, @@ -9892,7 +8231,7 @@ static const __midl_frag257_t __midl_frag257 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -9980,7 +8319,7 @@ static const __midl_frag243_t __midl_frag243 = }, { /* buttons */ /* parameter buttons */ - &__midl_frag542, + &__midl_frag546, { /* buttons */ 0, @@ -10028,7 +8367,7 @@ static const __midl_frag243_t __midl_frag243 = }, { /* result */ /* parameter result */ - &__midl_frag542, + &__midl_frag546, { /* result */ 0, @@ -10052,7 +8391,7 @@ static const __midl_frag243_t __midl_frag243 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -10076,18 +8415,6 @@ static const __midl_frag243_t __midl_frag243 = } }; -static const __midl_frag239_t __midl_frag239 = -0x4 /* FC64_INT16 */; - -static const __midl_frag238_t __midl_frag238 = -{ -/* *VARIANT_BOOL */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 12 /* 0xc */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag239 -}; - static const __midl_frag233_t __midl_frag233 = { /* MatchesMask */ @@ -10152,7 +8479,7 @@ static const __midl_frag233_t __midl_frag233 = }, { /* match */ /* parameter match */ - &__midl_frag239, + &__midl_frag534, { /* match */ 0, @@ -10176,7 +8503,7 @@ static const __midl_frag233_t __midl_frag233 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -10200,94 +8527,6 @@ static const __midl_frag233_t __midl_frag233 = } }; -static const __midl_frag226_t __midl_frag226 = -{ -/* ViewFile */ - { - /* ViewFile */ /* procedure ViewFile */ - (NDR64_UINT32) 2883907 /* 0x2c0143 */, /* auto handle */ /* IsIntrepreted, [object], ClientMustSize, HasReturn, ServerCorrelation */ - (NDR64_UINT32) 32 /* 0x20 */ , /* Stack size */ - (NDR64_UINT32) 0 /* 0x0 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 3 /* 0x3 */, - (NDR64_UINT16) 0 /* 0x0 */ - }, - { - /* file */ /* parameter file */ - &__midl_frag526, - { - /* file */ - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* MustSize, MustFree, [in], ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 8 /* 0x8 */, /* Stack offset */ - }, - { - /* cache */ /* parameter cache */ - &__midl_frag549, - { - /* cache */ - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* MustSize, MustFree, [in], SimpleRef */ - (NDR64_UINT16) 0 /* 0x0 */, - 16 /* 0x10 */, /* Stack offset */ - }, - { - /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, - { - /* HRESULT */ - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - (NDR64_UINT16) 0 /* 0x0 */, - 0 - }, /* [out], IsReturn, Basetype, ByValue */ - (NDR64_UINT16) 0 /* 0x0 */, - 24 /* 0x18 */, /* Stack offset */ - } -}; - static const __midl_frag224_t __midl_frag224 = { /* struct _NDR64_CONSTANT_IID_FORMAT */ @@ -10360,7 +8599,7 @@ static const __midl_frag221_t __midl_frag221 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -10456,7 +8695,7 @@ static const __midl_frag216_t __midl_frag216 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -10592,7 +8831,7 @@ static const __midl_frag182_t __midl_frag182 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -10688,7 +8927,7 @@ static const __midl_frag173_t __midl_frag173 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -10712,44 +8951,13 @@ static const __midl_frag173_t __midl_frag173 = } }; -static const __midl_frag154_t __midl_frag154 = -{ -/* *_wireVARIANT */ - 0x21, /* FC64_UP */ - (NDR64_UINT8) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag12 -}; - -static const __midl_frag153_t __midl_frag153 = -{ -/* wireVARIANT */ - 0xa2, /* FC64_USER_MARSHAL */ - (NDR64_UINT8) 128 /* 0x80 */, - (NDR64_UINT16) 1 /* 0x1 */, - (NDR64_UINT16) 7 /* 0x7 */, - (NDR64_UINT16) 8 /* 0x8 */, - (NDR64_UINT32) 24 /* 0x18 */, - (NDR64_UINT32) 0 /* 0x0 */, - &__midl_frag154 -}; - -static const __midl_frag152_t __midl_frag152 = -{ -/* *wireVARIANT */ - 0x20, /* FC64_RP */ - (NDR64_UINT8) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag153 -}; - static const __midl_frag150_t __midl_frag150 = { /* *UINT */ 0x21, /* FC64_UP */ (NDR64_UINT8) 8 /* 0x8 */, (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag542 + &__midl_frag546 }; static const __midl_frag147_t __midl_frag147 = @@ -10817,28 +9025,13 @@ static const __midl_frag138_t __midl_frag138 = } }; -static const __midl_frag135_t __midl_frag135 = -0x7 /* FC64_INT64 */; - -static const __midl_frag132_t __midl_frag132 = -0x10 /* FC64_CHAR */; - -static const __midl_frag131_t __midl_frag131 = -{ -/* *_wireVARIANT */ - 0x21, /* FC64_UP */ - (NDR64_UINT8) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag12 -}; - static const __midl_frag130_t __midl_frag130 = { /* **_wireVARIANT */ 0x21, /* FC64_UP */ (NDR64_UINT8) 16 /* 0x10 */, (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag131 + &__midl_frag550 }; static const __midl_frag129_t __midl_frag129 = @@ -10900,45 +9093,13 @@ static const __midl_frag124_t __midl_frag124 = &__midl_frag125 }; -static const __midl_frag123_t __midl_frag123 = -{ -/* struct _NDR64_CONSTANT_IID_FORMAT */ - 0x24, /* FC64_IP */ - (NDR64_UINT8) 1 /* 0x1 */, - (NDR64_UINT16) 0 /* 0x0 */, - { - 0x00000000, - 0x0000, - 0x0000, - {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} - } -}; - -static const __midl_frag122_t __midl_frag122 = -{ -/* *struct _NDR64_POINTER_FORMAT */ - 0x24, /* FC64_IP */ - (NDR64_UINT8) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag123 -}; - static const __midl_frag121_t __midl_frag121 = { /* **struct _NDR64_POINTER_FORMAT */ 0x21, /* FC64_UP */ (NDR64_UINT8) 16 /* 0x10 */, (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag122 -}; - -static const __midl_frag120_t __midl_frag120 = -{ -/* *FLAGGED_WORD_BLOB */ - 0x21, /* FC64_UP */ - (NDR64_UINT8) 0 /* 0x0 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag5 + &__midl_frag389 }; static const __midl_frag119_t __midl_frag119 = @@ -10947,19 +9108,16 @@ static const __midl_frag119_t __midl_frag119 = 0x21, /* FC64_UP */ (NDR64_UINT8) 16 /* 0x10 */, (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag120 + &__midl_frag527 }; -static const __midl_frag118_t __midl_frag118 = -0xc /* FC64_FLOAT64 */; - static const __midl_frag117_t __midl_frag117 = { /* *DATE */ 0x21, /* FC64_UP */ (NDR64_UINT8) 8 /* 0x8 */, (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag118 + &__midl_frag369 }; static const __midl_frag116_t __midl_frag116 = @@ -10971,24 +9129,6 @@ static const __midl_frag116_t __midl_frag116 = &__midl_frag23 }; -static const __midl_frag114_t __midl_frag114 = -{ -/* *SCODE */ - 0x21, /* FC64_UP */ - (NDR64_UINT8) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag542 -}; - -static const __midl_frag112_t __midl_frag112 = -{ -/* *VARIANT_BOOL */ - 0x21, /* FC64_UP */ - (NDR64_UINT8) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag534 -}; - static const __midl_frag109_t __midl_frag109 = 0xb /* FC64_FLOAT32 */; @@ -11001,15 +9141,6 @@ static const __midl_frag108_t __midl_frag108 = &__midl_frag109 }; -static const __midl_frag106_t __midl_frag106 = -{ -/* *LONGLONG */ - 0x21, /* FC64_UP */ - (NDR64_UINT8) 8 /* 0x8 */, - (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag135 -}; - static const __midl_frag101_t __midl_frag101 = 0x2 /* FC64_INT8 */; @@ -11043,9 +9174,6 @@ static const __midl_frag98_t __midl_frag98 = } }; -static const __midl_frag97_t __midl_frag97 = -0x7 /* FC64_INT64 */; - static const __midl_frag96_t __midl_frag96 = { /* */ @@ -11084,7 +9212,7 @@ static const __midl_frag95_t __midl_frag95 = { /* struct _NDR64_ARRAY_ELEMENT_INFO */ (NDR64_UINT32) 8 /* 0x8 */, - &__midl_frag97 + &__midl_frag147 } }; @@ -11157,9 +9285,6 @@ static const __midl_frag93_t __midl_frag93 = } }; -static const __midl_frag92_t __midl_frag92 = -0x5 /* FC64_INT32 */; - static const __midl_frag90_t __midl_frag90 = { /* *ULONG */ @@ -11185,7 +9310,7 @@ static const __midl_frag90_t __midl_frag90 = { /* struct _NDR64_ARRAY_ELEMENT_INFO */ (NDR64_UINT32) 4 /* 0x4 */, - &__midl_frag92 + &__midl_frag546 } }; @@ -11258,9 +9383,6 @@ static const __midl_frag88_t __midl_frag88 = } }; -static const __midl_frag87_t __midl_frag87 = -0x4 /* FC64_INT16 */; - static const __midl_frag85_t __midl_frag85 = { /* *short */ @@ -11286,7 +9408,7 @@ static const __midl_frag85_t __midl_frag85 = { /* struct _NDR64_ARRAY_ELEMENT_INFO */ (NDR64_UINT32) 2 /* 0x2 */, - &__midl_frag87 + &__midl_frag534 } }; @@ -11359,9 +9481,6 @@ static const __midl_frag83_t __midl_frag83 = } }; -static const __midl_frag82_t __midl_frag82 = -0x2 /* FC64_INT8 */; - static const __midl_frag80_t __midl_frag80 = { /* *byte */ @@ -11387,7 +9506,7 @@ static const __midl_frag80_t __midl_frag80 = { /* struct _NDR64_ARRAY_ELEMENT_INFO */ (NDR64_UINT32) 1 /* 0x1 */, - &__midl_frag82 + &__midl_frag101 } }; @@ -11483,6 +9602,19 @@ static const __midl_frag77_t __midl_frag77 = } }; +static const __midl_frag73_t __midl_frag73 = +{ +/* */ + (NDR64_UINT32) 1 /* 0x1 */, + { + /* struct _NDR64_EXPR_VAR */ + 0x3, /* FC_EXPR_VAR */ + 0x6, /* FC64_UINT32 */ + (NDR64_UINT16) 0 /* 0x0 */, + (NDR64_UINT32) 0 /* 0x0 */ + } +}; + static const __midl_frag72_t __midl_frag72 = { /* ** */ @@ -11503,7 +9635,7 @@ static const __midl_frag72_t __midl_frag72 = }, (NDR64_UINT8) 0 /* 0x0 */, (NDR64_UINT32) 8 /* 0x8 */, - &__midl_frag96 + &__midl_frag73 }, { /* */ @@ -11532,7 +9664,7 @@ static const __midl_frag72_t __midl_frag72 = 0x24, /* FC64_IP */ (NDR64_UINT8) 0 /* 0x0 */, (NDR64_UINT16) 0 /* 0x0 */, - &__midl_frag123 + &__midl_frag390 } }, 0x93 /* FC64_END */ @@ -11540,7 +9672,7 @@ static const __midl_frag72_t __midl_frag72 = { /* struct _NDR64_ARRAY_ELEMENT_INFO */ (NDR64_UINT32) 8 /* 0x8 */, - &__midl_frag122 + &__midl_frag389 } }; @@ -11782,7 +9914,7 @@ static const __midl_frag62_t __midl_frag62 = }, (NDR64_UINT8) 0 /* 0x0 */, (NDR64_UINT32) 8 /* 0x8 */, - &__midl_frag96 + &__midl_frag73 }, { /* */ @@ -11912,7 +10044,7 @@ static const __midl_frag57_t __midl_frag57 = }, (NDR64_UINT8) 0 /* 0x0 */, (NDR64_UINT32) 8 /* 0x8 */, - &__midl_frag96 + &__midl_frag73 }, { /* */ @@ -11949,7 +10081,7 @@ static const __midl_frag57_t __midl_frag57 = { /* struct _NDR64_ARRAY_ELEMENT_INFO */ (NDR64_UINT32) 8 /* 0x8 */, - &__midl_frag154 + &__midl_frag550 } }; @@ -12022,6 +10154,19 @@ static const __midl_frag55_t __midl_frag55 = } }; +static const __midl_frag51_t __midl_frag51 = +{ +/* */ + (NDR64_UINT32) 1 /* 0x1 */, + { + /* struct _NDR64_EXPR_VAR */ + 0x3, /* FC_EXPR_VAR */ + 0x6, /* FC64_UINT32 */ + (NDR64_UINT16) 0 /* 0x0 */, + (NDR64_UINT32) 0 /* 0x0 */ + } +}; + static const __midl_frag50_t __midl_frag50 = { /* ** */ @@ -12042,7 +10187,7 @@ static const __midl_frag50_t __midl_frag50 = }, (NDR64_UINT8) 0 /* 0x0 */, (NDR64_UINT32) 8 /* 0x8 */, - &__midl_frag96 + &__midl_frag51 }, { /* */ @@ -12140,6 +10285,92 @@ static const __midl_frag49_t __midl_frag49 = } }; +static const __midl_frag48_t __midl_frag48 = +{ +/* */ + { + /* **struct _NDR64_POINTER_FORMAT */ + 0x20, /* FC64_RP */ + (NDR64_UINT8) 0 /* 0x0 */, + (NDR64_UINT16) 0 /* 0x0 */, + &__midl_frag43 + } +}; + +static const __midl_frag44_t __midl_frag44 = +{ +/* */ + (NDR64_UINT32) 1 /* 0x1 */, + { + /* struct _NDR64_EXPR_VAR */ + 0x3, /* FC_EXPR_VAR */ + 0x6, /* FC64_UINT32 */ + (NDR64_UINT16) 0 /* 0x0 */, + (NDR64_UINT32) 0 /* 0x0 */ + } +}; + +static const __midl_frag43_t __midl_frag43 = +{ +/* ** */ + { + /* **struct _NDR64_CONF_ARRAY_HEADER_FORMAT */ + 0x41, /* FC64_CONF_ARRAY */ + (NDR64_UINT8) 7 /* 0x7 */, + { + /* **struct _NDR64_CONF_ARRAY_HEADER_FORMAT */ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + }, + (NDR64_UINT8) 0 /* 0x0 */, + (NDR64_UINT32) 8 /* 0x8 */, + &__midl_frag44 + }, + { + /* */ + { + /* struct _NDR64_REPEAT_FORMAT */ + 0x82, /* FC64_VARIABLE_REPEAT */ + { + /* struct _NDR64_REPEAT_FORMAT */ + (NDR64_UINT8) 0 /* 0x0 */, + (NDR64_UINT8) 0 /* 0x0 */ + }, + (NDR64_UINT16) 0 /* 0x0 */, + (NDR64_UINT32) 8 /* 0x8 */, + (NDR64_UINT32) 0 /* 0x0 */, + (NDR64_UINT32) 1 /* 0x1 */ + }, + { + /* */ + { + /* struct _NDR64_POINTER_INSTANCE_HEADER_FORMAT */ + (NDR64_UINT32) 0 /* 0x0 */, + (NDR64_UINT32) 0 /* 0x0 */ + }, + { + /* *struct _NDR64_POINTER_FORMAT */ + 0x24, /* FC64_IP */ + (NDR64_UINT8) 0 /* 0x0 */, + (NDR64_UINT16) 0 /* 0x0 */, + &__midl_frag390 + } + }, + 0x93 /* FC64_END */ + }, + { + /* struct _NDR64_ARRAY_ELEMENT_INFO */ + (NDR64_UINT32) 8 /* 0x8 */, + &__midl_frag389 + } +}; + static const __midl_frag42_t __midl_frag42 = { /* SAFEARR_UNKNOWN */ @@ -12162,7 +10393,7 @@ static const __midl_frag42_t __midl_frag42 = (NDR64_UINT32) 16 /* 0x10 */, 0, 0, - &__midl_frag77, + &__midl_frag48, }, { /* */ @@ -12229,7 +10460,7 @@ static const __midl_frag38_t __midl_frag38 = }, (NDR64_UINT8) 0 /* 0x0 */, (NDR64_UINT32) 8 /* 0x8 */, - &__midl_frag96 + &__midl_frag44 }, { /* */ @@ -12266,7 +10497,7 @@ static const __midl_frag38_t __midl_frag38 = { /* struct _NDR64_ARRAY_ELEMENT_INFO */ (NDR64_UINT32) 8 /* 0x8 */, - &__midl_frag120 + &__midl_frag527 } }; @@ -12598,7 +10829,7 @@ static const __midl_frag13_t __midl_frag13 = { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 3 /* 0x3 */, - &__midl_frag542, + &__midl_frag546, (NDR64_UINT32) 0 /* 0x0 */ }, { @@ -12622,7 +10853,7 @@ static const __midl_frag13_t __midl_frag13 = { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 5 /* 0x5 */, - &__midl_frag118, + &__midl_frag369, (NDR64_UINT32) 0 /* 0x0 */ }, { @@ -12634,7 +10865,7 @@ static const __midl_frag13_t __midl_frag13 = { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 10 /* 0xa */, - &__midl_frag542, + &__midl_frag546, (NDR64_UINT32) 0 /* 0x0 */ }, { @@ -12646,19 +10877,19 @@ static const __midl_frag13_t __midl_frag13 = { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 7 /* 0x7 */, - &__midl_frag118, + &__midl_frag369, (NDR64_UINT32) 0 /* 0x0 */ }, { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 8 /* 0x8 */, - &__midl_frag120, + &__midl_frag527, (NDR64_UINT32) 0 /* 0x0 */ }, { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 13 /* 0xd */, - &__midl_frag122, + &__midl_frag389, (NDR64_UINT32) 0 /* 0x0 */ }, { @@ -12694,19 +10925,19 @@ static const __midl_frag13_t __midl_frag13 = { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 16386 /* 0x4002 */, - &__midl_frag112, + &__midl_frag142, (NDR64_UINT32) 0 /* 0x0 */ }, { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 16387 /* 0x4003 */, - &__midl_frag114, + &__midl_frag150, (NDR64_UINT32) 0 /* 0x0 */ }, { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 16404 /* 0x4014 */, - &__midl_frag106, + &__midl_frag146, (NDR64_UINT32) 0 /* 0x0 */ }, { @@ -12724,13 +10955,13 @@ static const __midl_frag13_t __midl_frag13 = { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 16395 /* 0x400b */, - &__midl_frag112, + &__midl_frag142, (NDR64_UINT32) 0 /* 0x0 */ }, { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 16394 /* 0x400a */, - &__midl_frag114, + &__midl_frag150, (NDR64_UINT32) 0 /* 0x0 */ }, { @@ -12778,7 +11009,7 @@ static const __midl_frag13_t __midl_frag13 = { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 16 /* 0x10 */, - &__midl_frag132, + &__midl_frag141, (NDR64_UINT32) 0 /* 0x0 */ }, { @@ -12790,25 +11021,25 @@ static const __midl_frag13_t __midl_frag13 = { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 19 /* 0x13 */, - &__midl_frag542, + &__midl_frag546, (NDR64_UINT32) 0 /* 0x0 */ }, { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 21 /* 0x15 */, - &__midl_frag135, + &__midl_frag147, (NDR64_UINT32) 0 /* 0x0 */ }, { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 22 /* 0x16 */, - &__midl_frag542, + &__midl_frag546, (NDR64_UINT32) 0 /* 0x0 */ }, { /* struct _NDR64_UNION_ARM */ (NDR64_INT64) 23 /* 0x17 */, - &__midl_frag542, + &__midl_frag546, (NDR64_UINT32) 0 /* 0x0 */ }, { @@ -12924,6 +11155,19 @@ static const __midl_frag12_t __midl_frag12 = } }; +static const __midl_frag7_t __midl_frag7 = +{ +/* */ + (NDR64_UINT32) 1 /* 0x1 */, + { + /* struct _NDR64_EXPR_VAR */ + 0x3, /* FC_EXPR_VAR */ + 0x6, /* FC64_UINT32 */ + (NDR64_UINT16) 0 /* 0x0 */, + (NDR64_UINT32) 4 /* 0x4 */ + } +}; + static const __midl_frag6_t __midl_frag6 = { /* */ @@ -12944,7 +11188,7 @@ static const __midl_frag6_t __midl_frag6 = }, (NDR64_UINT8) 0 /* 0x0 */, (NDR64_UINT32) 2 /* 0x2 */, - &__midl_frag67 + &__midl_frag7 }, { /* struct _NDR64_ARRAY_ELEMENT_INFO */ @@ -12977,19 +11221,6 @@ static const __midl_frag5_t __midl_frag5 = } }; -static const __midl_frag3_t __midl_frag3 = -{ -/* wireBSTR */ - 0xa2, /* FC64_USER_MARSHAL */ - (NDR64_UINT8) 128 /* 0x80 */, - (NDR64_UINT16) 0 /* 0x0 */, - (NDR64_UINT16) 7 /* 0x7 */, - (NDR64_UINT16) 8 /* 0x8 */, - (NDR64_UINT32) 8 /* 0x8 */, - (NDR64_UINT32) 0 /* 0x0 */, - &__midl_frag120 -}; - static const __midl_frag2_t __midl_frag2 = { /* MsgBox */ @@ -13006,7 +11237,7 @@ static const __midl_frag2_t __midl_frag2 = }, { /* prompt */ /* parameter prompt */ - &__midl_frag3, + &__midl_frag526, { /* prompt */ 1, @@ -13030,7 +11261,7 @@ static const __midl_frag2_t __midl_frag2 = }, { /* buttons */ /* parameter buttons */ - &__midl_frag153, + &__midl_frag549, { /* buttons */ 1, @@ -13054,7 +11285,7 @@ static const __midl_frag2_t __midl_frag2 = }, { /* title */ /* parameter title */ - &__midl_frag153, + &__midl_frag549, { /* title */ 1, @@ -13078,7 +11309,7 @@ static const __midl_frag2_t __midl_frag2 = }, { /* result */ /* parameter result */ - &__midl_frag542, + &__midl_frag546, { /* result */ 0, @@ -13102,7 +11333,7 @@ static const __midl_frag2_t __midl_frag2 = }, { /* HRESULT */ /* parameter HRESULT */ - &__midl_frag542, + &__midl_frag546, { /* HRESULT */ 0, @@ -13182,19 +11413,19 @@ static const FormatInfoRef ISalamander_Ndr64ProcTable[] = &__midl_frag173, &__midl_frag173, &__midl_frag173, - &__midl_frag536, + &__midl_frag543, &__midl_frag182, - &__midl_frag536, - &__midl_frag536, + &__midl_frag543, + &__midl_frag543, &__midl_frag540, - &__midl_frag350, + &__midl_frag472, &__midl_frag525, &__midl_frag525, &__midl_frag216, &__midl_frag221, - &__midl_frag226, + &__midl_frag286, &__midl_frag233, - &__midl_frag350, + &__midl_frag472, &__midl_frag243, &__midl_frag257, &__midl_frag270, @@ -13309,10 +11540,10 @@ static const FormatInfoRef ISalamanderPanel_Ndr64ProcTable[] = &__midl_frag324, &__midl_frag334, &__midl_frag334, - &__midl_frag350, - &__midl_frag341, - &__midl_frag536, - &__midl_frag350, + &__midl_frag472, + &__midl_frag465, + &__midl_frag543, + &__midl_frag472, (FormatInfoRef)(LONG_PTR) -1 }; @@ -13399,11 +11630,11 @@ const CInterfaceStubVtbl _ISalamanderPanelStubVtbl = #pragma code_seg(".orpc") static const FormatInfoRef ISalamanderPanelItem_Ndr64ProcTable[] = { - &__midl_frag510, &__midl_frag520, - &__midl_frag362, + &__midl_frag520, + &__midl_frag460, &__midl_frag367, - &__midl_frag383 + &__midl_frag543 }; @@ -13485,7 +11716,7 @@ const CInterfaceStubVtbl _ISalamanderPanelItemStubVtbl = static const FormatInfoRef ISalamanderPanelItemCollection_Ndr64ProcTable[] = { &__midl_frag375, - &__midl_frag383, + &__midl_frag543, &__midl_frag387 }; @@ -13565,22 +11796,22 @@ const CInterfaceStubVtbl _ISalamanderPanelItemCollectionStubVtbl = #pragma code_seg(".orpc") static const FormatInfoRef ISalamanderProgressDialog_Ndr64ProcTable[] = { - &__midl_frag394, - &__midl_frag394, - &__midl_frag396, - &__midl_frag405, - &__midl_frag405, - &__midl_frag409, - &__midl_frag423, - &__midl_frag428, - &__midl_frag423, - &__midl_frag428, - &__midl_frag447, - &__midl_frag436, - &__midl_frag440, - &__midl_frag443, - &__midl_frag447, - &__midl_frag450, + &__midl_frag472, + &__midl_frag472, + &__midl_frag520, + &__midl_frag525, + &__midl_frag525, + &__midl_frag529, + &__midl_frag460, + &__midl_frag465, + &__midl_frag460, + &__midl_frag465, + &__midl_frag540, + &__midl_frag529, + &__midl_frag533, + &__midl_frag543, + &__midl_frag540, + &__midl_frag460, &__midl_frag465, &__midl_frag460, &__midl_frag465 @@ -13680,12 +11911,12 @@ static const FormatInfoRef ISalamanderWaitWindow_Ndr64ProcTable[] = { &__midl_frag472, &__midl_frag472, - &__midl_frag483, - &__midl_frag488, - &__midl_frag483, - &__midl_frag488, + &__midl_frag520, + &__midl_frag525, + &__midl_frag520, + &__midl_frag525, &__midl_frag529, - &__midl_frag536, + &__midl_frag543, &__midl_frag540, &__midl_frag529, &__midl_frag533 @@ -13775,7 +12006,7 @@ const CInterfaceStubVtbl _ISalamanderWaitWindowStubVtbl = #pragma code_seg(".orpc") static const FormatInfoRef ISalamanderScriptInfo_Ndr64ProcTable[] = { - &__midl_frag510, + &__midl_frag520, &__midl_frag520 }; @@ -14026,7 +12257,7 @@ static const FormatInfoRef ISalamanderGuiButton_Ndr64ProcTable[] = { &__midl_frag520, &__midl_frag525, - &__midl_frag536, + &__midl_frag543, &__midl_frag540 }; diff --git a/src/safefile.cpp b/src/safefile.cpp index 0ae36a23..d0171c00 100644 --- a/src/safefile.cpp +++ b/src/safefile.cpp @@ -167,57 +167,64 @@ CSalamanderSafeFile::SafeFileCreate(const char* fileName, { // rename ("clean up") the file/directory with the conflicting DOS name to a temporary 8.3 name (which doesn’t require an extra DOS name) char tmpName[MAX_PATH + 20]; - char origFullName[MAX_PATH]; - lstrcpyn(tmpName, fileName, MAX_PATH); - CutDirectory(tmpName); - SalPathAddBackslash(tmpName, MAX_PATH + 20); - char* tmpNamePart = tmpName + strlen(tmpName); - if (SalPathAppend(tmpName, data.cFileName, MAX_PATH)) + char origFullName[MAX_PATH + 20]; + if (strlen(fileName) >= _countof(tmpName)) { - strcpy(origFullName, tmpName); - DWORD num = (GetTickCount() / 10) % 0xFFF; - while (1) + TRACE_E("SafeFileCreate: name too long for DOS-name collision workaround: " << fileName); + } + else + { + lstrcpyn(tmpName, fileName, _countof(tmpName)); + CutDirectory(tmpName); + SalPathAddBackslash(tmpName, _countof(tmpName)); + char* tmpNamePart = tmpName + strlen(tmpName); + if (SalPathAppend(tmpName, data.cFileName, _countof(tmpName))) { - sprintf(tmpNamePart, "sal%03X", num++); - if (::SalMoveFile(origFullName, tmpName)) - break; - DWORD e = GetLastError(); - if (e != ERROR_FILE_EXISTS && e != ERROR_ALREADY_EXISTS) + strcpy(origFullName, tmpName); + DWORD num = (GetTickCount() / 10) % 0xFFF; + while (1) { - tmpName[0] = 0; - break; + sprintf(tmpNamePart, "sal%03X", num++); + if (::SalMoveFile(origFullName, tmpName)) + break; + DWORD e = GetLastError(); + if (e != ERROR_FILE_EXISTS && e != ERROR_ALREADY_EXISTS) + { + tmpName[0] = 0; + break; + } } - } - if (tmpName[0] != 0) // if we managed to "clean up" the conflicting file/directory, try creating the target - { // file/directory and then restore the original name to the "cleaned" file/directory - hFile = INVALID_HANDLE_VALUE; - // if (!isDir) // file - // { // add the handle to HANDLES at the end only if the SAFE_FILE structure is being filled - hFile = NOHANDLES(CreateFileUtf8(fileName, dwDesiredAccess, dwShareMode, NULL, - CREATE_NEW, dwFlagsAndAttributes, NULL)); - // } - // else // directory - // { - // if (CreateDirectory(fileName, NULL)) out = (void *)1; // on success we must return something other than INVALID_HANDLE_VALUE - // } - if (!::SalMoveFile(tmpName, origFullName)) - { // this can apparently happen; inexplicably, Windows creates a file named origFullName instead of 'fileName' (the DOS name) - TRACE_I("Unexpected situation in CSalamanderGeneral::SafeCreateFile(): unable to rename file from tmp-name to original long file name! " << origFullName); + if (tmpName[0] != 0) // if we managed to "clean up" the conflicting file/directory, try creating the target + { // file/directory and then restore the original name to the "cleaned" file/directory + hFile = INVALID_HANDLE_VALUE; + // if (!isDir) // file + // { // add the handle to HANDLES at the end only if the SAFE_FILE structure is being filled + hFile = NOHANDLES(CreateFileUtf8(fileName, dwDesiredAccess, dwShareMode, NULL, + CREATE_NEW, dwFlagsAndAttributes, NULL)); + // } + // else // directory + // { + // if (CreateDirectory(fileName, NULL)) out = (void *)1; // on success we must return something other than INVALID_HANDLE_VALUE + // } + if (!::SalMoveFile(tmpName, origFullName)) + { // this can apparently happen; inexplicably, Windows creates a file named origFullName instead of 'fileName' (the DOS name) + TRACE_I("Unexpected situation in CSalamanderGeneral::SafeCreateFile(): unable to rename file from tmp-name to original long file name! " << origFullName); - if (hFile != INVALID_HANDLE_VALUE) - { - // if (!isDir) - CloseHandle(hFile); - hFile = INVALID_HANDLE_VALUE; - // if (!isDir) - DeleteFileUtf8(fileName); - // else RemoveDirectory(fileName); - if (!::SalMoveFile(tmpName, origFullName)) - TRACE_E("Fatal unexpected situation in CSalamanderGeneral::SafeCreateFile(): unable to rename file from tmp-name to original long file name! " << origFullName); + if (hFile != INVALID_HANDLE_VALUE) + { + // if (!isDir) + CloseHandle(hFile); + hFile = INVALID_HANDLE_VALUE; + // if (!isDir) + DeleteFileUtf8(fileName); + // else RemoveDirectory(fileName); + if (!::SalMoveFile(tmpName, origFullName)) + TRACE_E("Fatal unexpected situation in CSalamanderGeneral::SafeCreateFile(): unable to rename file from tmp-name to original long file name! " << origFullName); + } } + if (hFile != INVALID_HANDLE_VALUE) + goto SUCCESS; // return only on success; errors are handled later (ignore the DOS-name conflict) } - if (hFile != INVALID_HANDLE_VALUE) - goto SUCCESS; // return only on success; errors are handled later (ignore the DOS-name conflict) } } } @@ -310,7 +317,7 @@ CSalamanderSafeFile::SafeFileCreate(const char* fileName, HANDLES(CloseHandle(file2)); } else - strcpy(fibuffer, LoadStr(IDS_ERR_FILEOPEN)); + lstrcpyn(fibuffer, LoadStr(IDS_ERR_FILEOPEN), _countof(fibuffer)); if (srcFileName != NULL) { // CONFIRM FILE OVERWRITE: filename1+filedata1+filename2+filedata2, buttons yes/all/skip/skip all/cancel diff --git a/src/salamdr1.cpp b/src/salamdr1.cpp index 2e3ff7ad..0818bd1d 100644 --- a/src/salamdr1.cpp +++ b/src/salamdr1.cpp @@ -1481,8 +1481,13 @@ BOOL CutDirectory(char* path, char** cutDir) // **************************************************************************** -int GetRootPath(char* root, const char* path) +int GetRootPath(char* root, int rootBufSize, const char* path) { // POZOR: netypicke pouziti z GetShellFolder(): pro "\\\\" vraci "\\\\\\", pro "\\\\server" vraci "\\\\server\\" + if (root == NULL || path == NULL || rootBufSize <= 0) + return 0; + + root[0] = 0; + if (path[0] == '\\' && path[1] == '\\') // UNC { const char* s = path + 2; @@ -1493,8 +1498,10 @@ int GetRootPath(char* root, const char* path) while (*s != 0 && *s != '\\') s++; int len = (int)(s - path); - if (len > MAX_PATH - 2) - len = MAX_PATH - 2; // aby se to veslo i s '\\' do MAX_PATH bufferu (ocekavana velikost), orez neva, 100% je to beztak chyba + if (len > rootBufSize - 2) + len = rootBufSize - 2; + if (len < 0) + return 0; memcpy(root, path, len); root[len] = '\\'; root[len + 1] = 0; @@ -1502,6 +1509,8 @@ int GetRootPath(char* root, const char* path) } else { + if (rootBufSize < 4) + return 0; root[0] = path[0]; root[1] = ':'; root[2] = '\\'; @@ -1510,6 +1519,11 @@ int GetRootPath(char* root, const char* path) } } +int GetRootPath(char* root, const char* path) +{ + return GetRootPath(root, MAX_PATH, path); +} + // **************************************************************************** // projede vsechny barvy z konfigurace a pokud maji nastavenu default hodnotu, @@ -3370,7 +3384,7 @@ BOOL ParseCommandLineParameters(LPSTR cmdLine, CCommandLineParams* cmdLineParams *(strrchr(ConfigurationName, '\\') + 1) = 0; const char* configReg = "config.reg"; strcat(ConfigurationName, configReg); - if (!FileExists(ConfigurationName) && GetOurPathInRoamingAPPDATA(curDir) && + if (!FileExists(ConfigurationName) && GetOurPathInRoamingAPPDATA(curDir, _countof(curDir)) && SalPathAppend(curDir, configReg, MAX_PATH) && FileExists(curDir)) { // pokud neexistuje soubor config.reg u .exe, hledame ho jeste v APPDATA lstrcpyn(ConfigurationName, curDir, MAX_PATH); @@ -3437,7 +3451,7 @@ BOOL ParseCommandLineParameters(LPSTR cmdLine, CCommandLineParams* cmdLineParams GetModuleFileName(HInstance, ConfigurationName, MAX_PATH); *(strrchr(ConfigurationName, '\\') + 1) = 0; SalPathAppend(ConfigurationName, s, MAX_PATH); - if (!FileExists(ConfigurationName) && GetOurPathInRoamingAPPDATA(curDir) && + if (!FileExists(ConfigurationName) && GetOurPathInRoamingAPPDATA(curDir, _countof(curDir)) && SalPathAppend(curDir, s, MAX_PATH) && FileExists(curDir)) { // pokud neexistuje relativne zadany soubor za -C u .exe, hledame ho jeste v APPDATA lstrcpyn(ConfigurationName, curDir, MAX_PATH); diff --git a/src/salamdr2.cpp b/src/salamdr2.cpp index f3addcd2..cc3c7509 100644 --- a/src/salamdr2.cpp +++ b/src/salamdr2.cpp @@ -1190,7 +1190,7 @@ void ResolveLocalPathWithReparsePoints(char* resPath, const char* path, BOOL* cu char repPointPath[MAX_PATH]; int allowedDepth = 50; BOOL firstRepPoint = TRUE; - while (GetCurrentLocalReparsePoint(resPath, repPointPath)) + while (GetCurrentLocalReparsePoint(resPath, repPointPath, _countof(repPointPath))) { if (rootOrCurReparsePointSet != NULL && !*rootOrCurReparsePointSet && rootOrCurReparsePoint != NULL) { @@ -1538,11 +1538,25 @@ BOOL GetReparsePointDestination(const char* repPointDir, char* repPointDstBuf, D return TRUE; } -BOOL GetCurrentLocalReparsePoint(const char* path, char* currentReparsePoint, BOOL* error) +BOOL GetCurrentLocalReparsePoint(const char* path, char* currentReparsePoint, int currentReparsePointBufSize, BOOL* error) { BOOL ret = TRUE; - lstrcpyn(currentReparsePoint, path, MAX_PATH); - if (!SalPathAddBackslash(currentReparsePoint, MAX_PATH)) + if (path == NULL || currentReparsePoint == NULL || currentReparsePointBufSize <= 0) + { + if (error != NULL) + *error = TRUE; + return FALSE; + } + + lstrcpyn(currentReparsePoint, path, currentReparsePointBufSize); + if ((int)strlen(path) >= currentReparsePointBufSize) + { + TRACE_E("GetCurrentLocalReparsePoint(): path does not fit in output buffer."); + if (error != NULL) + *error = TRUE; + ret = FALSE; + } + else if (!SalPathAddBackslash(currentReparsePoint, currentReparsePointBufSize)) { TRACE_E("GetCurrentLocalReparsePoint(): too long path"); if (error != NULL) @@ -1581,10 +1595,15 @@ BOOL GetCurrentLocalReparsePoint(const char* path, char* currentReparsePoint, BO ret = FALSE; // no reparse point found } if (!ret) - GetRootPath(currentReparsePoint, path); + GetRootPath(currentReparsePoint, currentReparsePointBufSize, path); return ret; } +BOOL GetCurrentLocalReparsePoint(const char* path, char* currentReparsePoint, BOOL* error) +{ + return GetCurrentLocalReparsePoint(path, currentReparsePoint, MAX_PATH, error); +} + UINT MyGetDriveType(const char* path) { char ourPath[MAX_PATH]; diff --git a/src/salamdr3.cpp b/src/salamdr3.cpp index 0a6acf6b..f0e2fd39 100644 --- a/src/salamdr3.cpp +++ b/src/salamdr3.cpp @@ -107,9 +107,10 @@ void SalPathRemoveExtension(char* path) } int len = (int)strlen(path); - char* iterator = path + len - 1; - while (iterator >= path) + char* iterator = path + len; + while (iterator > path) { + iterator--; if (*iterator == '.') { // if (iterator != path && *(iterator - 1) != '\\') // ".cvspass" in Windows is an extension ... @@ -118,7 +119,6 @@ void SalPathRemoveExtension(char* path) } if (*iterator == '\\') break; - iterator--; } } @@ -131,9 +131,10 @@ BOOL SalPathAddExtension(char* path, const char* extension, int pathSize) } int len = (int)strlen(path); - char* iterator = path + len - 1; - while (iterator >= path) + char* iterator = path + len; + while (iterator > path) { + iterator--; if (*iterator == '.') { // if (iterator != path && *(iterator - 1) != '\\') // ".cvspass" in Windows is an extension ... @@ -142,7 +143,6 @@ BOOL SalPathAddExtension(char* path, const char* extension, int pathSize) } if (*iterator == '\\') break; - iterator--; } int extLen = (int)strlen(extension); @@ -164,9 +164,10 @@ BOOL SalPathRenameExtension(char* path, const char* extension, int pathSize) } int len = (int)strlen(path); - char* iterator = path + len - 1; - while (iterator >= path) + char* iterator = path + len; + while (iterator > path) { + iterator--; if (*iterator == '.') { // if (iterator != path && *(iterator - 1) != '\\') // ".cvspass" in Windows is an extension ... @@ -178,7 +179,6 @@ BOOL SalPathRenameExtension(char* path, const char* extension, int pathSize) } if (*iterator == '\\') break; - iterator--; } int extLen = (int)strlen(extension); @@ -196,24 +196,32 @@ const char* SalPathFindFileName(const char* path) if (path == NULL) { TRACE_E("Unexpected situation in SalPathFindFileName()"); - return NULL; + return ""; } int len = (int)strlen(path); - const char* iterator = path + len - 2; - while (iterator >= path) + if (len <= 1) + return path; + const char* iterator = path + len - 1; + while (iterator > path) { + iterator--; if (*iterator == '\\') return iterator + 1; - iterator--; } return path; } // **************************************************************************** -BOOL SalGetTempFileName(const char* path, const char* prefix, char* tmpName, BOOL file) +BOOL SalGetTempFileName(const char* path, const char* prefix, char* tmpName, int tmpNameLen, BOOL file) { + if (tmpName == NULL || tmpNameLen <= 0) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + WCHAR tmpDirW[MAX_PATH + 10]; WCHAR* endW = tmpDirW + MAX_PATH + 10; if (path == NULL) @@ -248,7 +256,15 @@ BOOL SalGetTempFileName(const char* path, const char* prefix, char* tmpName, BOO WCHAR* sW = tmpDirW + lstrlenW(tmpDirW); if (sW > tmpDirW && *(sW - 1) != L'\\') + { + if (sW >= endW) + { + TRACE_E("Too long path in SalGetTempFileName()."); + SetLastError(ERROR_BUFFER_OVERFLOW); + return FALSE; + } *sW++ = L'\\'; + } WCHAR prefixW[128]; prefixW[0] = 0; @@ -277,7 +293,7 @@ BOOL SalGetTempFileName(const char* path, const char* prefix, char* tmpName, BOO if (h != INVALID_HANDLE_VALUE) { HANDLES(CloseHandle(h)); - if (ConvertWideToUtf8(tmpDirW, -1, tmpName, MAX_PATH) == 0) + if (ConvertWideToUtf8(tmpDirW, -1, tmpName, tmpNameLen) == 0) { SetLastError(ERROR_NO_UNICODE_TRANSLATION); return FALSE; @@ -289,7 +305,7 @@ BOOL SalGetTempFileName(const char* path, const char* prefix, char* tmpName, BOO { if (CreateDirectoryW(tmpDirW, NULL)) { - if (ConvertWideToUtf8(tmpDirW, -1, tmpName, MAX_PATH) == 0) + if (ConvertWideToUtf8(tmpDirW, -1, tmpName, tmpNameLen) == 0) { SetLastError(ERROR_NO_UNICODE_TRANSLATION); return FALSE; @@ -574,7 +590,7 @@ BOOL SalGetFullName(char* name, int* errTextID, const char* curDir, char* nextFo while (*test != 0 && *test != '\\') test++; if (*test == 0 && (int)strlen(name) < MAX_PATH) - strcpy(nextFocus, name); + lstrcpyn(nextFocus, name, MAX_PATH); } int l2 = (int)strlen(curDir); @@ -997,11 +1013,15 @@ void _RemoveTemporaryDir(const char* dir) char path[MAX_PATH + 2]; WIN32_FIND_DATAW fileW; WIN32_FIND_DATA file; - strcpy(path, dir); + int dirLen = (int)strlen(dir); + if (dirLen <= 0 || dirLen >= MAX_PATH) + return; + lstrcpyn(path, dir, _countof(path)); char* end = path + strlen(path); if (*(end - 1) != '\\') *end++ = '\\'; - strcpy(end, "*"); + *end++ = '*'; + *end = 0; CStrP pathW(ConvertAllocUtf8ToWide(path, -1)); HANDLE find = pathW != NULL ? HANDLES_Q(FindFirstFileW(pathW, &fileW)) : INVALID_HANDLE_VALUE; if (find != INVALID_HANDLE_VALUE) @@ -1012,7 +1032,7 @@ void _RemoveTemporaryDir(const char* dir) if (file.cFileName[0] != 0 && strcmp(file.cFileName, "..") && strcmp(file.cFileName, ".") && (end - path) + strlen(file.cFileName) < MAX_PATH) { - strcpy(end, file.cFileName); + lstrcpyn(end, file.cFileName, (int)(_countof(path) - (end - path))); ClearReadOnlyAttr(path, file.dwFileAttributes); if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) _RemoveTemporaryDir(path); @@ -1061,11 +1081,15 @@ void _RemoveEmptyDirs(const char* dir) char path[MAX_PATH + 2]; WIN32_FIND_DATAW fileW; WIN32_FIND_DATA file; - strcpy(path, dir); + int dirLen = (int)strlen(dir); + if (dirLen <= 0 || dirLen >= MAX_PATH) + return; + lstrcpyn(path, dir, _countof(path)); char* end = path + strlen(path); if (*(end - 1) != '\\') *end++ = '\\'; - strcpy(end, "*"); + *end++ = '*'; + *end = 0; CStrP pathW(ConvertAllocUtf8ToWide(path, -1)); HANDLE find = pathW != NULL ? HANDLES_Q(FindFirstFileW(pathW, &fileW)) : INVALID_HANDLE_VALUE; if (find != INVALID_HANDLE_VALUE) @@ -1078,7 +1102,7 @@ void _RemoveEmptyDirs(const char* dir) if ((file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (end - path) + strlen(file.cFileName) < MAX_PATH) { - strcpy(end, file.cFileName); + lstrcpyn(end, file.cFileName, (int)(_countof(path) - (end - path))); ClearReadOnlyAttr(path, file.dwFileAttributes); _RemoveEmptyDirs(path); } @@ -1144,7 +1168,7 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err GetRootPath(root, dir); if (dirLen <= (int)strlen(root)) // dir je root adresar { - sprintf(buf, LoadStr(IDS_CREATEDIRFAILED), dir); + _snprintf_s(buf, _countof(buf), _TRUNCATE, LoadStr(IDS_CREATEDIRFAILED), dir); if (errBuf != NULL) strncpy_s(errBuf, errBufSize, buf, _TRUNCATE); else @@ -1160,9 +1184,9 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err char title[100]; char text[MAX_PATH + 500]; char checkText[200]; - sprintf(title, LoadStr(IDS_QUESTION)); - sprintf(text, LoadStr(IDS_CREATEDIRECTORY), dir); - sprintf(checkText, LoadStr(IDS_DONTSHOWAGAINCD)); + lstrcpyn(title, LoadStr(IDS_QUESTION), _countof(title)); + _snprintf_s(text, _countof(text), _TRUNCATE, LoadStr(IDS_CREATEDIRECTORY), dir); + lstrcpyn(checkText, LoadStr(IDS_DONTSHOWAGAINCD), _countof(checkText)); BOOL dontShow = !Configuration.CnfrmCreateDir; MSGBOXEX_PARAMS params; @@ -1182,14 +1206,14 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err } if (quiet || msgBoxRet == IDOK) { - strcpy(name, dir); + lstrcpyn(name, dir, _countof(name)); char* s; while (1) // najdeme prvni existujici adresar { s = strrchr(name, '\\'); if (s == NULL) { - sprintf(buf, LoadStr(IDS_CREATEDIRFAILED), dir); + _snprintf_s(buf, _countof(buf), _TRUNCATE, LoadStr(IDS_CREATEDIRFAILED), dir); if (errBuf != NULL) strncpy_s(errBuf, errBufSize, buf, _TRUNCATE); else @@ -1200,7 +1224,7 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err *s = 0; else { - strcpy(name, root); + lstrcpyn(name, root, _countof(name)); break; // uz jsme na root-adresari } attrs = SalGetFileAttributes(name); @@ -1210,7 +1234,7 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err break; // budeme stavet od tohoto adresare else // je to soubor, to by neslo ... { - sprintf(buf, LoadStr(IDS_NAMEUSEDFORFILE), name); + _snprintf_s(buf, _countof(buf), _TRUNCATE, LoadStr(IDS_NAMEUSEDFORFILE), name); if (errBuf != NULL) strncpy_s(errBuf, errBufSize, buf, _TRUNCATE); else @@ -1257,7 +1281,7 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err if (invalidName || !CreateDirectoryUtf8(name, NULL)) { DWORD lastErr = invalidName ? ERROR_INVALID_NAME : GetLastError(); - sprintf(buf, LoadStr(IDS_CREATEDIRFAILED), name); + _snprintf_s(buf, _countof(buf), _TRUNCATE, LoadStr(IDS_CREATEDIRFAILED), name); if (errBuf != NULL) strncpy_s(errBuf, errBufSize, buf, _TRUNCATE); else @@ -1280,7 +1304,7 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err else { if (first && newDir != NULL) - strcpy(newDir, name); + lstrcpyn(newDir, name, MAX_PATH); first = FALSE; } name[len++] = '\\'; @@ -1296,7 +1320,7 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err return TRUE; else // soubor, to by neslo ... { - sprintf(buf, LoadStr(IDS_NAMEUSEDFORFILE), dir); + _snprintf_s(buf, _countof(buf), _TRUNCATE, LoadStr(IDS_NAMEUSEDFORFILE), dir); if (errBuf != NULL) strncpy_s(errBuf, errBufSize, buf, _TRUNCATE); else @@ -1583,7 +1607,7 @@ BOOL CPathHistoryItem::Execute(CFilesWindow* panel) { if (failReason == CHPPFR_SHORTERPATH || failReason == CHPPFR_FILENAMEFOCUSED) { - sprintf(errBuf, LoadStr(IDS_PATHINARCHIVENOTFOUND), ArchivePathOrFSUserPart); + _snprintf_s(errBuf, _countof(errBuf), _TRUNCATE, LoadStr(IDS_PATHINARCHIVENOTFOUND), ArchivePathOrFSUserPart); SalMessageBox(panel->HWindow, errBuf, LoadStr(IDS_ERRORCHANGINGDIR), MB_OK | MB_ICONEXCLAMATION); } @@ -2152,7 +2176,12 @@ void CPathHistory::SaveToRegistry(HKEY hKey, const char* name, BOOL onlyClear) { case 0: // disk { - strcpy(path, item->PathOrArchiveOrFSName); + if (strlen(item->PathOrArchiveOrFSName) >= _countof(path)) + { + TRACE_E("CPathHistory::SaveToRegistry(): path is too long, skipping."); + continue; + } + lstrcpyn(path, item->PathOrArchiveOrFSName, _countof(path)); break; } @@ -2161,7 +2190,12 @@ void CPathHistory::SaveToRegistry(HKEY hKey, const char* name, BOOL onlyClear) case 1: // archive case 2: // FS { - strcpy(path, item->PathOrArchiveOrFSName); + if (strlen(item->PathOrArchiveOrFSName) >= _countof(path)) + { + TRACE_E("CPathHistory::SaveToRegistry(): path is too long, skipping."); + continue; + } + lstrcpyn(path, item->PathOrArchiveOrFSName, _countof(path)); StrNCat(path, ":", 2 * MAX_PATH); if (item->ArchivePathOrFSUserPart != NULL) StrNCat(path, item->ArchivePathOrFSUserPart, 2 * MAX_PATH); @@ -2227,7 +2261,7 @@ void CPathHistory::LoadFromRegistry(HKEY hKey, const char* name) else { // kandidat na FS path - if (IsPluginFSPath(path, fsName, &archivePathOrFSUserPart)) + if (IsPluginFSPath(path, fsName, _countof(fsName), &archivePathOrFSUserPart)) { pathOrArchiveOrFSName = fsName; type = 2; @@ -2634,6 +2668,11 @@ CUserMenuItem::~CUserMenuItem() BOOL CUserMenuItem::Set(char* name, char* umCommand, char* arguments, char* initDir, char* icon) { + if (name == NULL || umCommand == NULL || arguments == NULL || initDir == NULL || icon == NULL) + { + TRACE_E("CUserMenuItem::Set(): unexpected NULL parameter."); + return FALSE; + } char* itemName = (char*)malloc(strlen(name) + 1); char* commandName = (char*)malloc(strlen(umCommand) + 1); char* argumentsName = (char*)malloc(strlen(arguments) + 1); @@ -2642,6 +2681,11 @@ BOOL CUserMenuItem::Set(char* name, char* umCommand, char* arguments, char* init if (itemName == NULL || commandName == NULL || argumentsName == NULL || initDirName == NULL || iconName == NULL) { + free(itemName); + free(commandName); + free(argumentsName); + free(initDirName); + free(iconName); TRACE_E(LOW_MEMORY); return FALSE; } @@ -3096,7 +3140,14 @@ BOOL CFileTimeStamps::AddFile(const char* zipFile, const char* zipRoot, const ch const FILETIME& lastWrite, const CQuadWord& fileSize, DWORD attr) { if (ZIPFile[0] == 0) - strcpy(ZIPFile, zipFile); + { + if (strlen(zipFile) >= _countof(ZIPFile)) + { + TRACE_E("CFileTimeStamps::AddFile(): ZIP file path is too long."); + return FALSE; + } + lstrcpyn(ZIPFile, zipFile, _countof(ZIPFile)); + } else { if (strcmp(zipFile, ZIPFile) != 0) @@ -3194,12 +3245,17 @@ void CFileTimeStamps::AddFilesToListBox(HWND list) for (i = 0; i < List.Count; i++) { char buf[MAX_PATH]; - strcpy(buf, List[i]->ZIPRoot); - SalPathAppend(buf, List[i]->FileName, MAX_PATH); - SendMessage(list, LB_ADDSTRING, 0, (LPARAM)buf); + lstrcpyn(buf, List[i]->ZIPRoot, _countof(buf)); + if (strlen(List[i]->ZIPRoot) < _countof(buf) && SalPathAppend(buf, List[i]->FileName, _countof(buf))) + SendMessage(list, LB_ADDSTRING, 0, (LPARAM)buf); } } +BOOL SalGetTempFileName(const char* path, const char* prefix, char* tmpName, BOOL file) +{ + return SalGetTempFileName(path, prefix, tmpName, MAX_PATH, file); +} + void CFileTimeStamps::Remove(int* indexes, int count) { int i; @@ -3265,13 +3321,15 @@ void CFileTimeStamps::CopyFilesTo(HWND parent, int* indexes, int count, const ch { CFileTimeStampsItem* item = List[index]; char name[MAX_PATH]; - strcpy(name, item->SourcePath); - tooLongName |= !SalPathAppend(name, item->FileName, MAX_PATH); + lstrcpyn(name, item->SourcePath, _countof(name)); + tooLongName |= strlen(item->SourcePath) >= _countof(name); + tooLongName |= !SalPathAppend(name, item->FileName, _countof(name)); ok &= fromStr.Add(name, (int)strlen(name) + 1); - strcpy(name, path); - tooLongName |= !SalPathAppend(name, item->ZIPRoot, MAX_PATH); - tooLongName |= !SalPathAppend(name, item->FileName, MAX_PATH); + lstrcpyn(name, path, _countof(name)); + tooLongName |= strlen(path) >= _countof(name); + tooLongName |= !SalPathAppend(name, item->ZIPRoot, _countof(name)); + tooLongName |= !SalPathAppend(name, item->FileName, _countof(name)); ok &= toStr.Add(name, (int)strlen(name) + 1); } } @@ -3322,10 +3380,16 @@ void CFileTimeStamps::CheckAndPackAndClear(HWND parent, BOOL* someFilesChanged, for (i = List.Count - 1; i >= 0; i--) { CFileTimeStampsItem* item = List[i]; - sprintf(buf, "%s\\%s", item->SourcePath, item->FileName); BOOL kill = TRUE; - CStrP bufW(ConvertAllocUtf8ToWide(buf, -1)); - HANDLE find = bufW != NULL ? HANDLES_Q(FindFirstFileW(bufW, &dataW)) : INVALID_HANDLE_VALUE; + lstrcpyn(buf, item->SourcePath, _countof(buf)); + if (strlen(item->SourcePath) >= _countof(buf) || !SalPathAppend(buf, item->FileName, _countof(buf))) + kill = FALSE; // keep the item, we cannot safely verify it with truncated path + HANDLE find = INVALID_HANDLE_VALUE; + if (kill) + { + CStrP bufW(ConvertAllocUtf8ToWide(buf, -1)); + find = bufW != NULL ? HANDLES_Q(FindFirstFileW(bufW, &dataW)) : INVALID_HANDLE_VALUE; + } if (find != INVALID_HANDLE_VALUE) { HANDLES(FindClose(find)); @@ -3435,6 +3499,12 @@ void CFileTimeStamps::CheckAndPackAndClear(HWND parent, BOOL* someFilesChanged, void CTopIndexMem::Push(const char* path, int topIndex) { + if (strlen(path) >= _countof(Path)) + { + TRACE_E("CTopIndexMem::Push(): path is too long."); + Clear(); + return; + } // zjistime, jestli path navazuje na Path (path==Path+"\\jmeno") const char* s = path + strlen(path); if (s > path && *(s - 1) == '\\') @@ -3464,12 +3534,12 @@ void CTopIndexMem::Push(const char* path, int topIndex) TopIndexes[i] = TopIndexes[i + 1]; TopIndexesCount--; } - strcpy(Path, path); + lstrcpyn(Path, path, _countof(Path)); TopIndexes[TopIndexesCount++] = topIndex; } else // nenavazuje -> prvni top-index v rade { - strcpy(Path, path); + lstrcpyn(Path, path, _countof(Path)); TopIndexesCount = 1; TopIndexes[0] = topIndex; } @@ -3590,12 +3660,15 @@ BOOL CFileHistory::FillPopupMenu(CMenuPopup* popup) mii.Type = MENU_TYPE_STRING; mii.String = name; int i; + int inserted = 0; for (i = 0; i < Files.Count; i++) { CFileHistoryItem* item = Files[i]; // jmeno oddelime od cesty znakem '\t' - tim bude ve zvlastnim sloupci - lstrcpy(name, item->FileName); + lstrcpyn(name, item->FileName, _countof(name)); + if (strlen(item->FileName) >= _countof(name)) + continue; char* ptr = strrchr(name, '\\'); if (ptr == NULL) return FALSE; @@ -3620,11 +3693,14 @@ BOOL CFileHistory::FillPopupMenu(CMenuPopup* popup) default: TRACE_E("Unknown Type=" << item->Type); } - sprintf(name + lstrlen(name), "\t(%s)", text); // pripojime zpusob, jakym je soubor oteviran + StrNCat(name, "\t(", _countof(name)); + StrNCat(name, text, _countof(name)); + StrNCat(name, ")", _countof(name)); // pripojime zpusob, jakym je soubor oteviran mii.ID = i + 1; popup->InsertItem(-1, TRUE, &mii); + inserted++; } - if (i > 0) + if (inserted > 0) { popup->SetStyle(MENU_POPUP_THREECOLUMNS); // prvni dva sloupce jsou zarovnane doleva popup->AssignHotKeys(); diff --git a/src/salamdr4.cpp b/src/salamdr4.cpp index 6127474a..8a955b60 100644 --- a/src/salamdr4.cpp +++ b/src/salamdr4.cpp @@ -1269,7 +1269,7 @@ void WINAPI InternalGetType() } if (TransferAssocIndex == -1) - GetCommonFileTypeStr(TransferBuffer, &TransferLen, TransferFileData->Ext); + GetCommonFileTypeStr(TransferBuffer, TRANSFER_BUFFER_MAX, &TransferLen, TransferFileData->Ext); else { InternalGetTypeAux1 = Associations[TransferAssocIndex].Type; @@ -1279,7 +1279,7 @@ void WINAPI InternalGetType() memcpy(TransferBuffer, InternalGetTypeAux1, TransferLen); } else - GetCommonFileTypeStr(TransferBuffer, &TransferLen, TransferFileData->Ext); + GetCommonFileTypeStr(TransferBuffer, TRANSFER_BUFFER_MAX, &TransferLen, TransferFileData->Ext); } } } @@ -1820,12 +1820,17 @@ BOOL IsFileURLPath(const char* path) return *s == ':' && s - name == 4 && StrNICmp(name, "file", 4) == 0; } +BOOL IsPluginFSPath(char* path, char* fsName, int fsNameBufSize, char** userPart) +{ + return IsPluginFSPath((const char*)path, fsName, fsNameBufSize, (const char**)userPart); +} + BOOL IsPluginFSPath(char* path, char* fsName, char** userPart) { - return IsPluginFSPath((const char*)path, fsName, (const char**)userPart); + return IsPluginFSPath(path, fsName, MAX_PATH, userPart); } -BOOL IsPluginFSPath(const char* path, char* fsName, const char** userPart) +BOOL IsPluginFSPath(const char* path, char* fsName, int fsNameBufSize, const char** userPart) { CALL_STACK_MESSAGE2("IsPluginFSPath(%s, ,)", path); @@ -1846,6 +1851,18 @@ BOOL IsPluginFSPath(const char* path, char* fsName, const char** userPart) // copy the FS name if (fsName != NULL) { + if (fsNameBufSize <= 0) + { + TRACE_E("IsPluginFSPath(): invalid fsName buffer."); + return FALSE; + } + if ((int)(name - start) >= fsNameBufSize) + { + TRACE_E("IsPluginFSPath(): fsName buffer too small."); + if (fsNameBufSize > 0) + fsName[0] = 0; + return FALSE; + } memmove(fsName, start, name - start); fsName[name - start] = 0; } @@ -1857,3 +1874,8 @@ BOOL IsPluginFSPath(const char* path, char* fsName, const char** userPart) else return FALSE; } + +BOOL IsPluginFSPath(const char* path, char* fsName, const char** userPart) +{ + return IsPluginFSPath(path, fsName, MAX_PATH, userPart); +} diff --git a/src/salamdr5.cpp b/src/salamdr5.cpp index d4c1a6fa..187359fd 100644 --- a/src/salamdr5.cpp +++ b/src/salamdr5.cpp @@ -493,7 +493,7 @@ DWORD SalCheckPath(BOOL echo, const char* path, DWORD err, BOOL postRefresh, HWN } if (drvType != DRIVE_REMOTE) { - GetCurrentLocalReparsePoint(path, CheckPathRootWithRetryMsgBox); + GetCurrentLocalReparsePoint(path, CheckPathRootWithRetryMsgBox, MAX_PATH); if (strlen(CheckPathRootWithRetryMsgBox) > 3) { lstrcpyn(drive, CheckPathRootWithRetryMsgBox, MAX_PATH); @@ -678,7 +678,7 @@ BOOL SalParsePath(HWND parent, char* path, int& type, BOOL& isDir, char*& second char fsName[MAX_PATH]; char* fsUserPart; - if (IsPluginFSPath(path, fsName, &fsUserPart)) // FS path + if (IsPluginFSPath(path, fsName, _countof(fsName), &fsUserPart)) // FS path { int index; int fsNameIndex; @@ -1610,15 +1610,26 @@ BOOL IsNOVELLDrive(const char* path) return IsNetworkProviderDrive(path, WNNC_NET_NETWARE); } -BOOL IsLantasticDrive(const char* path, char* lastLantasticCheckRoot, BOOL& lastIsLantasticPath) +BOOL IsLantasticDrive(const char* path, char* lastLantasticCheckRoot, int lastLantasticCheckRootBufSize, BOOL& lastIsLantasticPath) { + if (path == NULL || lastLantasticCheckRoot == NULL || lastLantasticCheckRootBufSize <= 0) + { + TRACE_E("Unexpected parameters in IsLantasticDrive()."); + return FALSE; + } + if (lastLantasticCheckRoot[0] != 0 && HasTheSameRootPath(lastLantasticCheckRoot, path)) { return lastIsLantasticPath; } - GetRootPath(lastLantasticCheckRoot, path); + if (GetRootPath(lastLantasticCheckRoot, lastLantasticCheckRootBufSize, path) == 0) + { + TRACE_E("IsLantasticDrive(): unable to get root path."); + lastLantasticCheckRoot[0] = 0; + return FALSE; + } lastIsLantasticPath = FALSE; if (path[0] != '\\') // not UNC - may not be network path (that cannot be LANTASTIC) { @@ -1629,6 +1640,11 @@ BOOL IsLantasticDrive(const char* path, char* lastLantasticCheckRoot, BOOL& last return lastIsLantasticPath = IsNetworkProviderDrive(lastLantasticCheckRoot, WNNC_NET_LANTASTIC); } +BOOL IsLantasticDrive(const char* path, char* lastLantasticCheckRoot, BOOL& lastIsLantasticPath) +{ + return IsLantasticDrive(path, lastLantasticCheckRoot, MAX_PATH, lastIsLantasticPath); +} + BOOL IsNetworkPath(const char* path) { if (path[0] != '\\' || path[1] != '\\') @@ -1913,30 +1929,62 @@ void SetThreadNameInVCAndTrace(const char* name) SetThreadNameInVC(name); } +BOOL GetOurPathInRoamingAPPDATA(char* buf, int bufSize) +{ + if (buf == NULL || bufSize <= 0) + { + TRACE_E("GetOurPathInRoamingAPPDATA(): invalid output buffer."); + return FALSE; + } + + char appDataPath[MAX_PATH]; + if (SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0 /* SHGFP_TYPE_CURRENT */, appDataPath) != S_OK) + return FALSE; + + if ((int)strlen(appDataPath) >= bufSize) + { + buf[0] = 0; + return FALSE; + } + + lstrcpyn(buf, appDataPath, bufSize); + return SalPathAppend(buf, "Open Salamander", bufSize); +} + BOOL GetOurPathInRoamingAPPDATA(char* buf) { - return SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0 /* SHGFP_TYPE_CURRENT */, buf) == S_OK && - SalPathAppend(buf, "Open Salamander", MAX_PATH); + return GetOurPathInRoamingAPPDATA(buf, MAX_PATH); } -BOOL CreateOurPathInRoamingAPPDATA(char* buf) +BOOL CreateOurPathInRoamingAPPDATA(char* buf, int bufSize) { static char path[MAX_PATH]; // called from exception handler, stack may be full - if (buf != NULL) + if (buf != NULL && bufSize > 0) buf[0] = 0; if (SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0 /* SHGFP_TYPE_CURRENT */, path) == S_OK) { - if (SalPathAppend(path, "Open Salamander", MAX_PATH)) + if (SalPathAppend(path, "Open Salamander", _countof(path))) { CreateDirectoryUtf8(path, NULL); // if it fails (e.g. already exists), we don't care... if (buf != NULL) - lstrcpyn(buf, path, MAX_PATH); + { + if (bufSize <= 0) + return FALSE; + lstrcpyn(buf, path, bufSize); + if ((int)strlen(path) >= bufSize) + return FALSE; + } return TRUE; } } return FALSE; } +BOOL CreateOurPathInRoamingAPPDATA(char* buf) +{ + return CreateOurPathInRoamingAPPDATA(buf, MAX_PATH); +} + void SlashesToBackslashesAndRemoveDups(char* path) { char* s = path - 1; // convert '/' to '\\' and eliminate double backslashes (except at start, where they mean UNC path or \\.\C:) diff --git a/src/salamdr6.cpp b/src/salamdr6.cpp index de4917d2..e5491395 100644 --- a/src/salamdr6.cpp +++ b/src/salamdr6.cpp @@ -1741,34 +1741,48 @@ BOOL SafeGetSaveFileName(LPOPENFILENAME lpofn) return ret; } -void GetIfPathIsInaccessibleGoTo(char* path, BOOL forceIsMyDocs) +void GetIfPathIsInaccessibleGoTo(char* path, int pathBufSize, BOOL forceIsMyDocs) { + if (path == NULL || pathBufSize <= 0) + { + TRACE_E("GetIfPathIsInaccessibleGoTo(): invalid output buffer."); + return; + } + if (forceIsMyDocs || Configuration.IfPathIsInaccessibleGoToIsMyDocs) { - if (!GetMyDocumentsOrDesktopPath(path, 2 * MAX_PATH)) + if (!GetMyDocumentsOrDesktopPath(path, pathBufSize)) { char winPath[2 * MAX_PATH]; if (GetWindowsDirectory(winPath, MAX_PATH) != 0) - GetRootPath(path, winPath); + GetRootPath(path, pathBufSize, winPath); else - strcpy(path, "C:\\"); + lstrcpyn(path, "C:\\", pathBufSize); } } else { - lstrcpyn(path, Configuration.IfPathIsInaccessibleGoTo, 2 * MAX_PATH); + lstrcpyn(path, Configuration.IfPathIsInaccessibleGoTo, pathBufSize); if (path[0] != 0 && path[1] == ':') { path[0] = UpperCase[path[0]]; if (path[2] == 0) { // "C:" -> "C:\" - path[2] = '\\'; - path[3] = 0; + if (pathBufSize > 3) + { + path[2] = '\\'; + path[3] = 0; + } } } } } +void GetIfPathIsInaccessibleGoTo(char* path, BOOL forceIsMyDocs) +{ + GetIfPathIsInaccessibleGoTo(path, 2 * MAX_PATH, forceIsMyDocs); +} + HICON SalLoadImage(int vistaResID, int otherResID, int cx, int cy, UINT flags) { // JRYFIXME - convert to calling SalLoadIcon diff --git a/src/salamdr7.cpp b/src/salamdr7.cpp index 8f760067..00dbbf02 100644 --- a/src/salamdr7.cpp +++ b/src/salamdr7.cpp @@ -478,7 +478,7 @@ BOOL IsPathOnSSD(const char* path) char guidPath[MAX_PATH]; guidPath[0] = 0; - if (GetResolvedPathMountPointAndGUID(path, NULL, guidPath)) + if (GetResolvedPathMountPointAndGUID(path, NULL, 0, guidPath, _countof(guidPath))) { SalPathRemoveBackslash(guidPath); // the following CreateFile doesn't like the backslash after volume BOOL trim = FALSE; @@ -498,13 +498,34 @@ BOOL IsPathOnSSD(const char* path) return FALSE; } -BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* guidPath) +BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, int mountPointBufSize, char* guidPath, int guidPathBufSize) { + if (path == NULL) + return FALSE; + if (mountPoint != NULL) + { + if (mountPointBufSize <= 0) + return FALSE; + mountPoint[0] = 0; + } + if (guidPath != NULL) + { + if (guidPathBufSize <= 0) + return FALSE; + guidPath[0] = 0; + } + char resolvedPath[MAX_PATH]; - strcpy(resolvedPath, path); + lstrcpyn(resolvedPath, path, _countof(resolvedPath)); + if ((int)strlen(path) >= _countof(resolvedPath)) + { + TRACE_E("GetResolvedPathMountPointAndGUID(): path is too long."); + return FALSE; + } ResolveSubsts(resolvedPath); char rootPath[MAX_PATH]; - GetRootPath(rootPath, resolvedPath); + if (GetRootPath(rootPath, _countof(rootPath), resolvedPath) == 0) + return FALSE; BOOL remotePath = TRUE; if (!IsUNCPath(rootPath) && GetDriveType(rootPath) == DRIVE_FIXED) // reparse points make sense to search only on fixed disks { @@ -517,12 +538,13 @@ BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* // for GetVolumeNameForVolumeMountPoint we need root if (cutPathIsPossible) { - GetRootPath(rootPath, resolvedPath); - strcpy(resolvedPath, rootPath); + if (GetRootPath(rootPath, _countof(rootPath), resolvedPath) == 0) + return FALSE; + lstrcpyn(resolvedPath, rootPath, _countof(resolvedPath)); } } else - strcpy(resolvedPath, rootPath); // for non-DRIVE_FIXED disks we take root path, GetVolumeNameForVolumeMountPoint needs mount point and searching for it by gradually shortening the path seems too time-consuming for now (at least for network paths + for cards hopefully mount points in subdirectories are not a threat, right?) + lstrcpyn(resolvedPath, rootPath, _countof(resolvedPath)); // for non-DRIVE_FIXED disks we take root path, GetVolumeNameForVolumeMountPoint needs mount point and searching for it by gradually shortening the path seems too time-consuming for now (at least for network paths + for cards hopefully mount points in subdirectories are not a threat, right?) // GUID can be obtained even for non-DRIVE_FIXED disks, for example card readers // according to https://msdn.microsoft.com/en-us/library/windows/desktop/aa364996%28v=vs.85%29.aspx there is no support for DRIVE_REMOTE yet, // but that could potentially come too @@ -531,11 +553,23 @@ BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* if (GetVolumeNameForVolumeMountPoint(resolvedPath, guidP, sizeof(guidP))) { if (mountPoint != NULL) - strcpy(mountPoint, resolvedPath); + { + lstrcpyn(mountPoint, resolvedPath, mountPointBufSize); + if ((int)strlen(resolvedPath) >= mountPointBufSize) + { + TRACE_E("GetResolvedPathMountPointAndGUID(): mountPoint buffer too small."); + return FALSE; + } + } if (guidPath != NULL) { SalPathAddBackslash(guidP, sizeof(guidP)); - strcpy(guidPath, guidP); + lstrcpyn(guidPath, guidP, guidPathBufSize); + if ((int)strlen(guidP) >= guidPathBufSize) + { + TRACE_E("GetResolvedPathMountPointAndGUID(): guidPath buffer too small."); + return FALSE; + } } return TRUE; } @@ -549,3 +583,8 @@ BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* } return FALSE; } + +BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* guidPath) +{ + return GetResolvedPathMountPointAndGUID(path, mountPoint, MAX_PATH, guidPath, MAX_PATH); +} diff --git a/src/shellsup.cpp b/src/shellsup.cpp index d463e7a2..4da74db9 100644 --- a/src/shellsup.cpp +++ b/src/shellsup.cpp @@ -911,7 +911,7 @@ void DoDragFromArchiveOrFS(CFilesWindow* panel, BOOL& dropDone, char* targetPath // create "fake" directory char fakeRootDir[MAX_PATH]; char* fakeName; - if (SalGetTempFileName(NULL, "SAL", fakeRootDir, FALSE)) + if (SalGetTempFileName(NULL, "SAL", fakeRootDir, _countof(fakeRootDir), FALSE)) { fakeName = fakeRootDir + strlen(fakeRootDir); // jr: I found a mention on the net "Did implementing "IPersistStream" and providing the undocumented @@ -1325,7 +1325,7 @@ void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection, // create "fake" directory char fakeRootDir[MAX_PATH]; char* fakeName; - if (SalGetTempFileName(NULL, "SAL", fakeRootDir, FALSE)) + if (SalGetTempFileName(NULL, "SAL", fakeRootDir, _countof(fakeRootDir), FALSE)) { BOOL delFakeDir = TRUE; fakeName = fakeRootDir + strlen(fakeRootDir); diff --git a/src/viewer3.cpp b/src/viewer3.cpp index 5b28570f..ebd08964 100644 --- a/src/viewer3.cpp +++ b/src/viewer3.cpp @@ -1597,7 +1597,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } else strcpy(tmpFile, fileName); - if (attr == 0xFFFFFFFF || SalGetTempFileName(path, "sal", tmpFile, TRUE)) + if (attr == 0xFFFFFFFF || SalGetTempFileName(path, "sal", tmpFile, _countof(tmpFile), TRUE)) { HANDLE file = HANDLES_Q(CreateFileUtf8(tmpFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, diff --git a/src/worker.cpp b/src/worker.cpp index ed7c9d56..569ffde9 100644 --- a/src/worker.cpp +++ b/src/worker.cpp @@ -1219,9 +1219,9 @@ void GetFileOverwriteInfo(char* buff, int buffLen, HANDLE file, const char* file if (fileTime != NULL) *fileTime = ft; if (GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, time, 50) == 0) - sprintf(time, "%u:%02u:%02u", st.wHour, st.wMinute, st.wSecond); + _snprintf_s(time, _countof(time), _TRUNCATE, "%u:%02u:%02u", st.wHour, st.wMinute, st.wSecond); if (GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, date, 50) == 0) - sprintf(date, "%u.%u.%u", st.wDay, st.wMonth, st.wYear); + _snprintf_s(date, _countof(date), _TRUNCATE, "%u.%u.%u", st.wDay, st.wMonth, st.wYear); } char attr[30]; @@ -1243,8 +1243,10 @@ void GetFileOverwriteInfo(char* buff, int buffLen, HANDLE file, const char* file _snprintf_s(buff, buffLen, _TRUNCATE, "%s, %s, %s%s", number, date, time, attr); } -void GetDirInfo(char* buffer, const char* dir) +void GetDirInfo(char* buffer, int bufferLen, const char* dir) { + if (bufferLen <= 0) + return; const char* dirFindFirst = dir; char dirFindFirstCopy[3 * MAX_PATH]; MakeCopyWithBackslashIfNeeded(dirFindFirst, dirFindFirstCopy); @@ -1287,14 +1289,14 @@ void GetDirInfo(char* buffer, const char* dir) { char date[50], time[50]; if (GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, time, 50) == 0) - sprintf(time, "%u:%02u:%02u", st.wHour, st.wMinute, st.wSecond); + _snprintf_s(time, _countof(time), _TRUNCATE, "%u:%02u:%02u", st.wHour, st.wMinute, st.wSecond); if (GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, date, 50) == 0) - sprintf(date, "%u.%u.%u", st.wDay, st.wMonth, st.wYear); + _snprintf_s(date, _countof(date), _TRUNCATE, "%u.%u.%u", st.wDay, st.wMonth, st.wYear); - sprintf(buffer, "%s, %s", date, time); + _snprintf_s(buffer, bufferLen, _TRUNCATE, "%s, %s", date, time); } else - sprintf(buffer, "%s, %s", LoadStr(IDS_INVALID_DATEORTIME), LoadStr(IDS_INVALID_DATEORTIME)); + _snprintf_s(buffer, bufferLen, _TRUNCATE, "%s, %s", LoadStr(IDS_INVALID_DATEORTIME), LoadStr(IDS_INVALID_DATEORTIME)); } else buffer[0] = 0; @@ -1304,11 +1306,15 @@ BOOL IsDirectoryEmpty(const char* name) // directories/subdirectories contain no { char dir[MAX_PATH + 5]; int len = (int)strlen(name); + if (len <= 0 || len >= _countof(dir) - 2) + return FALSE; memcpy(dir, name, len); + dir[len] = 0; if (dir[len - 1] != '\\') dir[len++] = '\\'; char* end = dir + len; - strcpy(end, "*"); + *end++ = '*'; + *end = 0; WIN32_FIND_DATAW fileData; HANDLE search; @@ -1325,7 +1331,8 @@ BOOL IsDirectoryEmpty(const char* name) // directories/subdirectories contain no if (fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - if (ConvertWideToUtf8(fileData.cFileName, -1, end, MAX_PATH) == 0) + int remaining = (int)(_countof(dir) - (end - dir)); + if (remaining <= 1 || ConvertWideToUtf8(fileData.cFileName, -1, end, remaining) == 0) continue; if (!IsDirectoryEmpty(dir)) // the subdirectory is not empty { @@ -3135,72 +3142,79 @@ HANDLE SalCreateFileEx(const char* fileName, DWORD desiredAccess, { // rename ("tidy up") the file/directory with the conflicting DOS name to a temporary 8.3 name (no extra DOS name needed) char tmpName[MAX_PATH + 20]; - lstrcpyn(tmpName, fileName, MAX_PATH); - CutDirectory(tmpName); - SalPathAddBackslash(tmpName, MAX_PATH + 20); - char* tmpNamePart = tmpName + strlen(tmpName); - char origFullName[MAX_PATH]; - if (SalPathAppend(tmpName, fullName, MAX_PATH)) + if (strlen(fileName) >= _countof(tmpName)) { - strcpy(origFullName, tmpName); - DWORD num = (GetTickCount() / 10) % 0xFFF; - DWORD origFullNameAttr = SalGetFileAttributes(origFullName); - while (1) + TRACE_E("SalCreateFileEx(): path too long for DOS-name collision workaround: " << fileName); + } + else + { + lstrcpyn(tmpName, fileName, _countof(tmpName)); + CutDirectory(tmpName); + SalPathAddBackslash(tmpName, _countof(tmpName)); + char* tmpNamePart = tmpName + strlen(tmpName); + char origFullName[MAX_PATH + 20]; + if (SalPathAppend(tmpName, fullName, _countof(tmpName))) { - sprintf(tmpNamePart, "sal%03X", num++); - if (SalMoveFile(origFullName, tmpName)) - break; - DWORD e = GetLastError(); - if (e != ERROR_FILE_EXISTS && e != ERROR_ALREADY_EXISTS) + strcpy(origFullName, tmpName); + DWORD num = (GetTickCount() / 10) % 0xFFF; + DWORD origFullNameAttr = SalGetFileAttributes(origFullName); + while (1) { - tmpName[0] = 0; - break; - } - } - if (tmpName[0] != 0) // if we successfully "tidied" the conflicting file, try creating - { // the target file again, then restore the original name - out = NOHANDLES(CreateFileW(fileNameW, desiredAccess, shareMode, NULL, - CREATE_NEW, flagsAndAttributes, NULL)); - if (out == INVALID_HANDLE_VALUE && encryptionNotSupported != NULL && - (flagsAndAttributes & FILE_ATTRIBUTE_ENCRYPTED)) - { // when the target disk cannot create an Encrypted file (observed on NTFS network disk (tested on share from XP) while logged in under a different username than we have in the system (on the current console) - the remote machine has a same-named user without a password, so it cannot be used over the network) - out = NOHANDLES(CreateFileW(fileNameW, desiredAccess, shareMode, NULL, - CREATE_NEW, (flagsAndAttributes & ~(FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_READONLY)), NULL)); - if (out != INVALID_HANDLE_VALUE) + sprintf(tmpNamePart, "sal%03X", num++); + if (SalMoveFile(origFullName, tmpName)) + break; + DWORD e = GetLastError(); + if (e != ERROR_FILE_EXISTS && e != ERROR_ALREADY_EXISTS) { - *encryptionNotSupported = TRUE; - NOHANDLES(CloseHandle(out)); - out = INVALID_HANDLE_VALUE; - if (!DeleteFileW(fileNameW)) // XP and Vista ignore this scenario, so do the same (at worst warn user that a zero-length file was added on disk and cannot be deleted) - TRACE_E("Unable to delete testing target file: " << fileName); + tmpName[0] = 0; + break; } } - if (!SalMoveFile(tmpName, origFullName)) - { // this apparently can happen; inexplicably, Windows creates a file named origFullName instead of fileName (the DOS name) - TRACE_I("Unexpected situation in SalCreateFileEx(): unable to rename file from tmp-name to original long file name! " << origFullName); + if (tmpName[0] != 0) // if we successfully "tidied" the conflicting file, try creating + { // the target file again, then restore the original name + out = NOHANDLES(CreateFileW(fileNameW, desiredAccess, shareMode, NULL, + CREATE_NEW, flagsAndAttributes, NULL)); + if (out == INVALID_HANDLE_VALUE && encryptionNotSupported != NULL && + (flagsAndAttributes & FILE_ATTRIBUTE_ENCRYPTED)) + { // when the target disk cannot create an Encrypted file (observed on NTFS network disk (tested on share from XP) while logged in under a different username than we have in the system (on the current console) - the remote machine has a same-named user without a password, so it cannot be used over the network) + out = NOHANDLES(CreateFileW(fileNameW, desiredAccess, shareMode, NULL, + CREATE_NEW, (flagsAndAttributes & ~(FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_READONLY)), NULL)); + if (out != INVALID_HANDLE_VALUE) + { + *encryptionNotSupported = TRUE; + NOHANDLES(CloseHandle(out)); + out = INVALID_HANDLE_VALUE; + if (!DeleteFileW(fileNameW)) // XP and Vista ignore this scenario, so do the same (at worst warn user that a zero-length file was added on disk and cannot be deleted) + TRACE_E("Unable to delete testing target file: " << fileName); + } + } + if (!SalMoveFile(tmpName, origFullName)) + { // this apparently can happen; inexplicably, Windows creates a file named origFullName instead of fileName (the DOS name) + TRACE_I("Unexpected situation in SalCreateFileEx(): unable to rename file from tmp-name to original long file name! " << origFullName); - if (out != INVALID_HANDLE_VALUE) - { - NOHANDLES(CloseHandle(out)); - out = INVALID_HANDLE_VALUE; - DeleteFileW(fileNameW); - if (!SalMoveFile(tmpName, origFullName)) - TRACE_E("Fatal unexpected situation in SalCreateFileEx(): unable to rename file from tmp-name to original long file name! " << origFullName); + if (out != INVALID_HANDLE_VALUE) + { + NOHANDLES(CloseHandle(out)); + out = INVALID_HANDLE_VALUE; + DeleteFileW(fileNameW); + if (!SalMoveFile(tmpName, origFullName)) + TRACE_E("Fatal unexpected situation in SalCreateFileEx(): unable to rename file from tmp-name to original long file name! " << origFullName); + } } - } - else - { - if ((origFullNameAttr & FILE_ATTRIBUTE_ARCHIVE) == 0) + else { - CStrP origFullNameW(ConvertAllocUtf8ToWide(origFullName, -1)); - if (origFullNameW != NULL) - SetFileAttributesW(origFullNameW, origFullNameAttr); // leave without extra handling or retry; not critical (normally toggles unpredictably) + if ((origFullNameAttr & FILE_ATTRIBUTE_ARCHIVE) == 0) + { + CStrP origFullNameW(ConvertAllocUtf8ToWide(origFullName, -1)); + if (origFullNameW != NULL) + SetFileAttributesW(origFullNameW, origFullNameAttr); // leave without extra handling or retry; not critical (normally toggles unpredictably) + } } } } + else + TRACE_E("SalCreateFileEx(): Original full file name is too long, unable to bypass only-dos-name-overwrite problem!"); } - else - TRACE_E("SalCreateFileEx(): Original full file name is too long, unable to bypass only-dos-name-overwrite problem!"); } } } @@ -5356,7 +5370,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, else { getTimeFailed = TRUE; - strcpy(tAttr, LoadStr(IDS_ERR_FILEOPEN)); + lstrcpyn(tAttr, LoadStr(IDS_ERR_FILEOPEN), _countof(tAttr)); } out = NULL; @@ -5987,60 +6001,67 @@ BOOL DoMoveFile(COperation* op, HWND hProgressDlg, void* buffer, { // rename ("tidy up") the file/directory with the conflicting DOS name to a temporary 8.3 name (does not need an extra DOS name) char tmpName[MAX_PATH + 20]; - lstrcpyn(tmpName, op->TargetName, MAX_PATH); - CutDirectory(tmpName); - SalPathAddBackslash(tmpName, MAX_PATH + 20); - char* tmpNamePart = tmpName + strlen(tmpName); - char origFullName[MAX_PATH]; - if (SalPathAppend(tmpName, fullName, MAX_PATH)) + if (strlen(op->TargetName) >= _countof(tmpName)) { - strcpy(origFullName, tmpName); - DWORD num = (GetTickCount() / 10) % 0xFFF; - DWORD origFullNameAttr = SalGetFileAttributes(origFullName); - while (1) + TRACE_E("DoMoveFile(): target path too long for DOS-name collision workaround: " << op->TargetName); + } + else + { + lstrcpyn(tmpName, op->TargetName, _countof(tmpName)); + CutDirectory(tmpName); + SalPathAddBackslash(tmpName, _countof(tmpName)); + char* tmpNamePart = tmpName + strlen(tmpName); + char origFullName[MAX_PATH + 20]; + if (SalPathAppend(tmpName, fullName, _countof(tmpName))) { - sprintf(tmpNamePart, "sal%03X", num++); - if (SalMoveFile(origFullName, tmpName)) - break; - DWORD e = GetLastError(); - if (e != ERROR_FILE_EXISTS && e != ERROR_ALREADY_EXISTS) - { - tmpName[0] = 0; - break; - } - } - if (tmpName[0] != 0) // if we managed to "tidy up" the conflicting file/directory, try moving it again - { // then restore the original name of the "tidied" file/directory - BOOL moveDone = SalMoveFile(sourceNameMvDir, op->TargetName); - if (script->CopyAttrs && (op->Attr & FILE_ATTRIBUTE_ARCHIVE) == 0) // the Archive attribute was not set; MoveFile turned it on, clear it again + strcpy(origFullName, tmpName); + DWORD num = (GetTickCount() / 10) % 0xFFF; + DWORD origFullNameAttr = SalGetFileAttributes(origFullName); + while (1) { - CStrP targetNameW2(ConvertAllocUtf8ToWide(op->TargetName, -1)); - if (targetNameW2 != NULL) - SetFileAttributesW(targetNameW2, op->Attr); // leave without handling or retry, not important (it normally toggles chaotically) - } - if (!SalMoveFile(tmpName, origFullName)) - { // this apparently can happen; inexplicably, Windows creates a file named origFullName instead of op->TargetName (the DOS name) - TRACE_I("DoMoveFile(): Unexpected situation: unable to rename file/dir from tmp-name to original long file name! " << origFullName); - if (moveDone) + sprintf(tmpNamePart, "sal%03X", num++); + if (SalMoveFile(origFullName, tmpName)) + break; + DWORD e = GetLastError(); + if (e != ERROR_FILE_EXISTS && e != ERROR_ALREADY_EXISTS) { - if (SalMoveFile(op->TargetName, sourceNameMvDir)) - moveDone = FALSE; - if (!SalMoveFile(tmpName, origFullName)) - TRACE_E("DoMoveFile(): Fatal unexpected situation: unable to rename file/dir from tmp-name to original long file name! " << origFullName); + tmpName[0] = 0; + break; } } - else - { - if ((origFullNameAttr & FILE_ATTRIBUTE_ARCHIVE) == 0) - SetFileAttributesUtf8(origFullName, origFullNameAttr); // leave without handling or retry, not important (it normally toggles chaotically) - } + if (tmpName[0] != 0) // if we managed to "tidy up" the conflicting file/directory, try moving it again + { // then restore the original name of the "tidied" file/directory + BOOL moveDone = SalMoveFile(sourceNameMvDir, op->TargetName); + if (script->CopyAttrs && (op->Attr & FILE_ATTRIBUTE_ARCHIVE) == 0) // the Archive attribute was not set; MoveFile turned it on, clear it again + { + CStrP targetNameW2(ConvertAllocUtf8ToWide(op->TargetName, -1)); + if (targetNameW2 != NULL) + SetFileAttributesW(targetNameW2, op->Attr); // leave without handling or retry, not important (it normally toggles chaotically) + } + if (!SalMoveFile(tmpName, origFullName)) + { // this apparently can happen; inexplicably, Windows creates a file named origFullName instead of op->TargetName (the DOS name) + TRACE_I("DoMoveFile(): Unexpected situation: unable to rename file/dir from tmp-name to original long file name! " << origFullName); + if (moveDone) + { + if (SalMoveFile(op->TargetName, sourceNameMvDir)) + moveDone = FALSE; + if (!SalMoveFile(tmpName, origFullName)) + TRACE_E("DoMoveFile(): Fatal unexpected situation: unable to rename file/dir from tmp-name to original long file name! " << origFullName); + } + } + else + { + if ((origFullNameAttr & FILE_ATTRIBUTE_ARCHIVE) == 0) + SetFileAttributesUtf8(origFullName, origFullNameAttr); // leave without handling or retry, not important (it normally toggles chaotically) + } - if (moveDone) - goto OPERATION_DONE; + if (moveDone) + goto OPERATION_DONE; + } } + else + TRACE_E("DoMoveFile(): Original full file/dir name is too long, unable to bypass only-dos-name-overwrite problem!"); } - else - TRACE_E("DoMoveFile(): Original full file/dir name is too long, unable to bypass only-dos-name-overwrite problem!"); } } } @@ -6582,58 +6603,65 @@ BOOL SalCreateDirectoryEx(const char* name, DWORD* err) { // rename ("tidy up") the file/directory whose DOS name conflicts to a temporary 8.3 name (no extra DOS name needed) char tmpName[MAX_PATH + 20]; - lstrcpyn(tmpName, name, MAX_PATH); - CutDirectory(tmpName); - SalPathAddBackslash(tmpName, MAX_PATH + 20); - char* tmpNamePart = tmpName + strlen(tmpName); - char origFullName[MAX_PATH]; - if (SalPathAppend(tmpName, fullName, MAX_PATH)) + if (strlen(name) >= _countof(tmpName)) { - strcpy(origFullName, tmpName); - DWORD num = (GetTickCount() / 10) % 0xFFF; - DWORD origFullNameAttr = SalGetFileAttributes(origFullName); - while (1) + TRACE_E("SalCreateDirectoryEx(): path too long for DOS-name collision workaround: " << name); + } + else + { + lstrcpyn(tmpName, name, _countof(tmpName)); + CutDirectory(tmpName); + SalPathAddBackslash(tmpName, _countof(tmpName)); + char* tmpNamePart = tmpName + strlen(tmpName); + char origFullName[MAX_PATH + 20]; + if (SalPathAppend(tmpName, fullName, _countof(tmpName))) { - sprintf(tmpNamePart, "sal%03X", num++); - if (SalMoveFile(origFullName, tmpName)) - break; - DWORD e = GetLastError(); - if (e != ERROR_FILE_EXISTS && e != ERROR_ALREADY_EXISTS) + strcpy(origFullName, tmpName); + DWORD num = (GetTickCount() / 10) % 0xFFF; + DWORD origFullNameAttr = SalGetFileAttributes(origFullName); + while (1) { - tmpName[0] = 0; - break; - } - } - if (tmpName[0] != 0) // if we managed to "tidy up" the conflicting file, retry the move - { // and then restore the original name of the "tidied" file - BOOL createDirDone = nameW != NULL ? CreateDirectoryW(nameW, NULL) : FALSE; - if (!SalMoveFile(tmpName, origFullName)) - { // this can apparently happen: inexplicably Windows creates a file named origFullName instead of name (the DOS name) - TRACE_I("Unexpected situation: unable to rename file from tmp-name to original long file name! " << origFullName); - if (createDirDone) + sprintf(tmpNamePart, "sal%03X", num++); + if (SalMoveFile(origFullName, tmpName)) + break; + DWORD e = GetLastError(); + if (e != ERROR_FILE_EXISTS && e != ERROR_ALREADY_EXISTS) { - if (nameW != NULL && RemoveDirectoryW(nameW)) - createDirDone = FALSE; - if (!SalMoveFile(tmpName, origFullName)) - TRACE_E("Fatal unexpected situation: unable to rename file from tmp-name to original long file name! " << origFullName); + tmpName[0] = 0; + break; } } - else - { - if ((origFullNameAttr & FILE_ATTRIBUTE_ARCHIVE) == 0) + if (tmpName[0] != 0) // if we managed to "tidy up" the conflicting file, retry the move + { // and then restore the original name of the "tidied" file + BOOL createDirDone = nameW != NULL ? CreateDirectoryW(nameW, NULL) : FALSE; + if (!SalMoveFile(tmpName, origFullName)) + { // this can apparently happen: inexplicably Windows creates a file named origFullName instead of name (the DOS name) + TRACE_I("Unexpected situation: unable to rename file from tmp-name to original long file name! " << origFullName); + if (createDirDone) + { + if (nameW != NULL && RemoveDirectoryW(nameW)) + createDirDone = FALSE; + if (!SalMoveFile(tmpName, origFullName)) + TRACE_E("Fatal unexpected situation: unable to rename file from tmp-name to original long file name! " << origFullName); + } + } + else { - CStrP origFullNameW(ConvertAllocUtf8ToWide(origFullName, -1)); - if (origFullNameW != NULL) - SetFileAttributesW(origFullNameW, origFullNameAttr); // leave it without extra handling or retries; not important (normally toggles unpredictably) + if ((origFullNameAttr & FILE_ATTRIBUTE_ARCHIVE) == 0) + { + CStrP origFullNameW(ConvertAllocUtf8ToWide(origFullName, -1)); + if (origFullNameW != NULL) + SetFileAttributesW(origFullNameW, origFullNameAttr); // leave it without extra handling or retries; not important (normally toggles unpredictably) + } } - } - if (createDirDone) - return TRUE; + if (createDirDone) + return TRUE; + } } + else + TRACE_E("Original full file name is too long, unable to bypass only-dos-name-overwrite problem!"); } - else - TRACE_E("Original full file name is too long, unable to bypass only-dos-name-overwrite problem!"); } } } @@ -6973,8 +7001,8 @@ BOOL DoCreateDir(HWND hProgressDlg, char* name, DWORD attr, if (dlgData.CnfrmDirOver && !dlgData.DirOverwriteAll) // should we ask the user about overwriting the directory? { char sAttr[101], tAttr[101]; - GetDirInfo(sAttr, sourceDir); - GetDirInfo(tAttr, name); + GetDirInfo(sAttr, _countof(sAttr), sourceDir); + GetDirInfo(tAttr, _countof(tAttr), name); WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... if (*dlgData.CancelWorker) @@ -7461,7 +7489,13 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu if (hSource != INVALID_HANDLE_VALUE) { // derive the path for the temporary file - char tmpPath[MAX_PATH]; + char tmpPath[3 * MAX_PATH]; + if (strlen(name) >= _countof(tmpPath)) + { + TRACE_E("DoConvert(): source path is too long for temporary path handling: " << name); + HANDLES(CloseHandle(hSource)); + return FALSE; + } strcpy(tmpPath, name); char* terminator = strrchr(tmpPath, '\\'); if (terminator == NULL) @@ -7478,7 +7512,7 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu BOOL tmpFileExists = FALSE; while (1) { - if (SalGetTempFileName(tmpPath, "cnv", tmpFileName, TRUE)) + if (SalGetTempFileName(tmpPath, "cnv", tmpFileName, _countof(tmpFileName), TRUE)) { tmpFileExists = TRUE; @@ -7594,14 +7628,14 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu } else { - *targetIterator = convertData.CodeTable[*sourceIterator]; + *targetIterator = convertData.CodeTable[(unsigned char)*sourceIterator]; targetIterator++; } } } else { - *targetIterator = convertData.CodeTable[*sourceIterator]; + *targetIterator = convertData.CodeTable[(unsigned char)*sourceIterator]; targetIterator++; } sourceIterator++; @@ -7738,10 +7772,18 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... if (*dlgData.CancelWorker) + { + ClearReadOnlyAttr(tmpFileName); // ensure it can be deleted + DeleteFileUtf8(tmpFileName); return FALSE; + } if (dlgData.SkipAllMoveErrors) + { + ClearReadOnlyAttr(tmpFileName); // ensure it can be deleted + DeleteFileUtf8(tmpFileName); return TRUE; + } int ret = IDCANCEL; char* data[4]; @@ -7758,9 +7800,13 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu case IDB_SKIPALL: dlgData.SkipAllMoveErrors = TRUE; case IDB_SKIP: + ClearReadOnlyAttr(tmpFileName); // ensure it can be deleted + DeleteFileUtf8(tmpFileName); return TRUE; case IDCANCEL: + ClearReadOnlyAttr(tmpFileName); // ensure it can be deleted + DeleteFileUtf8(tmpFileName); return FALSE; } } @@ -7822,7 +7868,7 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu DWORD err = GetLastError(); - char fakeName[MAX_PATH]; // name of the temp file that cannot be created/opened + char fakeName[3 * MAX_PATH]; // name of the temp file that cannot be created/opened if (tmpFileExists) { strcpy(fakeName, tmpFileName); @@ -7836,8 +7882,16 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu char* s = tmpPath + strlen(tmpPath); if (s > tmpPath && *(s - 1) == '\\') s--; - memcpy(fakeName, tmpPath, s - tmpPath); - strcpy(fakeName + (s - tmpPath), "\\cnv0000.tmp"); + size_t fakeNamePrefixLen = (size_t)(s - tmpPath); + const char* fakeNameSuffix = "\\cnv0000.tmp"; + size_t fakeNameSuffixLen = strlen(fakeNameSuffix); + if (fakeNamePrefixLen + fakeNameSuffixLen < _countof(fakeName)) + { + memcpy(fakeName, tmpPath, fakeNamePrefixLen); + memcpy(fakeName + fakeNamePrefixLen, fakeNameSuffix, fakeNameSuffixLen + 1); + } + else + lstrcpyn(fakeName, tmpPath, _countof(fakeName)); } WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... @@ -8211,7 +8265,7 @@ unsigned ThreadWorkerBody(void* parameter) SetProgress(hProgressDlg, 0, CaclProg(totalDone, script->TotalSize), dlgData); - BOOL lantasticCheck = IsLantasticDrive(op->TargetName, lastLantasticCheckRoot, lastIsLantasticPath); + BOOL lantasticCheck = IsLantasticDrive(op->TargetName, lastLantasticCheckRoot, _countof(lastLantasticCheckRoot), lastIsLantasticPath); Error = !DoCopyFile(op, hProgressDlg, buffer, script, totalDone, clearReadonlyMask, NULL, lantasticCheck, mustDeleteFileBeforeOverwrite, @@ -8236,7 +8290,7 @@ unsigned ThreadWorkerBody(void* parameter) SetProgress(hProgressDlg, 0, CaclProg(totalDone, script->TotalSize), dlgData); - BOOL lantasticCheck = IsLantasticDrive(op->TargetName, lastLantasticCheckRoot, lastIsLantasticPath); + BOOL lantasticCheck = IsLantasticDrive(op->TargetName, lastLantasticCheckRoot, _countof(lastLantasticCheckRoot), lastIsLantasticPath); BOOL ignInvalidName = op->Opcode == ocMoveDir && (op->OpFlags & OPFL_IGNORE_INVALID_NAME) != 0; Error = !DoMoveFile(op, hProgressDlg, buffer, script, totalDone, diff --git a/src/zip.cpp b/src/zip.cpp index e8b66233..6caaf045 100644 --- a/src/zip.cpp +++ b/src/zip.cpp @@ -3005,7 +3005,7 @@ BOOL CSalamanderGeneral::GetConfigParameter(int paramID, void* buffer, int buffe { auxType = SALCFGTYPE_STRING; char ifPathIsInaccessibleGoTo[MAX_PATH]; - GetIfPathIsInaccessibleGoTo(ifPathIsInaccessibleGoTo); + GetIfPathIsInaccessibleGoTo(ifPathIsInaccessibleGoTo, _countof(ifPathIsInaccessibleGoTo), FALSE); auxDataSize = (int)strlen(ifPathIsInaccessibleGoTo) + 1; if (auxDataSize > MAX_PATH) auxDataSize = MAX_PATH; // we limited the required buffer to MAX_PATH characters