[Bug 24183] XMedia Recode - profile list differs from wine to windows

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Dec 28 10:32:54 CST 2011


http://bugs.winehq.org/show_bug.cgi?id=24183

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |download
                 CC|                            |focht at gmx.net

--- Comment #7 from Anastasius Focht <focht at gmx.net> 2011-12-28 10:32:54 CST ---
Hello,

ah my old friend XMedia Recode again ... remember bug 22661 ? ;-)

The list/combobox content is built using file search in folder "C:\\Program
Files\\XMedia Recode\\Profile\\" with filter "*.ini":

--- snip ---
0024:Call KERNEL32.FindFirstFileA(0031652c "C:\\Program Files\\XMedia
Recode\\Profile\\*.ini",003163ec) ret=0046ce91
0024:Ret  KERNEL32.FindFirstFileA() retval=00176310 ret=0046ce91 
...
--- snip ---

The "Name", "Manufacturer" and "Format" values are read from each .ini file
found and internally stored in lists.

--- snip ---
...
0024:Call KERNEL32.GetPrivateProfileStringA(004ef428 "Main",004fa9f0
"Name",004f3fc4 "#####",00315db4,00000104,00315fbc "C:\\Program Files\\XMedia
Recode\\Profile\\Sony_Ericsson_XPERIA_X10minipro_mp4.ini") ret=0046d353
0024:Ret  KERNEL32.GetPrivateProfileStringA() retval=00000027 ret=0046d353
0024:Call KERNEL32.GetPrivateProfileStringA(004ef428 "Main",004f9184
"Manufacturer",004f3fc4 "#####",00315eb8,00000104,00315fbc "C:\\Program
Files\\XMedia Recode\\Profile\\Sony_Ericsson_XPERIA_X10minipro_mp4.ini")
ret=0046d379
0024:Ret  KERNEL32.GetPrivateProfileStringA() retval=0000000d ret=0046d379
0024:Call KERNEL32.GetPrivateProfileStringA(004ef428 "Main",004f3fac
"Format",004f3fc4 "#####",00315cb0,00000104,00315fbc "C:\\Program Files\\XMedia
Recode\\Profile\\Sony_Ericsson_XPERIA_X10minipro_mp4.ini") ret=0046d39c
0024:Ret  KERNEL32.GetPrivateProfileStringA() retval=00000003 ret=0046d39c
0024:Call ntdll.RtlAllocateHeap(02894000,00000000,00000028) ret=004be8ea
0024:Ret  ntdll.RtlAllocateHeap() retval=028a1f50 ret=004be8ea
0024:Call ntdll.RtlAllocateHeap(02894000,00000000,00000028) ret=004be8ea
0024:Ret  ntdll.RtlAllocateHeap() retval=028a1f80 ret=004be8ea
0024:Call ntdll.RtlAllocateHeap(02894000,00000000,0000000e) ret=004be8ea
0024:Ret  ntdll.RtlAllocateHeap() retval=028a1fb0 ret=004be8ea
0024:Call ntdll.RtlAllocateHeap(02894000,00000000,00000008) ret=004be8ea
0024:Ret  ntdll.RtlAllocateHeap() retval=028a1fc8 ret=004be8ea
0024:Call KERNEL32.FindNextFileA(00176310,003163ec) ret=0046cf46
0024:Ret  KERNEL32.FindNextFileA() retval=00000001 ret=0046cf46
0024:Call ntdll.RtlAllocateHeap(02894000,00000000,000000a4) ret=004be8ea
0024:Ret  ntdll.RtlAllocateHeap() retval=028a1fe0 ret=004be8ea
0024:Call KERNEL32.GetLastError() ret=004c8548
0024:Ret  KERNEL32.GetLastError() retval=00000000 ret=004c8548
0024:Call KERNEL32.GetLastError() ret=004c8548
0024:Ret  KERNEL32.GetLastError() retval=00000000 ret=004c8548
0024:Call KERNEL32.GetPrivateProfileStringA(004ef428 "Main",004fa9f0
"Name",004f3fc4 "#####",00315db4,00000104,00315fbc "C:\\Program Files\\XMedia
Recode\\Profile\\YouTube_320x240_flv.ini") ret=0046d353
0024:Ret  KERNEL32.GetPrivateProfileStringA() retval=00000015 ret=0046d353
0024:Call KERNEL32.GetPrivateProfileStringA(004ef428 "Main",004f9184
"Manufacturer",004f3fc4 "#####",00315eb8,00000104,00315fbc "C:\\Program
Files\\XMedia Recode\\Profile\\YouTube_320x240_flv.ini") ret=0046d379
0024:Ret  KERNEL32.GetPrivateProfileStringA() retval=00000007 ret=0046d379
0024:Call KERNEL32.GetPrivateProfileStringA(004ef428 "Main",004f3fac
"Format",004f3fc4 "#####",00315cb0,00000104,00315fbc "C:\\Program Files\\XMedia
Recode\\Profile\\YouTube_320x240_flv.ini") ret=0046d39c
0024:Ret  KERNEL32.GetPrivateProfileStringA() retval=00000003 ret=0046d39c
0024:Call ntdll.RtlAllocateHeap(02894000,00000000,00000018) ret=004be8ea
0024:Ret  ntdll.RtlAllocateHeap() retval=028a2090 ret=004be8ea
0024:Call ntdll.RtlAllocateHeap(02894000,00000000,00000016) ret=004be8ea
0024:Ret  ntdll.RtlAllocateHeap() retval=028a20b0 ret=004be8ea
0024:Call ntdll.RtlAllocateHeap(02894000,00000000,00000008) ret=004be8ea
0024:Ret  ntdll.RtlAllocateHeap() retval=028a20d0 ret=004be8ea
0024:Call ntdll.RtlAllocateHeap(02894000,00000000,00000008) ret=004be8ea
0024:Ret  ntdll.RtlAllocateHeap() retval=028a20e8 ret=004be8ea
0024:Call KERNEL32.FindNextFileA(00176310,003163ec) ret=0046d04c
0024:Ret  KERNEL32.FindNextFileA() retval=00000001 ret=0046d04c
...
--- snip ---

One thing I noticed was the order of appearance in the combobox itself.
All entries (including "duplicates") were ordered in the same sequence as found
by FindFirstFileA.

You can verify by making +file trace only and having a look at
"file:append_entry" messages after FindFirstFileA() for "*.ini" files.
All entries should appear in combobox in the same order as returned by
filesystem.
Only "neighboring" entries of same manufacturer get merged into same list entry

For testing purpose I renamed the "Profiles" folder to something different and
created an empty folder "Profiles".

I put several ini files from only one manufacturer in there ("Manufacturer"
value in .ini file = same):

--- snip ---
$ ls -lisa Profile
total 76
448758 4 drwxrwxr-x. 2 focht focht 4096 Dec 28 17:15 .
448763 4 drwxrwxr-x. 7 focht focht 4096 Dec 28 17:15 ..
450454 4 -rw-rw-r--. 1 focht focht 1506 Dec 26  2010 Acer_beTouch_E100_mp4.ini
450455 4 -rw-rw-r--. 1 focht focht 1506 Dec 26  2010 Acer_beTouch_E101_mp4.ini
450456 4 -rw-rw-r--. 1 focht focht 1472 Dec 26  2010 Acer_beTouch_E140_mp4.ini
450457 4 -rw-rw-r--. 1 focht focht 1506 Dec 26  2010 Acer_beTouch_E200_mp4.ini
450458 4 -rw-rw-r--. 1 focht focht 2214 Dec 16 20:59
Acer_C20_Pico_Projektors_mp4.ini
450459 4 -rw-rw-r--. 1 focht focht 2081 Aug 14 11:33 Acer_Iconia_Smart_mp4.ini
450460 4 -rw-rw-r--. 1 focht focht 2018 Dec 23 19:45 Acer_Iconia_Tab
A100_mp4.ini
450461 4 -rw-rw-r--. 1 focht focht 2027 Nov 16 20:50 Acer_Iconia_Tab
A500_mp4.ini
450462 4 -rw-rw-r--. 1 focht focht 1535 Dec 21  2010 Acer_Liquid_Metal_mp4.ini
450463 4 -rw-rw-r--. 1 focht focht 1528 Dec 26  2010 Acer_Liquid_mp4.ini
450464 4 -rw-rw-r--. 1 focht focht 1507 Dec 26  2010 Acer_neoTouch_P300_mp4.ini
450465 4 -rw-rw-r--. 1 focht focht 1507 Dec 26  2010 Acer_neoTouch_P400_mp4.ini
450466 4 -rw-rw-r--. 1 focht focht 1535 Dec 26  2010 Acer_NeoTouch_S200_mp4.ini
450467 4 -rw-rw-r--. 1 focht focht  569 Dec 17  2010 Acer_Tempo_DX900_mp4.ini
450468 4 -rw-rw-r--. 1 focht focht  596 Dec 17  2010 Acer_Tempo_F900_mp4.ini
450469 4 -rw-rw-r--. 1 focht focht  561 Dec 17  2010 Acer_Tempo_M900_mp4.ini
450470 4 -rw-rw-r--. 1 focht focht  561 Dec 17  2010 Acer_Tempo_X960_mp4.ini
...
--- snip ---

The combobox displays only one "Manufacturer" entry "Acer" and the combobox
below displays all "Name" values from corresponding ini files:

--- snip ---
Acer beTouch E100 (mp4)
Acer beTouch E101 (mp4)
Acer beTouch E200 (mp4)
...
--- snip ---

Now with one more file from different manufacturer added:
"Apple_iPad_H264_1024x768_1800.ini"

--- snip ---
$ ls -lisa Profile
total 80
448758 4 drwxrwxr-x. 2 focht focht 4096 Dec 28 17:16 .
448763 4 drwxrwxr-x. 7 focht focht 4096 Dec 28 17:15 ..
450454 4 -rw-rw-r--. 1 focht focht 1506 Dec 26  2010 Acer_beTouch_E100_mp4.ini
450455 4 -rw-rw-r--. 1 focht focht 1506 Dec 26  2010 Acer_beTouch_E101_mp4.ini
450456 4 -rw-rw-r--. 1 focht focht 1472 Dec 26  2010 Acer_beTouch_E140_mp4.ini
450457 4 -rw-rw-r--. 1 focht focht 1506 Dec 26  2010 Acer_beTouch_E200_mp4.ini
450458 4 -rw-rw-r--. 1 focht focht 2214 Dec 16 20:59
Acer_C20_Pico_Projektors_mp4.ini
450459 4 -rw-rw-r--. 1 focht focht 2081 Aug 14 11:33 Acer_Iconia_Smart_mp4.ini
450460 4 -rw-rw-r--. 1 focht focht 2018 Dec 23 19:45 Acer_Iconia_Tab
A100_mp4.ini
450461 4 -rw-rw-r--. 1 focht focht 2027 Nov 16 20:50 Acer_Iconia_Tab
A500_mp4.ini
450462 4 -rw-rw-r--. 1 focht focht 1535 Dec 21  2010 Acer_Liquid_Metal_mp4.ini
450463 4 -rw-rw-r--. 1 focht focht 1528 Dec 26  2010 Acer_Liquid_mp4.ini
450464 4 -rw-rw-r--. 1 focht focht 1507 Dec 26  2010 Acer_neoTouch_P300_mp4.ini
450465 4 -rw-rw-r--. 1 focht focht 1507 Dec 26  2010 Acer_neoTouch_P400_mp4.ini
450466 4 -rw-rw-r--. 1 focht focht 1535 Dec 26  2010 Acer_NeoTouch_S200_mp4.ini
450467 4 -rw-rw-r--. 1 focht focht  569 Dec 17  2010 Acer_Tempo_DX900_mp4.ini
450468 4 -rw-rw-r--. 1 focht focht  596 Dec 17  2010 Acer_Tempo_F900_mp4.ini
450469 4 -rw-rw-r--. 1 focht focht  561 Dec 17  2010 Acer_Tempo_M900_mp4.ini
450470 4 -rw-rw-r--. 1 focht focht  561 Dec 17  2010 Acer_Tempo_X960_mp4.ini
448756 4 -rw-rw-r--. 1 focht focht 1268 Sep 27 21:11
Apple_iPad_H264_1024x768_1800.ini
--- snip ---

The following "Manufacturer" entries are displayed:

--- snip ---
"Custom" (doesn't count, sane default)
"Acer"
"Apple"
"Acer"
--- snip ---

Exactly as they were found by FindFirstFileA -> NtQueryDirectoryFile ->
getdents() call.
Wine only reorders special "." and ".." entries, all others remain in sequence.

I wrote a small c app which calls "getdents" and prints the entries and ran it
on the "Profiles" folder:

--- snip ---
$ getdents .
  1 focht    focht         561 Dec 17 15:19 Acer_Tempo_X960_mp4.ini
  1 focht    focht        2018 Dec 23 19:45 Acer_Iconia_Tab A100_mp4.ini
  1 focht    focht        2027 Nov 16 20:50 Acer_Iconia_Tab A500_mp4.ini
  1 focht    focht        1506 Dec 26 13:54 Acer_beTouch_E101_mp4.ini
  1 focht    focht        1506 Dec 26 13:54 Acer_beTouch_E100_mp4.ini
  2 focht    focht        4096 Dec 28 17:16 .
  1 focht    focht        1528 Dec 26 13:55 Acer_Liquid_mp4.ini
  1 focht    focht        1535 Dec 21 13:46 Acer_Liquid_Metal_mp4.ini
  1 focht    focht         596 Dec 17 15:18 Acer_Tempo_F900_mp4.ini
  1 focht    focht        1472 Dec 26 13:54 Acer_beTouch_E140_mp4.ini
  7 focht    focht        4096 Dec 28 17:15 ..
  1 focht    focht        2081 Aug 14 11:33 Acer_Iconia_Smart_mp4.ini
  1 focht    focht        1507 Dec 26 13:55 Acer_neoTouch_P300_mp4.ini
  1 focht    focht         569 Dec 17 15:19 Acer_Tempo_DX900_mp4.ini
  1 focht    focht         561 Dec 17 15:18 Acer_Tempo_M900_mp4.ini
  1 focht    focht        1268 Sep 27 21:11 Apple_iPad_H264_1024x768_1800.ini
  1 focht    focht        1506 Dec 26 13:55 Acer_beTouch_E200_mp4.ini
  1 focht    focht        1507 Dec 26 13:55 Acer_neoTouch_P400_mp4.ini
  1 focht    focht        1535 Dec 26 13:54 Acer_NeoTouch_S200_mp4.ini
  1 focht    focht        2214 Dec 16 20:59 Acer_C20_Pico_Projektors_mp4.ini
--- snip ---

You see "Apple_iPad_H264_1024x768_1800.ini" breaks the ordering.

My hypothesis: the app developer relies on OS/filesystem to maintain
alphabetical order when looking at entries returned from FindNextFileA() and
doing possible merge/sort.

This is obviously wrong.

http://msdn.microsoft.com/en-us/library/aa364428.aspx

FindNextFile() doesn't guarantee any sorting order, this must be done by
application itself.

Why this works on Windows?

--- quote ---
The order in which this function returns the file names is dependent on the
file system type. With the NTFS file system and CDFS file systems, the names
are usually returned in alphabetical order. With FAT file systems, the names
are usually returned in the order the files were written to the disk, which may
or may not be in alphabetical order. However, as stated previously, these
behaviors are not guaranteed.
--- quote ---

IMHO this is an application bug again, there is nothing to fix here.

Also present in current 3.x versions

$ sha1sum XMediaRecode2263_setup.exe
2fd0823cd9a3947245ed1998722e098674ce72d0  XMediaRecode2263_setup.exe

$ sha1sum XMediaRecode3060_setup.exe
4d04df153b50be0409b59025404fd3ebcb1b453a  XMediaRecode3060_setup.exe

$ wine --version
wine-1.3.35-194-gedd5ca7

Regards

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list