Click here to Skip to main content
14,974,268 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to find include directive path? Pin
Richard MacCutchan28-May-21 21:04
mveRichard MacCutchan28-May-21 21:04 
AnswerRe: How to find include directive path? Pin
Member 1496877128-May-21 8:19
MemberMember 1496877128-May-21 8:19 
Questionc+ + coding Pin
javaid musa24-May-21 18:17
Memberjavaid musa24-May-21 18:17 
AnswerRe: c+ + coding Pin
CPallini24-May-21 20:00
mveCPallini24-May-21 20:00 
QuestionOptimizing this code ? Pin
Duc Axenn24-May-21 0:56
MemberDuc Axenn24-May-21 0:56 
SuggestionRe: Optimizing this code ? Pin
Richard MacCutchan24-May-21 0:02
mveRichard MacCutchan24-May-21 0:02 
GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 0:56
MemberDuc Axenn24-May-21 0:56 
SuggestionRe: Optimizing this code ? Pin
Randor 24-May-21 2:30
professional Randor 24-May-21 2:30 
Duc Axenn wrote:
I just want to verify with the community if there is no problem
The code is technically wrong. But don't worry... it's probably correct 99.99% of the time. Smile | :)

Did you write this code? The top half seems to be written by someone who knows that the file can span across multiple physical disks. The bottom half is incorrectly returning the STORAGE_BUS_TYPE of only the last disk extent.

Microsoft Windows supports spanned volumes[^] which means that in very rare cases a single file might be located on multiple physical disks. Those physical drives could be a mixture of SCSI, SATA, USB, ATAPI, NVME, etcetera...

To make your code more correct you would need to loop through all of those disk extents and return all of the storage bus types[^].

Best Wishes,
-David Delaune

edit: fixed typo

modified 24-May-21 9:06am.

GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 4:21
MemberDuc Axenn24-May-21 4:21 
GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 8:36
MemberDuc Axenn24-May-21 8:36 
GeneralRe: Optimizing this code ? Pin
Randor 24-May-21 14:30
professional Randor 24-May-21 14:30 
GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 20:41
MemberDuc Axenn24-May-21 20:41 
GeneralRe: Optimizing this code ? Pin
Randor 25-May-21 12:25
professional Randor 25-May-21 12:25 
GeneralRe: Optimizing this code ? Pin
Duc Axenn26-May-21 2:53
MemberDuc Axenn26-May-21 2:53 
QuestionCloud Storage Pin
Bram van Kampen23-May-21 15:10
MemberBram van Kampen23-May-21 15:10 
AnswerRe: Cloud Storage Pin
Victor Nijegorodov23-May-21 22:06
MemberVictor Nijegorodov23-May-21 22:06 
GeneralRe: Cloud Storage Pin
Bram van Kampen29-May-21 14:49
MemberBram van Kampen29-May-21 14:49 
AnswerRe: Cloud Storage Pin
Gerry Schmitz24-May-21 7:14
mveGerry Schmitz24-May-21 7:14 
GeneralRe: Cloud Storage Pin
Bram van Kampen29-May-21 14:56
MemberBram van Kampen29-May-21 14:56 
AnswerRe: Cloud Storage Pin
Maximilien25-May-21 2:58
MemberMaximilien25-May-21 2:58 
GeneralRe: Cloud Storage Pin
Bram van Kampen10-Jun-21 14:00
MemberBram van Kampen10-Jun-21 14:00 
Question32 and 64 bit versions of the same project Pin
Richard Andrew x6415-May-21 16:36
professionalRichard Andrew x6415-May-21 16:36 
JokeRe: 32 and 64 bit versions of the same project Pin
Peter_in_278015-May-21 17:00
professionalPeter_in_278015-May-21 17:00 
GeneralRe: 32 and 64 bit versions of the same project Pin
Member 1520359919-May-21 5:05
MemberMember 1520359919-May-21 5:05 
GeneralMessage Closed Pin
22-May-21 1:40
MemberMember 1520359922-May-21 1:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.