From 09ad06898705ff63fc792589af6f3fd4f96f8b56 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 13 Feb 2009 17:14:29 +0000 Subject: [PATCH] sync avifil32 with wine 1.1.15 svn path=/trunk/; revision=39583 --- reactos/dll/win32/avifil32/acmstream.c | 2 +- reactos/dll/win32/avifil32/api.c | 2 +- reactos/dll/win32/avifil32/avifile.c | 28 +++--- reactos/dll/win32/avifil32/avifile_Ja.rc | 35 ++++---- reactos/dll/win32/avifil32/avifile_Ko.rc | 4 +- reactos/dll/win32/avifil32/avifile_Si.rc | 2 +- reactos/dll/win32/avifil32/avifile_Uk.rc | 23 +++-- reactos/dll/win32/avifil32/avifile_Zh.rc | 90 ++++++++++++++++++++ reactos/dll/win32/avifil32/avifile_private.h | 2 +- reactos/dll/win32/avifil32/editstream.c | 10 +-- reactos/dll/win32/avifil32/extrachunk.c | 30 ++++--- reactos/dll/win32/avifil32/extrachunk.h | 2 +- reactos/dll/win32/avifil32/factory.c | 2 +- reactos/dll/win32/avifil32/getframe.c | 2 +- reactos/dll/win32/avifil32/icmstream.c | 24 +++--- reactos/dll/win32/avifil32/regsvr.c | 3 +- reactos/dll/win32/avifil32/rsrc.rc | 1 + reactos/dll/win32/avifil32/tmpfile.c | 2 +- reactos/dll/win32/avifil32/wavfile.c | 6 +- 19 files changed, 192 insertions(+), 78 deletions(-) create mode 100644 reactos/dll/win32/avifil32/avifile_Zh.rc diff --git a/reactos/dll/win32/avifil32/acmstream.c b/reactos/dll/win32/avifil32/acmstream.c index 378ff7f7885..7794f54ab06 100644 --- a/reactos/dll/win32/avifil32/acmstream.c +++ b/reactos/dll/win32/avifil32/acmstream.c @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Gnnewig + * Copyright 2002 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/avifil32/api.c b/reactos/dll/win32/avifil32/api.c index 12eb1b7c21f..27744ee56b0 100644 --- a/reactos/dll/win32/avifil32/api.c +++ b/reactos/dll/win32/avifil32/api.c @@ -1,6 +1,6 @@ /* * Copyright 1999 Marcus Meissner - * Copyright 2002-2003 Michael Gnnewig + * Copyright 2002-2003 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/avifil32/avifile.c b/reactos/dll/win32/avifil32/avifile.c index b0ef1cb769a..1719031394c 100644 --- a/reactos/dll/win32/avifil32/avifile.c +++ b/reactos/dll/win32/avifil32/avifile.c @@ -1,6 +1,6 @@ /* * Copyright 1999 Marcus Meissner - * Copyright 2002-2003 Michael Gnnewig + * Copyright 2002-2003 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -217,7 +217,7 @@ static HRESULT AVIFILE_LoadIndex(const IAVIFileImpl *This, DWORD size, DWORD off static HRESULT AVIFILE_ParseIndex(const IAVIFileImpl *This, AVIINDEXENTRY *lp, LONG count, DWORD pos, BOOL *bAbsolute); static HRESULT AVIFILE_ReadBlock(IAVIStreamImpl *This, DWORD start, - LPVOID buffer, LONG size); + LPVOID buffer, DWORD size); static void AVIFILE_SamplesToBlock(const IAVIStreamImpl *This, LPLONG pos, LPLONG offset); static HRESULT AVIFILE_SaveFile(IAVIFileImpl *This); @@ -931,7 +931,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos, { IAVIStreamImpl *This = (IAVIStreamImpl *)iface; - LPBITMAPINFOHEADER lpbiNew = (LPBITMAPINFOHEADER)format; + LPBITMAPINFOHEADER lpbiNew = format; TRACE("(%p,%d,%p,%d)\n", iface, pos, format, formatsize); @@ -976,7 +976,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos, return AVIERR_OK; } else { MMCKINFO ck; - LPBITMAPINFOHEADER lpbiOld = (LPBITMAPINFOHEADER)This->lpFormat; + LPBITMAPINFOHEADER lpbiOld = This->lpFormat; RGBQUAD *rgbNew = (RGBQUAD*)((LPBYTE)lpbiNew + lpbiNew->biSize); AVIPALCHANGE *lppc = NULL; UINT n; @@ -1688,7 +1688,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This) return AVIERR_MEMORY; pStream->cbHandlerData = ck.cksize; - if (mmioRead(This->hmmio, (HPSTR)pStream->lpHandlerData, ck.cksize) != ck.cksize) + if (mmioRead(This->hmmio, pStream->lpHandlerData, ck.cksize) != ck.cksize) return AVIERR_FILEREAD; break; case ckidSTREAMFORMAT: @@ -1702,11 +1702,11 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This) return AVIERR_MEMORY; pStream->cbFormat = ck.cksize; - if (mmioRead(This->hmmio, (HPSTR)pStream->lpFormat, ck.cksize) != ck.cksize) + if (mmioRead(This->hmmio, pStream->lpFormat, ck.cksize) != ck.cksize) return AVIERR_FILEREAD; if (pStream->sInfo.fccType == streamtypeVIDEO) { - LPBITMAPINFOHEADER lpbi = (LPBITMAPINFOHEADER)pStream->lpFormat; + LPBITMAPINFOHEADER lpbi = pStream->lpFormat; /* some corrections to the video format */ if (lpbi->biClrUsed == 0 && lpbi->biBitCount <= 8) @@ -2008,7 +2008,7 @@ static HRESULT AVIFILE_ParseIndex(const IAVIFileImpl *This, AVIINDEXENTRY *lp, } static HRESULT AVIFILE_ReadBlock(IAVIStreamImpl *This, DWORD pos, - LPVOID buffer, LONG size) + LPVOID buffer, DWORD size) { /* pre-conditions */ assert(This != NULL); @@ -2059,7 +2059,7 @@ static HRESULT AVIFILE_ReadBlock(IAVIStreamImpl *This, DWORD pos, } else { if (mmioSeek(This->paf->hmmio, This->idxFrames[pos].dwChunkOffset + 2 * sizeof(DWORD), SEEK_SET) == -1) return AVIERR_FILEREAD; - if (mmioRead(This->paf->hmmio, (HPSTR)buffer, size) != size) + if (mmioRead(This->paf->hmmio, buffer, size) != size) return AVIERR_FILEREAD; } @@ -2206,7 +2206,7 @@ static HRESULT AVIFILE_SaveFile(IAVIFileImpl *This) if (mmioCreateChunk(This->hmmio, &ck, 0) != S_OK) return AVIERR_FILEWRITE; if (pStream->lpFormat != NULL && ck.cksize > 0) { - if (mmioWrite(This->hmmio, (HPSTR)pStream->lpFormat, ck.cksize) != ck.cksize) + if (mmioWrite(This->hmmio, pStream->lpFormat, ck.cksize) != ck.cksize) return AVIERR_FILEWRITE; } if (mmioAscend(This->hmmio, &ck, 0) != S_OK) @@ -2218,7 +2218,7 @@ static HRESULT AVIFILE_SaveFile(IAVIFileImpl *This) ck.cksize = pStream->cbHandlerData; if (mmioCreateChunk(This->hmmio, &ck, 0) != S_OK) return AVIERR_FILEWRITE; - if (mmioWrite(This->hmmio, (HPSTR)pStream->lpHandlerData, ck.cksize) != ck.cksize) + if (mmioWrite(This->hmmio, pStream->lpHandlerData, ck.cksize) != ck.cksize) return AVIERR_FILEWRITE; if (mmioAscend(This->hmmio, &ck, 0) != S_OK) return AVIERR_FILEWRITE; @@ -2227,7 +2227,7 @@ static HRESULT AVIFILE_SaveFile(IAVIFileImpl *This) /* ... some optional additional extra chunk for this stream ... */ if (pStream->extra.lp != NULL && pStream->extra.cb > 0) { /* the chunk header(s) are already in the structure */ - if (mmioWrite(This->hmmio, (HPSTR)pStream->extra.lp, pStream->extra.cb) != pStream->extra.cb) + if (mmioWrite(This->hmmio, pStream->extra.lp, pStream->extra.cb) != pStream->extra.cb) return AVIERR_FILEWRITE; } @@ -2302,7 +2302,7 @@ static HRESULT AVIFILE_SaveFile(IAVIFileImpl *This) /* write optional extra file chunks */ if (This->fileextra.lp != NULL && This->fileextra.cb > 0) { /* as for the streams, are the chunk header(s) in the structure */ - if (mmioWrite(This->hmmio, (HPSTR)This->fileextra.lp, This->fileextra.cb) != This->fileextra.cb) + if (mmioWrite(This->hmmio, This->fileextra.lp, This->fileextra.cb) != This->fileextra.cb) return AVIERR_FILEWRITE; } @@ -2562,7 +2562,7 @@ static HRESULT AVIFILE_WriteBlock(IAVIStreamImpl *This, DWORD block, if (mmioCreateChunk(This->paf->hmmio, &ck, 0) != S_OK) return AVIERR_FILEWRITE; if (buffer != NULL && size > 0) { - if (mmioWrite(This->paf->hmmio, (HPSTR)buffer, size) != size) + if (mmioWrite(This->paf->hmmio, buffer, size) != size) return AVIERR_FILEWRITE; } if (mmioAscend(This->paf->hmmio, &ck, 0) != S_OK) diff --git a/reactos/dll/win32/avifil32/avifile_Ja.rc b/reactos/dll/win32/avifil32/avifile_Ja.rc index 37a38240592..ab5bdfe6a7f 100644 --- a/reactos/dll/win32/avifil32/avifile_Ja.rc +++ b/reactos/dll/win32/avifil32/avifile_Ja.rc @@ -16,35 +16,40 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +/* UTF-8 */ +#pragma code_page(65001) + LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "kIvV" -FONT 9, "MS UI Gothic" +CAPTION "圧縮オプション" +FONT 9, "MS Shell Dlg" BEGIN - LTEXT "Xg[I(&C):",-1,2,5,154,10 + LTEXT "ストリームを選択(&C):",-1,2,5,154,10 COMBOBOX IDC_STREAM,2,18,154,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "IvV(&O)...",IDC_OPTIONS,170,17,50,14 - AUTOCHECKBOX "C^[[u(&I)",IDC_INTERLEAVE,3,42,85,11,WS_TABSTOP + PUSHBUTTON "オプション(&O)...",IDC_OPTIONS,170,17,50,14 + AUTOCHECKBOX "インターリーブ(&I)",IDC_INTERLEAVE,3,42,85,11,WS_TABSTOP EDITTEXT IDC_INTERLEAVEEVERY,91,41,32,12,ES_AUTOHSCROLL - LTEXT "t[",-1,129,43,36,9 - LTEXT "݂̃tH[}bg:",-1,3,56,73,9 + LTEXT "フレーム",-1,129,43,36,9 + LTEXT "現在のフォーマット:",-1,3,56,73,9 LTEXT "This space for rent",IDC_FORMATTEXT,75,56,90,26 DEFPUSHBUTTON "OK",IDOK,170,42,50,14 - PUSHBUTTON "LZ",IDCANCEL,170,61,50,14 + PUSHBUTTON "キャンセル",IDCANCEL,170,61,50,14 END STRINGTABLE DISCARDABLE { - IDS_WAVESTREAMFORMAT "Wavet@C: %s" - IDS_WAVEFILETYPE "Wavet@C" - IDS_ALLMULTIMEDIA "SẴ}`fBAt@C" - IDS_ALLFILES "SẴt@C (*.*)@*.*" - IDS_VIDEO "rfI" - IDS_AUDIO "" + IDS_WAVESTREAMFORMAT "Waveファイル: %s" + IDS_WAVEFILETYPE "Waveファイル" + IDS_ALLMULTIMEDIA "全てのマルチメディアファイル" + IDS_ALLFILES "全てのファイル (*.*)@*.*" + IDS_VIDEO "ビデオ" + IDS_AUDIO "音声" IDS_AVISTREAMFORMAT "%s %s #%d" IDS_AVIFILETYPE "Wine AVI-default-filehandler" - IDS_UNCOMPRESSED "k" + IDS_UNCOMPRESSED "未圧縮" } + +#pragma code_page(default) diff --git a/reactos/dll/win32/avifil32/avifile_Ko.rc b/reactos/dll/win32/avifil32/avifile_Ko.rc index 8fbd4078769..46c482122ed 100644 --- a/reactos/dll/win32/avifil32/avifile_Ko.rc +++ b/reactos/dll/win32/avifil32/avifile_Ko.rc @@ -17,12 +17,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -LANGUAGE LANG_KOREAN, SUBLANG_NEUTRAL +LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION " ɼ" -FONT 8, "MS Shell Dlg" +FONT 9, "MS Shell Dlg" BEGIN LTEXT "Ʈ (&C):",-1,2,5,154,10 COMBOBOX IDC_STREAM,2,18,154,61,CBS_DROPDOWNLIST | WS_VSCROLL | diff --git a/reactos/dll/win32/avifil32/avifile_Si.rc b/reactos/dll/win32/avifil32/avifile_Si.rc index 5ed3d138367..579be48d02d 100644 --- a/reactos/dll/win32/avifil32/avifile_Si.rc +++ b/reactos/dll/win32/avifil32/avifile_Si.rc @@ -28,7 +28,7 @@ BEGIN LTEXT "&Izbran tok:",-1,2,5,154,10 COMBOBOX IDC_STREAM,2,18,154,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "&Možnosti...",IDC_OPTIONS,170,17,50,14 + PUSHBUTTON "&Možnosti ...",IDC_OPTIONS,170,17,50,14 AUTOCHECKBOX "&Prepletanje vsake",IDC_INTERLEAVE,3,42,85,11,WS_TABSTOP EDITTEXT IDC_INTERLEAVEEVERY,91,41,32,12,ES_AUTOHSCROLL LTEXT "slike",-1,129,43,36,9 diff --git a/reactos/dll/win32/avifil32/avifile_Uk.rc b/reactos/dll/win32/avifil32/avifile_Uk.rc index 759811a85e9..d380c8ad78c 100644 --- a/reactos/dll/win32/avifil32/avifile_Uk.rc +++ b/reactos/dll/win32/avifil32/avifile_Uk.rc @@ -1,11 +1,22 @@ /* - * PROJECT: AVI File support library - * LICENSE: GPL - See COPYING in the top level directory - * FILE: dll/win32/avifil32/avifile_Uk.rc - * PURPOSE: Ukraianian resource file for avifil32 - * TRANSLATOR: Artem Reznikov + * Copyright 2007 Artem Reznikov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ + LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82 @@ -14,7 +25,7 @@ CAPTION " FONT 8, "MS Shell Dlg" BEGIN LTEXT "& :",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "& ",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Zh.rc b/reactos/dll/win32/avifil32/avifile_Zh.rc new file mode 100644 index 00000000000..0075ed8ecfe --- /dev/null +++ b/reactos/dll/win32/avifil32/avifile_Zh.rc @@ -0,0 +1,90 @@ +/* + * avifile (Simplified and Traditional Chinese Resources) + * + * Copyright 2008 Hongbo Ni + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* Chinese text is encoded in UTF-8 */ +#pragma code_page(65001) + +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED + +IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "压缩选项" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "选择来源(&C):",-1,2,5,154,10 + COMBOBOX IDC_STREAM,2,18,154,61,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP + PUSHBUTTON "选项(&O)...",IDC_OPTIONS,170,17,50,14 + AUTOCHECKBOX "交织: 每",IDC_INTERLEAVE,3,42,85,11,WS_TABSTOP + EDITTEXT IDC_INTERLEAVEEVERY,91,41,32,12,ES_AUTOHSCROLL + LTEXT "帧数",-1,129,43,36,9 + LTEXT "当前格式:",-1,3,56,73,9 + LTEXT "(?)",IDC_FORMATTEXT,75,56,90,26 + DEFPUSHBUTTON "确定",IDOK,170,42,50,14 + PUSHBUTTON "取消",IDCANCEL,170,61,50,14 +END + +STRINGTABLE DISCARDABLE +{ + IDS_WAVESTREAMFORMAT "波形: %s" + IDS_WAVEFILETYPE "波形" + IDS_ALLMULTIMEDIA "所有多媒体文件" + IDS_ALLFILES "所有文件 (*.*)@*.*" + IDS_VIDEO "视频" + IDS_AUDIO "音频" + IDS_AVISTREAMFORMAT "%s %s #%d" + IDS_AVIFILETYPE "Wine AVI-默认处理器" + IDS_UNCOMPRESSED "未压缩" +} + +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL + +IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 226, 82 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "壓縮選項" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "選擇來源(&C):",-1,2,5,154,10 + COMBOBOX IDC_STREAM,2,18,154,61,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP + PUSHBUTTON "選項(&O)...",IDC_OPTIONS,170,17,50,14 + AUTOCHECKBOX "交織: 每",IDC_INTERLEAVE,3,42,85,11,WS_TABSTOP + EDITTEXT IDC_INTERLEAVEEVERY,91,41,32,12,ES_AUTOHSCROLL + LTEXT "幀數",-1,129,43,36,9 + LTEXT "當前格式:",-1,3,56,73,9 + LTEXT "(?)",IDC_FORMATTEXT,75,56,90,26 + DEFPUSHBUTTON "確定",IDOK,170,42,50,14 + PUSHBUTTON "取消",IDCANCEL,170,61,50,14 +END + +STRINGTABLE DISCARDABLE +{ + IDS_WAVESTREAMFORMAT "波形: %s" + IDS_WAVEFILETYPE "波形" + IDS_ALLMULTIMEDIA "所有多媒體檔案" + IDS_ALLFILES "所有檔案 (*.*)@*.*" + IDS_VIDEO "視頻" + IDS_AUDIO "音頻" + IDS_AVISTREAMFORMAT "%s %s #%d" + IDS_AVIFILETYPE "Wine AVI-默認處理器" + IDS_UNCOMPRESSED "未壓縮" +} + +#pragma code_page(default) diff --git a/reactos/dll/win32/avifil32/avifile_private.h b/reactos/dll/win32/avifil32/avifile_private.h index e4ee9633f8c..db31bd497cf 100644 --- a/reactos/dll/win32/avifil32/avifile_private.h +++ b/reactos/dll/win32/avifil32/avifile_private.h @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Gnnewig + * Copyright 2002 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/avifil32/editstream.c b/reactos/dll/win32/avifil32/editstream.c index 8b9eb552f2b..f19f3ac5239 100644 --- a/reactos/dll/win32/avifil32/editstream.c +++ b/reactos/dll/win32/avifil32/editstream.c @@ -1,5 +1,5 @@ /* - * Copyright 2003 Michael Gnnewig + * Copyright 2003 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -261,7 +261,7 @@ static LPVOID AVIFILE_ReadFrame(IAVIEditStreamImpl* const This, if (pg == NULL) return NULL; if (This->pg != NULL) { - if (IGetFrame_SetFormat(pg, This->lpFrame, NULL, 0, 0, -1, -1)) { + if (IGetFrame_SetFormat(pg, This->lpFrame, NULL, 0, 0, -1, -1) != S_OK) { AVIStreamGetFrameClose(pg); ERR(": IGetFrame_SetFormat failed\n"); return NULL; @@ -793,7 +793,7 @@ static HRESULT WINAPI IAVIEditStream_fnSetInfo(IAVIEditStream*iface, if (asi->dwQuality <= ICQUALITY_HIGH) This->sInfo.dwQuality = ICQUALITY_HIGH; CopyRect(&This->sInfo.rcFrame, &asi->rcFrame); - memcpy(&This->sInfo.szName, &asi->szName, sizeof(asi->szName)); + memcpy(This->sInfo.szName, asi->szName, sizeof(asi->szName)); This->sInfo.dwEditCount++; return AVIERR_OK; @@ -896,7 +896,7 @@ static LONG WINAPI IEditAVIStream_fnFindSample(IAVIStream*iface,LONG pos, /* map our position to a stream and position in it */ if (AVIFILE_FindStreamInTable(This, pos, &stream, &streamPos, - &streamNr, TRUE)) + &streamNr, TRUE) != S_OK) return -1; /* doesn't exist */ if (This->bDecompress) { @@ -935,7 +935,7 @@ static HRESULT WINAPI IEditAVIStream_fnReadFormat(IAVIStream*iface,LONG pos, if (! This->bDecompress) return IAVIStream_ReadFormat(stream, n, format, fmtsize); - lp = (LPBITMAPINFOHEADER)AVIFILE_ReadFrame(This, stream, n); + lp = AVIFILE_ReadFrame(This, stream, n); if (lp == NULL) return AVIERR_ERROR; if (lp->biBitCount <= 8) { diff --git a/reactos/dll/win32/avifil32/extrachunk.c b/reactos/dll/win32/avifil32/extrachunk.c index 45096e877a2..48ea77eb644 100644 --- a/reactos/dll/win32/avifil32/extrachunk.c +++ b/reactos/dll/win32/avifil32/extrachunk.c @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Gnnewig + * Copyright 2002 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -145,7 +145,7 @@ HRESULT FindChunkAndKeepExtras(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck, { FOURCC ckid; FOURCC fccType; - HRESULT hr; + MMRESULT mmr; /* pre-conditions */ assert(extra != NULL); @@ -171,26 +171,32 @@ HRESULT FindChunkAndKeepExtras(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck, TRACE(": find ckid=0x%08X fccType=0x%08X\n", ckid, fccType); for (;;) { - hr = mmioDescend(hmmio, lpck, lpckParent, 0); - if (hr != S_OK) { + mmr = mmioDescend(hmmio, lpck, lpckParent, 0); + if (mmr != MMSYSERR_NOERROR) { /* No extra chunks in front of desired chunk? */ - if (flags == 0 && hr == MMIOERR_CHUNKNOTFOUND) - hr = AVIERR_OK; - return hr; + if (flags == 0 && mmr == MMIOERR_CHUNKNOTFOUND) + return AVIERR_OK; + else + return AVIERR_FILEREAD; } /* Have we found what we search for? */ if ((lpck->ckid == ckid) && - (fccType == (FOURCC)0 || lpck->fccType == fccType)) + (fccType == 0 || lpck->fccType == fccType)) return AVIERR_OK; /* Skip padding chunks, the others put into the extrachunk-structure */ if (lpck->ckid == ckidAVIPADDING || lpck->ckid == mmioFOURCC('p','a','d','d')) - hr = mmioAscend(hmmio, lpck, 0); + { + mmr = mmioAscend(hmmio, lpck, 0); + if (mmr != MMSYSERR_NOERROR) return AVIERR_FILEREAD; + } else - hr = ReadChunkIntoExtra(extra, hmmio, lpck); - if (FAILED(hr)) - return hr; + { + HRESULT hr = ReadChunkIntoExtra(extra, hmmio, lpck); + if (FAILED(hr)) + return hr; + } } } diff --git a/reactos/dll/win32/avifil32/extrachunk.h b/reactos/dll/win32/avifil32/extrachunk.h index 3e097ba09c4..1eda7ef33c3 100644 --- a/reactos/dll/win32/avifil32/extrachunk.h +++ b/reactos/dll/win32/avifil32/extrachunk.h @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Gnnewig + * Copyright 2002 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/avifil32/factory.c b/reactos/dll/win32/avifil32/factory.c index 6d9afa31a59..d1246e8e99c 100644 --- a/reactos/dll/win32/avifil32/factory.c +++ b/reactos/dll/win32/avifil32/factory.c @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Gnnewig + * Copyright 2002 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/avifil32/getframe.c b/reactos/dll/win32/avifil32/getframe.c index fd3ec561a95..428901e8e34 100644 --- a/reactos/dll/win32/avifil32/getframe.c +++ b/reactos/dll/win32/avifil32/getframe.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2003 Michael Gnnewig + * Copyright 2002-2003 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/avifil32/icmstream.c b/reactos/dll/win32/avifil32/icmstream.c index 8ac2e33682f..dba120bd8eb 100644 --- a/reactos/dll/win32/avifil32/icmstream.c +++ b/reactos/dll/win32/avifil32/icmstream.c @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Gnnewig + * Copyright 2002 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -393,7 +393,7 @@ static HRESULT WINAPI ICMStream_fnReadFormat(IAVIStream *iface, LONG pos, return hr; } - lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(This->pg, pos); + lpbi = AVIStreamGetFrame(This->pg, pos); if (lpbi == NULL) return AVIERR_MEMORY; @@ -538,7 +538,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos, } } else { /* format change -- check that's only the palette */ - LPBITMAPINFOHEADER lpbi = (LPBITMAPINFOHEADER)format; + LPBITMAPINFOHEADER lpbi = format; if (lpbi->biSize != This->lpbiInput->biSize || lpbi->biWidth != This->lpbiInput->biWidth || @@ -611,7 +611,7 @@ static HRESULT WINAPI ICMStream_fnRead(IAVIStream *iface, LONG start, /* compress or decompress? */ if (This->hic == NULL) { /* decompress */ - lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(This->pg, start); + lpbi = AVIStreamGetFrame(This->pg, start); if (lpbi == NULL) return AVIERR_MEMORY; @@ -634,7 +634,7 @@ static HRESULT WINAPI ICMStream_fnRead(IAVIStream *iface, LONG start, while (start > This->lCurrent) { HRESULT hr; - lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(This->pg, ++This->lCurrent); + lpbi = AVIStreamGetFrame(This->pg, ++This->lCurrent); if (lpbi == NULL) { AVIFILE_Reset(This); return AVIERR_MEMORY; @@ -821,14 +821,14 @@ static HRESULT AVIFILE_EncodeFrame(IAVIStreamImpl *This, do { DWORD idxCkid = 0; - HRESULT hr; + DWORD res; - hr = ICCompress(This->hic,icmFlags,This->lpbiCur,This->lpCur,lpbi,lpBits, - &idxCkid, &idxFlags, This->lCurrent, dwRequest, dwCurQual, - noPrev ? NULL:This->lpbiPrev, noPrev ? NULL:This->lpPrev); - if (hr == ICERR_NEWPALETTE) { + res = ICCompress(This->hic,icmFlags,This->lpbiCur,This->lpCur,lpbi,lpBits, + &idxCkid, &idxFlags, This->lCurrent, dwRequest, dwCurQual, + noPrev ? NULL:This->lpbiPrev, noPrev ? NULL:This->lpPrev); + if (res == ICERR_NEWPALETTE) { FIXME(": codec has changed palette -- unhandled!\n"); - } else if (hr != ICERR_OK) + } else if (res != ICERR_OK) return AVIERR_COMPRESSOR; /* need to check for framesize */ @@ -902,7 +902,7 @@ static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This) assert(This->lpbiOutput == NULL); /* get input format */ - lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(This->pg, This->sInfo.dwStart); + lpbi = AVIStreamGetFrame(This->pg, This->sInfo.dwStart); if (lpbi == NULL) return AVIERR_MEMORY; diff --git a/reactos/dll/win32/avifil32/regsvr.c b/reactos/dll/win32/avifil32/regsvr.c index 6ec40856368..ef642acf3d0 100644 --- a/reactos/dll/win32/avifil32/regsvr.c +++ b/reactos/dll/win32/avifil32/regsvr.c @@ -32,6 +32,7 @@ #include "avifile_private.h" #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(avifile); @@ -158,7 +159,7 @@ static HRESULT register_interfaces(struct regsvr_interface const *list) KEY_READ | KEY_WRITE, NULL, &key, NULL); if (res != ERROR_SUCCESS) goto error_close_iid_key; - wsprintfW(buf, fmt, list->num_methods); + sprintfW(buf, fmt, list->num_methods); res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)buf, (lstrlenW(buf) + 1) * sizeof(WCHAR)); diff --git a/reactos/dll/win32/avifil32/rsrc.rc b/reactos/dll/win32/avifil32/rsrc.rc index 3dfdad8cfee..68fbab3e5bc 100644 --- a/reactos/dll/win32/avifil32/rsrc.rc +++ b/reactos/dll/win32/avifil32/rsrc.rc @@ -57,3 +57,4 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "avifile_Sv.rc" #include "avifile_Tr.rc" #include "avifile_Uk.rc" +#include "avifile_Zh.rc" diff --git a/reactos/dll/win32/avifil32/tmpfile.c b/reactos/dll/win32/avifil32/tmpfile.c index 27d9e4f9b25..49b5a0a91bb 100644 --- a/reactos/dll/win32/avifil32/tmpfile.c +++ b/reactos/dll/win32/avifil32/tmpfile.c @@ -1,5 +1,5 @@ /* - * Copyright 2003 Michael Gnnewig + * Copyright 2003 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/avifil32/wavfile.c b/reactos/dll/win32/avifil32/wavfile.c index b9779e366c8..2ec9b5e26d1 100644 --- a/reactos/dll/win32/avifil32/wavfile.c +++ b/reactos/dll/win32/avifil32/wavfile.c @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Gnnewig + * Copyright 2002 Michael Günnewig * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -908,7 +908,7 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start, if (mmioSeek(This->hmmio, This->ckData.dwDataOffset + start * This->sInfo.dwSampleSize, SEEK_SET) == -1) return AVIERR_FILEREAD; - if (mmioRead(This->hmmio, (HPSTR)buffer, buffersize) != buffersize) + if (mmioRead(This->hmmio, buffer, buffersize) != buffersize) return AVIERR_FILEREAD; /* fill out return parameters if given */ @@ -960,7 +960,7 @@ static HRESULT WINAPI IAVIStream_fnWrite(IAVIStream *iface, LONG start, if (mmioSeek(This->hmmio, This->ckData.dwDataOffset + start * This->sInfo.dwSampleSize, SEEK_SET) == -1) return AVIERR_FILEWRITE; - if (mmioWrite(This->hmmio, (HPSTR)buffer, buffersize) != buffersize) + if (mmioWrite(This->hmmio, buffer, buffersize) != buffersize) return AVIERR_FILEWRITE; This->sInfo.dwLength = max(This->sInfo.dwLength, (DWORD)start + samples);