View Issue Details

IDProjectCategoryView StatusLast Update
0001776Double CommanderFile operationspublic2020-11-30 07:43
Reporterdouchecommander Assigned ToAlexx2000  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
ProjectionnoneETAnone 
OSWindows 7 x64 
Product Version1.0.0 (trunk)Product Build7469 
Target Version0.8.0Fixed in Version0.8.0 
Summary0001776: Filenames not passed on correctly to MP3Tag
DescriptionI am using MP3Tag (http://www.mp3tag.de/) for tagging audio files. It integrates itself into the Explorer context menu so that you can right-click a file in Explorer and choose "MP3Tag" to open this file.

When doing so in Explorer, it works just fine. When using the Explorer context menu in DoubleCommander, however, the filename is apparently not passed on correctly to MP3Tag, leading to an error message about an invalid parameter.
TagsNo tags attached.
Attached Files
Error_MP3Tag.jpg (192,342 bytes)   
Error_MP3Tag.jpg (192,342 bytes)   
Fixed in Revision
Operating systemWindows
WidgetsetWin32
Architecture64-bit

Activities

altae

2017-04-18 01:59

reporter   ~0002162

I can confirm this issue. It used to work until recently so there must have been some kind of change in one of the snapshots that has introduced this issue. It still does not work in the latest snapshot (revision 7500). It works flawlessly in the stable version though.

I also added a screenshot documenting the issue.

Alexx2000

2017-05-13 18:48

administrator   ~0002208

I know which change broken it, but I don't know why. I do not see mistake in new code. Other programs works fine, only MP3Tag doesn't work.

douchecommander

2017-05-13 22:26

reporter   ~0002210

Maybe you can point to the change in code, in case someone else has an idea.

Alexx2000

2017-05-13 22:29

administrator   ~0002211

https://sourceforge.net/p/doublecmd/code/7456/

cordylus

2017-05-13 23:33

developer   ~0002212

Last edited: 2017-05-13 23:35

cmici: TCMInvokeCommandInfoEx;
lpici: TCMINVOKECOMMANDINFO absolute cmici;

This was probably a bad idea: TCMINVOKECOMMANDINFO is defined as packed record in shlobj.pp, but TCMInvokeCommandInfoEx is not packed (a bug in the winunits-base package?)

Alexx2000

2017-05-14 00:18

administrator   ~0002213

This record has such structure that it has same size in packed and unpacked variants. Both records has correct size 36 and 64 bytes under Win32.

cordylus

2017-05-14 00:23

developer   ~0002214

Last edited: 2017-05-14 00:31

OK, then maybe the reason is fMask := CMIC_MASK_UNICODE;
It is supposed to be used with the Ex version, but non-Ex record is passed by value, not by reference. Or is it?

cordylus

2017-05-14 00:41

developer   ~0002215

I'm probably wrong with that, it should be by reference, there is "var".

Maybe just try it with compiler optimizations disabled?

Alexx2000

2017-05-14 01:00

administrator   ~0002216

Yes, it should be by reference, because "var".
I checked with debug build without optimizations.

Author of MP3Tag can say what is wrong. May be someone ask him at support forum.

douchecommander

2017-05-14 02:23

reporter   ~0002217

Report at MP3Tag forum: https://forums.mp3tag.de/index.php?showtopic=22498

cordylus

2017-05-14 02:33

developer   ~0002218

It has to be something with lpVerb/lpVerbW - everything else looks flawless.

MSDN says about lpVerb:

Alternatively, rather than a pointer, this parameter can be MAKEINTRESOURCE(offset) where offset is the menu-identifier offset of the command to carry out.

Maybe try it this way, as suggested in http://stackoverflow.com/a/3783104

lpVerb := MakeIntResource(Word(cmd - 1))

Alexx2000

2017-05-14 11:12

administrator   ~0002219

From FreePascal source:

  MakeIntResourceA = PAnsiChar;
  MakeIntResourceW = PWideChar;

So it is same as current code.


MP3Tag does not like CMIC_MASK_UNICODE flag. But I don't know why. If it does not support Unicode then it must ignore it and use TCMINVOKECOMMANDINFO part of structure.

Alexx2000

2017-05-14 14:12

administrator   ~0002222

I created simple shell extension and debug it.

Looks like lpVerbW parameter cannot be MAKEINTRESOURCE(offset). It can be a string only.

Alexx2000

2017-05-14 15:24

administrator   ~0002223

Using my shell extension I checked which parameters Explorer pass to shell extension. I found that it does not fill lpVerbW parameter. So I made in same manner.

cordylus

2017-05-14 20:11

developer   ~0002225

I've also found this in How to Implement the IContextMenu Interface at MSDN:

The structure's lpVerb or lpVerbW member is used to identify the command to be executed. Commands are identified in one of the following two ways:

    By the command's verb string
    By the command's identifier offset

To distinguish between these two cases, check the high-order word of lpVerb for the ANSI case or lpVerbW for the Unicode case. If the high-order word is nonzero, lpVerb or lpVerbW holds a verb string. If the high-order word is zero, the command offset is in the low-order word of lpVerb.

Does it confirm that the bug is in the MP3Tag's implementation?

Alexx2000

2017-05-15 07:00

administrator   ~0002227

Last edited: 2017-05-15 07:00

It seems that way...

Link: https://msdn.microsoft.com/en-us/library/windows/desktop/hh127443(v=vs.85).aspx

altae

2017-05-25 00:14

reporter   ~0002254

In the latest snapshot it works again. Thank you very much for your efforts, well done!

Issue History

Date Modified Username Field Change
2017-03-21 15:10 douchecommander New Issue
2017-04-09 11:16 Alexx2000 Target Version => 0.8.0
2017-04-18 01:58 altae File Added: Error_MP3Tag.jpg
2017-04-18 01:59 altae Note Added: 0002162
2017-05-13 18:48 Alexx2000 Note Added: 0002208
2017-05-13 18:48 Alexx2000 Status new => acknowledged
2017-05-13 22:26 douchecommander Note Added: 0002210
2017-05-13 22:29 Alexx2000 Note Added: 0002211
2017-05-13 23:33 cordylus Note Added: 0002212
2017-05-13 23:35 cordylus Note Edited: 0002212
2017-05-13 23:35 cordylus Note Edited: 0002212
2017-05-14 00:18 Alexx2000 Note Added: 0002213
2017-05-14 00:23 cordylus Note Added: 0002214
2017-05-14 00:26 cordylus Note Edited: 0002214
2017-05-14 00:31 cordylus Note Edited: 0002214
2017-05-14 00:41 cordylus Note Added: 0002215
2017-05-14 01:00 Alexx2000 Note Added: 0002216
2017-05-14 02:23 douchecommander Note Added: 0002217
2017-05-14 02:33 cordylus Note Added: 0002218
2017-05-14 11:12 Alexx2000 Note Added: 0002219
2017-05-14 14:12 Alexx2000 Note Added: 0002222
2017-05-14 15:24 Alexx2000 Note Added: 0002223
2017-05-14 15:24 Alexx2000 Assigned To => Alexx2000
2017-05-14 15:24 Alexx2000 Status acknowledged => resolved
2017-05-14 15:24 Alexx2000 Resolution open => fixed
2017-05-14 15:24 Alexx2000 Fixed in Version => 0.8.0
2017-05-14 20:11 cordylus Note Added: 0002225
2017-05-15 07:00 Alexx2000 Note Added: 0002227
2017-05-15 07:00 Alexx2000 Note Edited: 0002227
2017-05-25 00:14 altae Note Added: 0002254
2020-11-30 07:43 Alexx2000 Status resolved => closed