Author: hbelusca Date: Fri Mar 6 20:32:38 2015 New Revision: 66592
URL: http://svn.reactos.org/svn/reactos?rev=66592&view=rev Log: [SHIMGVW] - Few whitespace fixes. - Fix a regression where an exception was thrown when opening a file from cdrom. Patch by Ricardo Hanke. CORE-9250 #resolve #comment Patch v2 committed! Thanks!
Modified: trunk/reactos/dll/win32/shimgvw/comsup.c trunk/reactos/dll/win32/shimgvw/shimgvw.c
Modified: trunk/reactos/dll/win32/shimgvw/comsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/comsup.c?... ============================================================================== --- trunk/reactos/dll/win32/shimgvw/comsup.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shimgvw/comsup.c [iso-8859-1] Fri Mar 6 20:32:38 2015 @@ -34,12 +34,12 @@ STDAPI DllCanUnloadNow(VOID) { - if ((ObjectCount != 0) || (LockCount != 0)) + if ((ObjectCount != 0) || (LockCount != 0)) { return S_FALSE; } else - { + { return S_OK; } } @@ -53,6 +53,6 @@ /* There are no classes to export, so always return CLASS_E_CLASSNOTAVAILABLE*/ *ppv = NULL; hr = CLASS_E_CLASSNOTAVAILABLE; - + return hr; }
Modified: trunk/reactos/dll/win32/shimgvw/shimgvw.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/shimgvw.c... ============================================================================== --- trunk/reactos/dll/win32/shimgvw/shimgvw.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shimgvw/shimgvw.c [iso-8859-1] Fri Mar 6 20:32:38 2015 @@ -1,5 +1,4 @@ /* - * * PROJECT: ReactOS Picture and Fax Viewer * FILE: dll/win32/shimgvw/shimgvw.c * PURPOSE: shimgvw.dll @@ -175,9 +174,9 @@ { c++; } - - LoadStringW(hInstance, IDS_APPTITLE, szResStr, 512); - StringCbPrintfExW(szTitleBuf, 800, NULL, NULL, 0, L"%ls%ls%ls", szResStr, L" - ", c); + + LoadStringW(hInstance, IDS_APPTITLE, szResStr, ARRAYSIZE(szResStr)); + StringCbPrintfW(szTitleBuf, sizeof(szTitleBuf), L"%ls%ls%ls", szResStr, L" - ", c); SetWindowTextW(hwnd, szTitleBuf);
if (image) @@ -200,16 +199,15 @@ WCHAR szSearchMask[MAX_PATH]; WCHAR szFileTypes[MAX_PATH]; WIN32_FIND_DATAW findData; - SHIMGVW_FILENODE *currentNode; - SHIMGVW_FILENODE *root; - SHIMGVW_FILENODE *conductor; + SHIMGVW_FILENODE *currentNode = NULL; + SHIMGVW_FILENODE *root = NULL; + SHIMGVW_FILENODE *conductor = NULL; ImageCodecInfo *codecInfo; UINT num; UINT size; UINT j;
- - wcscpy(szSearchPath, szFirstFile); + StringCbCopyW(szSearchPath, sizeof(szSearchPath), szFirstFile); PathRemoveFileSpecW(szSearchPath);
GdipGetImageDecodersSize(&num, &size); @@ -234,19 +232,19 @@
for (j = 0; j < num; ++j) { - StringCbPrintfExW(szFileTypes, MAX_PATH, NULL, NULL, 0, L"%ls", codecInfo[j].FilenameExtension); - + StringCbCopyW(szFileTypes, sizeof(szFileTypes), codecInfo[j].FilenameExtension); + extension = wcstok(szFileTypes, L";"); while (extension != NULL) { - StringCbPrintfExW(szSearchMask, MAX_PATH, NULL, NULL, 0, L"%ls%ls%ls", szSearchPath, L"\", extension); + PathCombineW(szSearchMask, szSearchPath, extension);
hFindHandle = FindFirstFileW(szSearchMask, &findData); if (hFindHandle != INVALID_HANDLE_VALUE) { do { - StringCbPrintfExW(conductor->FileName, MAX_PATH, NULL, NULL, 0, L"%ls%ls%ls", szSearchPath, L"\", findData.cFileName); + PathCombineW(conductor->FileName, szSearchPath, findData.cFileName);
// compare the name of the requested file with the one currently found. // if the name matches, the current node is returned by the function. @@ -261,7 +259,7 @@ if (!conductor->Next) { DPRINT1("malloc() failed in pLoadFileList()\n"); - + conductor->Next = root; root->Prev = conductor;
@@ -286,7 +284,7 @@ // we use this node to store the name of it, otherwise we free it. if (currentNode == NULL) { - StringCbPrintfExW(conductor->FileName, MAX_PATH, NULL, NULL, 0, L"%ls", szFirstFile); + StringCchCopyW(conductor->FileName, MAX_PATH, szFirstFile); currentNode = conductor; } else @@ -503,7 +501,7 @@ ImageView_DrawImage(hwnd); return 0L; } - } + } return CallWindowProc(PrevProc, hwnd, Message, wParam, lParam); }
@@ -793,4 +791,3 @@
return TRUE; } -