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 /src/apps | |
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
Diffstat (limited to 'src/apps')
-rw-r--r-- | src/apps/mplayerc/FGManager.cpp | 2 | ||||
-rw-r--r-- | src/apps/mplayerc/IPinHook.cpp | 6 | ||||
-rw-r--r-- | src/apps/mplayerc/MainFrm.cpp | 10 | ||||
-rw-r--r-- | src/apps/mplayerc/OpenFileDlg.cpp | 2 | ||||
-rw-r--r-- | src/apps/mplayerc/PPageDVD.cpp | 2 | ||||
-rw-r--r-- | src/apps/mplayerc/PPageFormats.cpp | 22 | ||||
-rw-r--r-- | src/apps/mplayerc/PPageWebServer.cpp | 2 | ||||
-rw-r--r-- | src/apps/mplayerc/PlayerPlaylistBar.cpp | 4 | ||||
-rw-r--r-- | src/apps/mplayerc/QuicktimeGraph.cpp | 2 | ||||
-rw-r--r-- | src/apps/mplayerc/RealMediaGraph.cpp | 6 | ||||
-rw-r--r-- | src/apps/mplayerc/WebServer.cpp | 2 | ||||
-rw-r--r-- | src/apps/mplayerc/mplayerc.cpp | 10 |
12 files changed, 35 insertions, 35 deletions
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;
|