[8.52ax86] TC shows 'CD-ROM' tooltip on 0th FTP drive button
Moderators: Hacker, petermad, Stefan2, white
2ghisler(Author)
Have you been able to reproduce this bug? If so, I'm curious why drive bar and drive list show different tooltips.
Regards
Dalai
Have you been able to reproduce this bug? If so, I'm curious why drive bar and drive list show different tooltips.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
- ghisler(Author)
- Site Admin
- Posts: 50548
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Yes, I managed to reproduce and fix it! The error was in the function to get the volume label. Strangely, GetDriveType(ord(drv)-ord('A')) was returning drive_cdrom for drv='0' (parameter =-17), not an error...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Huh? How did you manage to call a function that expects an LPCTSTR parameter with an ordinal parameter?ghisler(Author) wrote:Strangely, GetDriveType(ord(drv)-ord('A')) was returning drive_cdrom for drv='0' (parameter =-17), not an error...
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
Ghisler is referring to the PASCAL/Lazarus function, not to the WIN API of the same nameDalai wrote:Huh? How did you manage to call a function that expects an LPCTSTR parameter with an ordinal parameter?ghisler(Author) wrote:Strangely, GetDriveType(ord(drv)-ord('A')) was returning drive_cdrom for drv='0' (parameter =-17), not an error...
Regards
Dalai

There's only one function in Delphi with that name (unit Windows) and it expects a string type as parameter, that's why I'm baffled - hence the question. You can see for yourself in Emba's DocWiki. Lazarus/Free Pascal doesn't matter here because TC 32 bit is compiled with Delphi.elgonzo wrote:Ghisler is referring to the PASCAL/Lazarus function, not to the WIN API of the same name
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
In the interwebs, I found different code examples using GetDriveType. Some use PChar(...) as a parameter, others use Ord(...) like ghisler mentioned (like here or here). I guess this function has either different overloads, there are different implementations/units or the implementation has been changed at some point in time.Dalai wrote:There's only one function in Delphi with that name (unit Windows) and it expects a string type as parameter, that's why I'm baffled - hence the question. You can see for yourself in Emba's DocWiki. Lazarus/Free Pascal doesn't matter here because TC 32 bit is compiled with Delphi.elgonzo wrote:Ghisler is referring to the PASCAL/Lazarus function, not to the WIN API of the same name
Regards
Dalai
By the way, where on the wiki you linked can the documentation for GetDriveType be found? Generally, i was unsuccessful to find any online documentation about it or its unit aside from some code snippets scattered across different wikis and forum posts. Anyway, it's not really that important...

Nope. As I said: it's only PChar (Delphi 5 through XE2) or LPCSTR (Delphi XE8).elgonzo wrote:I guess this function has either different overloads
Yeah, that's most likely the case. I guess it was declared differently in Delphi 2. The question is: What does the API do with an ordinal parameter? Does it interpret/convert it correctly? Well, we'll probably never know since only MS has the source code.[...] or the implementation has been changed at some point in time.
By the way, where on the wiki you linked can the documentation for GetDriveType be found?
It can't be found in there. You can search for it using the search feature on the left, but you won't find it because it's an API function, not some Delphi function. Search for PChar, Format or some other function to verify the search function works

-----
Anyway. It may be a good idea to redeclare the GetDriveType function so that it does what it's supposed to do.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror