diff options
author | Spec-Chum <spec-chum@users.sourceforge.net> | 2010-03-06 02:13:09 +0300 |
---|---|---|
committer | Spec-Chum <spec-chum@users.sourceforge.net> | 2010-03-06 02:13:09 +0300 |
commit | 2eecc28c1541b2a7091498a6e8368bf63752a600 (patch) | |
tree | a75ab44676413538e80283bdc9378b8673e5f35f | |
parent | c5de176f702251deb1cdf8c2fac103d68ecee3ad (diff) |
Fix potential crash by using _MAX_DRIVE (thanks aggro). Also changed all MAX_PATH to _MAX_PATH for consistency across all files
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1732 10f7b99b-c216-0410-bff0-8a66a9350fd8
23 files changed, 62 insertions, 62 deletions
diff --git a/src/DSUtil/DSUtil.cpp b/src/DSUtil/DSUtil.cpp index 772fac0cb..722e61929 100644 --- a/src/DSUtil/DSUtil.cpp +++ b/src/DSUtil/DSUtil.cpp @@ -871,7 +871,7 @@ CString GetDriveLabel(TCHAR drive) CString path;
path.Format(_T("%c:\\"), drive);
- TCHAR VolumeNameBuffer[MAX_PATH], FileSystemNameBuffer[MAX_PATH];
+ TCHAR VolumeNameBuffer[_MAX_PATH], FileSystemNameBuffer[_MAX_PATH];
DWORD VolumeSerialNumber, MaximumComponentLength, FileSystemFlags;
if(GetVolumeInformation(path,
VolumeNameBuffer, MAX_PATH, &VolumeSerialNumber, &MaximumComponentLength,
diff --git a/src/DSUtil/FontInstaller.cpp b/src/DSUtil/FontInstaller.cpp index 16d7114b0..842bdd837 100644 --- a/src/DSUtil/FontInstaller.cpp +++ b/src/DSUtil/FontInstaller.cpp @@ -73,7 +73,7 @@ bool CFontInstaller::InstallFontFile(const void* pData, UINT len) return false;
CFile f;
- TCHAR path[MAX_PATH], fn[MAX_PATH];
+ TCHAR path[_MAX_PATH], fn[_MAX_PATH];
if(!GetTempPath(MAX_PATH, path) || !GetTempFileName(path, _T("g_font"), 0, fn))
return false;
diff --git a/src/apps/mplayerc/FGManager.cpp b/src/apps/mplayerc/FGManager.cpp index b0546defd..0b6e4a75f 100644 --- a/src/apps/mplayerc/FGManager.cpp +++ b/src/apps/mplayerc/FGManager.cpp @@ -2624,7 +2624,7 @@ STDMETHODIMP CFGManagerDVD::AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpc if(!((pDVDC = pBF) && (pDVDI = pBF)))
return E_NOINTERFACE;
- WCHAR buff[MAX_PATH];
+ WCHAR buff[_MAX_PATH];
ULONG len;
if((!fn.IsEmpty()
&& FAILED(hr = pDVDC->SetDVDDirectory(fn))
diff --git a/src/apps/mplayerc/IPinHook.cpp b/src/apps/mplayerc/IPinHook.cpp index 662956bb5..98d222524 100644 --- a/src/apps/mplayerc/IPinHook.cpp +++ b/src/apps/mplayerc/IPinHook.cpp @@ -1002,7 +1002,7 @@ static HRESULT STDMETHODCALLTYPE ExecuteMine(IAMVideoAcceleratorC* This, DWORD d LogDXVA_Bitstream(g_ppBuffer[pamvaBufferInfo[i].dwTypeIndex], pamvaBufferInfo[i].dwDataSize);
#if defined(LOG_BITSTREAM) && defined(_DEBUG)
- char strFile[MAX_PATH];
+ char strFile[_MAX_PATH];
static int nNb = 1;
sprintf (strFile, "BitStream%d.bin", nNb++);
FILE* hFile = fopen (strFile, "wb");
@@ -1252,7 +1252,7 @@ public : #if defined(LOG_MATRIX) && defined(_DEBUG)
if (pExecuteParams->pCompressedBuffers[i].CompressedBufferType == DXVA2_InverseQuantizationMatrixBufferType)
{
- char strFile[MAX_PATH];
+ char strFile[_MAX_PATH];
static int nNb = 1;
sprintf (strFile, "Matrix%d.bin", nNb++);
FILE* hFile = fopen (strFile, "wb");
@@ -1272,7 +1272,7 @@ public : {
LogDXVA_Bitstream(m_ppBuffer[pExecuteParams->pCompressedBuffers[i].CompressedBufferType], pExecuteParams->pCompressedBuffers[i].DataSize);
#if defined(LOG_BITSTREAM)
- char strFile[MAX_PATH];
+ char strFile[_MAX_PATH];
static int nNb = 1;
sprintf (strFile, "BitStream%d.bin", nNb++);
FILE* hFile = fopen (strFile, "wb");
diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index dc7f87126..1c9835376 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -3942,7 +3942,7 @@ void CMainFrame::OnFileOpendvd() OpenMedia(p);*/
AppSettings& s = AfxGetAppSettings();
- TCHAR path[MAX_PATH];
+ TCHAR path[_MAX_PATH];
CString strTitle = ResStr(IDS_MAINFRM_46);
BROWSEINFO bi;
@@ -7677,7 +7677,7 @@ void CMainFrame::OnFavoritesAdd() }
else if(m_iPlaybackMode == PM_DVD)
{
- WCHAR path[MAX_PATH];
+ WCHAR path[_MAX_PATH];
ULONG len = 0;
pDVDI->GetDVDDirectory(path, MAX_PATH, &len);
CString fn = path;
@@ -7788,7 +7788,7 @@ void CMainFrame::OnFavoritesQuickAddFavorite() }
else if(m_iPlaybackMode == PM_DVD)
{
- WCHAR path[MAX_PATH];
+ WCHAR path[_MAX_PATH];
ULONG len = 0;
pDVDI->GetDVDDirectory(path, MAX_PATH, &len);
CString fn = path;
@@ -9344,7 +9344,7 @@ void CMainFrame::OpenDVD(OpenDVDData* pODD) else if(FAILED(hr))
throw ResStr(IDS_AG_FAILED);
- WCHAR buff[MAX_PATH];
+ WCHAR buff[_MAX_PATH];
ULONG len = 0;
if(SUCCEEDED(hr = pDVDI->GetDVDDirectory(buff, countof(buff), &len)))
pODD->title = CString(CStringW(buff));
@@ -13436,7 +13436,7 @@ void CMainFrame::OnFileOpendirectory() f_lastOpenDir = s.f_lastOpenDir;
- TCHAR path[MAX_PATH];
+ TCHAR path[_MAX_PATH];
m_incl_subdir = TRUE;
CString strTitle = ResStr(IDS_MAINFRM_DIR_TITLE);
diff --git a/src/apps/mplayerc/OpenFileDlg.cpp b/src/apps/mplayerc/OpenFileDlg.cpp index 3ea90ed73..8d4a59bc5 100644 --- a/src/apps/mplayerc/OpenFileDlg.cpp +++ b/src/apps/mplayerc/OpenFileDlg.cpp @@ -119,7 +119,7 @@ BOOL COpenFileDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) BOOL COpenFileDlg::OnIncludeItem(OFNOTIFYEX* pOFNEx, LRESULT* pResult)
{
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
if(!SHGetPathFromIDList((LPCITEMIDLIST)pOFNEx->pidl, buff))
{
STRRET s;
diff --git a/src/apps/mplayerc/PPageDVD.cpp b/src/apps/mplayerc/PPageDVD.cpp index 5d5d34766..cad95b671 100644 --- a/src/apps/mplayerc/PPageDVD.cpp +++ b/src/apps/mplayerc/PPageDVD.cpp @@ -281,7 +281,7 @@ BOOL CPPageDVD::OnApply() void CPPageDVD::OnBnClickedButton1()
{
- TCHAR path[MAX_PATH];
+ TCHAR path[_MAX_PATH];
BROWSEINFO bi;
bi.hwndOwner = m_hWnd;
diff --git a/src/apps/mplayerc/PPageFormats.cpp b/src/apps/mplayerc/PPageFormats.cpp index 94603c82a..703bf6272 100644 --- a/src/apps/mplayerc/PPageFormats.cpp +++ b/src/apps/mplayerc/PPageFormats.cpp @@ -108,7 +108,7 @@ CString CPPageFormats::GetEnqueueCommand() {
CString path;
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
if(::GetModuleFileName(AfxGetInstanceHandle(), buff, MAX_PATH) == 0)
return _T("");
@@ -119,7 +119,7 @@ CString CPPageFormats::GetEnqueueCommand() CString CPPageFormats::GetOpenCommand()
{
CString path;
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
if(::GetModuleFileName(AfxGetInstanceHandle(), buff, MAX_PATH) == 0)
return _T("");
@@ -168,7 +168,7 @@ bool CPPageFormats::IsRegistered(CString ext) if(!f_setContextFiles)
{
CRegKey key;
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
ULONG len = sizeof(buff);
if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open"), KEY_READ))
@@ -183,7 +183,7 @@ bool CPPageFormats::IsRegistered(CString ext) if (bIsDefault)
{
CRegKey key;
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
ULONG len = sizeof(buff);
bIsDefault = FALSE;
@@ -202,7 +202,7 @@ bool CPPageFormats::IsRegistered(CString ext) CString GetProgramDir()
{
CString RtnVal;
- TCHAR FileName[MAX_PATH];
+ TCHAR FileName[_MAX_PATH];
::GetModuleFileName(AfxGetInstanceHandle(), FileName, MAX_PATH);
RtnVal = FileName;
RtnVal = RtnVal.Left(RtnVal.ReverseFind('\\'));
@@ -294,7 +294,7 @@ bool CPPageFormats::RegisterExt(CString ext, CString strLabel, bool fRegister) if(f_setAssociatedWithIcon)
{
CString AppIcon = _T("");
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
CString mpciconlib = GetProgramDir() + _T("\\mpciconlib.dll");
@@ -346,7 +346,7 @@ void CPPageFormats::AddAutoPlayToRegistry(autoplay_t ap, bool fRegister) {
if(!AfxGetAppSettings().fXpOrBetter) return;
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
if(::GetModuleFileName(AfxGetInstanceHandle(), buff, MAX_PATH) == 0) return;
CString exe = buff;
@@ -391,7 +391,7 @@ void CPPageFormats::AddAutoPlayToRegistry(autoplay_t ap, bool fRegister) bool CPPageFormats::IsAutoPlayRegistered(autoplay_t ap)
{
ULONG len;
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
if(::GetModuleFileName(AfxGetInstanceHandle(), buff, MAX_PATH) == 0) return(false);
CString exe = buff;
@@ -553,7 +553,7 @@ BOOL CPPageFormats::OnInitDialog() CRegKey key;
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
ULONG len = sizeof(buff);
int fContextDir = 0;
@@ -718,7 +718,7 @@ BOOL CPPageFormats::OnApply() CMediaFormats& mf = AfxGetAppSettings().Formats;
CString AppIcon = _T("");
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
if(::GetModuleFileName(AfxGetInstanceHandle(), buff, MAX_PATH))
{
@@ -972,7 +972,7 @@ void CPPageFormats::OnBnClickedButton13() void CPPageFormats::OnBnVistaModify()
{
CString strCmd;
- TCHAR strApp [MAX_PATH];
+ TCHAR strApp [_MAX_PATH];
strCmd.Format (_T("/adminoption %d"), IDD);
GetModuleFileNameEx (GetCurrentProcess(), AfxGetMyApp()->m_hInstance, strApp, MAX_PATH);
diff --git a/src/apps/mplayerc/PPageWebServer.cpp b/src/apps/mplayerc/PPageWebServer.cpp index 316989802..75db49fd8 100644 --- a/src/apps/mplayerc/PPageWebServer.cpp +++ b/src/apps/mplayerc/PPageWebServer.cpp @@ -181,7 +181,7 @@ static int __stdcall BrowseCtrlCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPA bool CPPageWebServer::PickDir(CString& dir)
{
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
BROWSEINFO bi;
bi.hwndOwner = m_hWnd;
diff --git a/src/apps/mplayerc/PlayerPlaylistBar.cpp b/src/apps/mplayerc/PlayerPlaylistBar.cpp index 256e469c5..58979b26d 100644 --- a/src/apps/mplayerc/PlayerPlaylistBar.cpp +++ b/src/apps/mplayerc/PlayerPlaylistBar.cpp @@ -281,7 +281,7 @@ void CPlayerPlaylistBar::ParsePlayList(CAtlList<CString>& fns, CAtlList<CString> while(pSL && pPF && pos)
{
CString& fn = fns.GetNext(pos);
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
if(CPath(fn).GetExtension().MakeLower() != _T(".lnk")
|| FAILED(pPF->Load(CStringW(fn), STGM_READ))
|| FAILED(pSL->Resolve(NULL, SLR_ANY_MATCH|SLR_NO_UI))
@@ -1095,7 +1095,7 @@ void CPlayerPlaylistBar::DropItemOnList() m_ptDropPoint.y += 10; //
m_nDropIndex = m_list.HitTest(CPoint(10, m_ptDropPoint.y));
- TCHAR szLabel[MAX_PATH];
+ TCHAR szLabel[_MAX_PATH];
LV_ITEM lvi;
ZeroMemory(&lvi, sizeof(LV_ITEM));
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE | LVIF_PARAM;
diff --git a/src/apps/mplayerc/QuicktimeGraph.cpp b/src/apps/mplayerc/QuicktimeGraph.cpp index 7d8c38326..8a959594d 100644 --- a/src/apps/mplayerc/QuicktimeGraph.cpp +++ b/src/apps/mplayerc/QuicktimeGraph.cpp @@ -446,7 +446,7 @@ bool CQuicktimeWindow::OpenMovie(CString fn) if(!(fn.GetLength() > 0 && fn.GetLength() < 255))
return(false);
- CHAR buff[MAX_PATH] = {0, 0};
+ CHAR buff[_MAX_PATH] = {0, 0};
#ifdef UNICODE
WideCharToMultiByte(GetACP(), 0, fn, -1, buff+1, MAX_PATH-1, 0, 0);
#else
diff --git a/src/apps/mplayerc/RealMediaGraph.cpp b/src/apps/mplayerc/RealMediaGraph.cpp index 6784a1234..b549acba5 100644 --- a/src/apps/mplayerc/RealMediaGraph.cpp +++ b/src/apps/mplayerc/RealMediaGraph.cpp @@ -63,7 +63,7 @@ bool CRealMediaPlayer::Init() if(ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, prefs + _T("\\DT_Common"), KEY_READ))
return(false);
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
ULONG len = sizeof(buff);
if(ERROR_SUCCESS != key.QueryStringValue(NULL, buff, &len))
return(false);
@@ -88,7 +88,7 @@ bool CRealMediaPlayer::Init() for(int i = 0; ERROR_SUCCESS == key.EnumKey(i, buff, &len); i++, len = sizeof(buff))
{
CRegKey key2;
- TCHAR buff2[MAX_PATH];
+ TCHAR buff2[_MAX_PATH];
ULONG len2 = sizeof(buff2);
if(ERROR_SUCCESS != key2.Open(HKEY_CLASSES_ROOT, prefs + _T("\\") + buff, KEY_READ)
|| ERROR_SUCCESS != key2.QueryStringValue(NULL, buff2, &len2))
@@ -600,7 +600,7 @@ STDMETHODIMP CRealMediaGraph::RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPla {
m_fn = lpcwstrFile;
- CHAR buff[MAX_PATH] = {0};
+ CHAR buff[_MAX_PATH] = {0};
WideCharToMultiByte(GetACP(), 0, lpcwstrFile, -1, buff, MAX_PATH, 0, 0);
CStringA fn(buff);
diff --git a/src/apps/mplayerc/WebServer.cpp b/src/apps/mplayerc/WebServer.cpp index fcb81c7da..ca25c7fad 100644 --- a/src/apps/mplayerc/WebServer.cpp +++ b/src/apps/mplayerc/WebServer.cpp @@ -432,7 +432,7 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b ExplodeMin(accept_encoding, sl, ',');
if(!sl.Find(_T("gzip"))) break;
- CHAR path[MAX_PATH], fn[MAX_PATH];
+ CHAR path[_MAX_PATH], fn[_MAX_PATH];
if(!GetTempPathA(MAX_PATH, path) || !GetTempFileNameA(path, "mpc_gz", 0, fn))
break;
diff --git a/src/apps/mplayerc/mplayerc.cpp b/src/apps/mplayerc/mplayerc.cpp index 914e57971..3834fd342 100644 --- a/src/apps/mplayerc/mplayerc.cpp +++ b/src/apps/mplayerc/mplayerc.cpp @@ -288,7 +288,7 @@ CMPlayerCApp::CMPlayerCApp() // : m_hMutexOneInstance(NULL)
{
CFileVersionInfo Version;
- TCHAR strApp [MAX_PATH];
+ TCHAR strApp [_MAX_PATH];
GetModuleFileNameEx (GetCurrentProcess(), AfxGetMyApp()->m_hInstance, strApp, MAX_PATH);
Version.Create (strApp);
@@ -624,9 +624,9 @@ HANDLE WINAPI Mine_CreateFileA(LPCSTR p1, DWORD p2, DWORD p3, LPSECURITY_ATTRIBU BOOL CreateFakeVideoTS(LPCWSTR strIFOPath, LPWSTR strFakeFile, size_t nFakeFileSize)
{
BOOL bRet = FALSE;
- WCHAR szTempPath[MAX_PATH];
- WCHAR strFileName[MAX_PATH];
- WCHAR strExt[10];
+ WCHAR szTempPath[_MAX_PATH];
+ WCHAR strFileName[_MAX_PATH];
+ WCHAR strExt[_MAX_EXT];
CIfo Ifo;
if (!GetTempPathW(MAX_PATH, szTempPath)) return FALSE;
@@ -647,7 +647,7 @@ BOOL CreateFakeVideoTS(LPCWSTR strIFOPath, LPWSTR strFakeFile, size_t nFakeFileS HANDLE WINAPI Mine_CreateFileW(LPCWSTR p1, DWORD p2, DWORD p3, LPSECURITY_ATTRIBUTES p4, DWORD p5, DWORD p6, HANDLE p7)
{
HANDLE hFile = INVALID_HANDLE_VALUE;
- WCHAR strFakeFile[MAX_PATH];
+ WCHAR strFakeFile[_MAX_PATH];
int nLen = wcslen(p1);
p3 |= FILE_SHARE_WRITE;
diff --git a/src/filters/BaseClasses/dllsetup.cpp b/src/filters/BaseClasses/dllsetup.cpp index fe0883895..c14c2f8e1 100644 --- a/src/filters/BaseClasses/dllsetup.cpp +++ b/src/filters/BaseClasses/dllsetup.cpp @@ -116,7 +116,7 @@ AMovieSetupRegisterServer( CLSID clsServer {
// temp buffer
//
- TCHAR achTemp[MAX_PATH];
+ TCHAR achTemp[_MAX_PATH];
// convert CLSID uuid to string and write
// out subkey as string - CLSID\{}
@@ -376,12 +376,12 @@ AMovieDllRegisterServer2( BOOL bRegister ) // get file name (where g_hInst is the
// instance handle of the filter dll)
//
- WCHAR achFileName[MAX_PATH];
+ WCHAR achFileName[_MAX_PATH];
// WIN95 doesn't support GetModuleFileNameW
//
{
- char achTemp[MAX_PATH];
+ char achTemp[_MAX_PATH];
DbgLog((LOG_TRACE, 2, TEXT("- get module file name")));
@@ -538,12 +538,12 @@ AMovieDllRegisterServer( void ) // get file name (where g_hInst is the
// instance handle of the filter dll)
//
- WCHAR achFileName[MAX_PATH];
+ WCHAR achFileName[_MAX_PATH];
{
// WIN95 doesn't support GetModuleFileNameW
//
- char achTemp[MAX_PATH];
+ char achTemp[_MAX_PATH];
if( 0 == GetModuleFileNameA( g_hInst
, achTemp
diff --git a/src/filters/BaseClasses/wxdebug.cpp b/src/filters/BaseClasses/wxdebug.cpp index 4f0e9bdd8..d6aa59802 100644 --- a/src/filters/BaseClasses/wxdebug.cpp +++ b/src/filters/BaseClasses/wxdebug.cpp @@ -248,7 +248,7 @@ HRESULT DbgUniqueProcessName(LPCTSTR inName, LPTSTR outName) }
else
{
- TCHAR pathAndBasename[MAX_PATH] = {0};
+ TCHAR pathAndBasename[_MAX_PATH] = {0};
//there's an extension - zero-terminate the path and basename first by copying
hr = StringCchCopyN(pathAndBasename, MAX_PATH, inName, (size_t)dotPos);
@@ -271,7 +271,7 @@ void WINAPI DbgInitLogTo ( LONG lReturn;
DWORD dwKeyType;
DWORD dwKeySize;
- TCHAR szFile[MAX_PATH] = {0};
+ TCHAR szFile[_MAX_PATH] = {0};
static const TCHAR cszKey[] = TEXT("LogToFile");
dwKeySize = MAX_PATH;
@@ -326,7 +326,7 @@ void WINAPI DbgInitLogTo ( if (INVALID_HANDLE_VALUE == m_hOutput &&
GetLastError() == ERROR_SHARING_VIOLATION)
{
- TCHAR uniqueName[MAX_PATH] = {0};
+ TCHAR uniqueName[_MAX_PATH] = {0};
if (SUCCEEDED(DbgUniqueProcessName(szFile, uniqueName)))
{
m_hOutput = CreateFile(uniqueName, GENERIC_WRITE,
diff --git a/src/filters/parser/BaseSplitter/AsyncReader.cpp b/src/filters/parser/BaseSplitter/AsyncReader.cpp index fc5b9d041..2231aa440 100644 --- a/src/filters/parser/BaseSplitter/AsyncReader.cpp +++ b/src/filters/parser/BaseSplitter/AsyncReader.cpp @@ -170,7 +170,7 @@ DWORD CAsyncUrlReader::ThreadProc() CInternetSession is;
CAutoPtr<CStdioFile> fin(is.OpenURL(m_url, 1, INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_EXISTING_CONNECT|INTERNET_FLAG_NO_CACHE_WRITE));
- TCHAR path[MAX_PATH], fn[MAX_PATH];
+ TCHAR path[_MAX_PATH], fn[_MAX_PATH];
CFile fout;
if(GetTempPath(MAX_PATH, path) && GetTempFileName(path, _T("mpc_http"), 0, fn)
&& fout.Open(fn, modeCreate|modeWrite|shareDenyWrite|typeBinary))
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp index a9503351d..71b63d9b2 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp @@ -127,10 +127,10 @@ void CMpegSplitterFilter::ReadClipInfo(LPCOLESTR pszFileName) {
if (wcslen (pszFileName) > 0)
{
- WCHAR Drive[5];
- WCHAR Dir[MAX_PATH];
- WCHAR Filename[MAX_PATH];
- WCHAR Ext[10];
+ WCHAR Drive[_MAX_DRIVE];
+ WCHAR Dir[_MAX_PATH];
+ WCHAR Filename[_MAX_PATH];
+ WCHAR Ext[_MAX_EXT];
if (_wsplitpath_s (pszFileName, Drive, countof(Drive), Dir, countof(Dir), Filename, countof(Filename), Ext, countof(Ext)) == 0)
{
diff --git a/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp b/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp index 0fb806e93..e133b8435 100644 --- a/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp +++ b/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp @@ -1749,7 +1749,7 @@ HRESULT CRealVideoDecoder::CheckInputType(const CMediaType* mtIn) _T("drvc.dll");
CRegKey key;
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
ULONG len = sizeof(buff);
if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Software\\RealNetworks\\Preferences\\DT_Codecs"), KEY_READ)
&& ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && _tcslen(buff) > 0)
@@ -2189,7 +2189,7 @@ HRESULT CRealAudioDecoder::CheckInputType(const CMediaType* mtIn) newdll.Format(_T("%s.dll"), fourcc);
CRegKey key;
- TCHAR buff[MAX_PATH];
+ TCHAR buff[_MAX_PATH];
ULONG len = sizeof(buff);
if(ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Software\\RealNetworks\\Preferences\\DT_Codecs"), KEY_READ)
&& ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && _tcslen(buff) > 0)
@@ -2241,7 +2241,7 @@ HRESULT CRealAudioDecoder::CheckInputType(const CMediaType* mtIn) if(m_hDrvDll)
{
- char buff[MAX_PATH];
+ char buff[_MAX_PATH];
GetModuleFileNameA(m_hDrvDll, buff, MAX_PATH);
CPathA p(buff);
p.RemoveFileSpec();
diff --git a/src/filters/source/SubtitleSource/SubtitleSource.cpp b/src/filters/source/SubtitleSource/SubtitleSource.cpp index 9beeb97fb..0bddf17a8 100644 --- a/src/filters/source/SubtitleSource/SubtitleSource.cpp +++ b/src/filters/source/SubtitleSource/SubtitleSource.cpp @@ -628,7 +628,7 @@ HRESULT CSubtitleSourceSSA::GetMediaType(CMediaType* pmt) sts.RemoveAll();
CFile f;
- TCHAR path[MAX_PATH], fn[MAX_PATH];
+ TCHAR path[_MAX_PATH], fn[_MAX_PATH];
if(!GetTempPath(MAX_PATH, path) || !GetTempFileName(path, _T("mpc_sts"), 0, fn))
return E_FAIL;
@@ -677,7 +677,7 @@ HRESULT CSubtitleSourceASS::GetMediaType(CMediaType* pmt) sts.RemoveAll();
CFile f;
- TCHAR path[MAX_PATH], fn[MAX_PATH];
+ TCHAR path[_MAX_PATH], fn[_MAX_PATH];
if(!GetTempPath(MAX_PATH, path) || !GetTempFileName(path, _T("mpc_sts"), 0, fn))
return E_FAIL;
diff --git a/src/subtitles/STS.cpp b/src/subtitles/STS.cpp index a35999083..c91109791 100644 --- a/src/subtitles/STS.cpp +++ b/src/subtitles/STS.cpp @@ -1261,7 +1261,7 @@ static bool LoadFont(CString& font) if(hFont == INVALID_HANDLE_VALUE)
{
- TCHAR path[MAX_PATH];
+ TCHAR path[_MAX_PATH];
GetTempPath(MAX_PATH, path);
DWORD chksum = 0;
@@ -2714,10 +2714,10 @@ bool CSimpleTextSubtitle::Open(CTextFile* f, int CharSet, CString name) bool CSimpleTextSubtitle::Open(BYTE* data, int len, int CharSet, CString name)
{
- TCHAR path[MAX_PATH];
+ TCHAR path[_MAX_PATH];
if(!GetTempPath(MAX_PATH, path)) return(false);
- TCHAR fn[MAX_PATH];
+ TCHAR fn[_MAX_PATH];
if(!GetTempFileName(path, _T("vs"), 0, fn)) return(false);
FILE* tmp = _tfopen(fn, _T("wb"));
diff --git a/src/subtitles/TextFile.cpp b/src/subtitles/TextFile.cpp index 1f86a2aa0..1dfb62750 100644 --- a/src/subtitles/TextFile.cpp +++ b/src/subtitles/TextFile.cpp @@ -428,7 +428,7 @@ bool CWebTextFile::Open(LPCTSTR lpszFileName) CAutoPtr<CStdioFile> f(is.OpenURL(fn, 1, INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_EXISTING_CONNECT));
if(!f) return(false);
- TCHAR path[MAX_PATH];
+ TCHAR path[_MAX_PATH];
GetTempPath(MAX_PATH, path);
fn = path + fn.Mid(fn.ReverseFind('/')+1);
diff --git a/src/subtitles/VobSubFile.cpp b/src/subtitles/VobSubFile.cpp index e584ce64f..f2490c9ae 100644 --- a/src/subtitles/VobSubFile.cpp +++ b/src/subtitles/VobSubFile.cpp @@ -714,7 +714,7 @@ bool CVobSubFile::ReadRar(CString fn) memset(&ArchiveDataEx, 0, sizeof(ArchiveDataEx));
#ifdef UNICODE
ArchiveDataEx.ArcNameW = (LPTSTR)(LPCTSTR)fn;
- char fnA[MAX_PATH];
+ char fnA[_MAX_PATH];
if(wcstombs(fnA, fn, fn.GetLength()+1) == -1) fnA[0] = 0;
ArchiveDataEx.ArcName = fnA;
#else
@@ -1683,7 +1683,7 @@ bool CVobSubFile::SaveScenarist(CString fn) fn.Replace('\\', '/');
CString title = fn.Mid(fn.ReverseFind('/')+1);
- TCHAR buff[MAX_PATH], * pFilePart = buff;
+ TCHAR buff[_MAX_PATH], * pFilePart = buff;
if(GetFullPathName(fn, MAX_PATH, buff, &pFilePart) == 0)
return(false);
@@ -1918,7 +1918,7 @@ bool CVobSubFile::SaveMaestro(CString fn) fn.Replace('\\', '/');
CString title = fn.Mid(fn.ReverseFind('/')+1);
- TCHAR buff[MAX_PATH], * pFilePart = buff;
+ TCHAR buff[_MAX_PATH], * pFilePart = buff;
if(GetFullPathName(fn, MAX_PATH, buff, &pFilePart) == 0)
return(false);
|