[Résolu] GetFullPathName et Win XP
Bonjour,
J'ai un probleme avec l'API GetFullPathName.
Code:
GetFullPathName(src_file, _MAX_PATH, dest_file, &p);
j'ai un buffer src_file avec 133 caracteres.
j'ai un buffer de sortie dest_file avec 130 caracteres.
_MAX_PATH = 260
je fais tourner mon application sous W2k pas de probleme GetFullPathName me retourne un valeur de 130 :D
je fais tourner mon apllication sous Win XP et GetFullPathName me retourne 0. :triste:
A croire que sous XP la longueur max de GetFullPathName est 133 + 130 = 263 :furax:
quelqu'un a une reponse
merci :oops:
Re: GetFullPathName et Win XP
Citation:
Envoyé par juju92
Bonjour,
Code:
GetFullPathName(src_file, _MAX_PATH, dest_file, &p);
j'ai un buffer de sortie dest_file avec 130 caracteres.
_MAX_PATH = 260
Donc, tu passes à GetFullPathName() une taille de buffer supérieure à la taille véritable ?
Sinon, Normalement, GetFullPathName() ne retourne pas zéro avec un buffer trop court:
Citation:
If the lpBuffer buffer is too small to contain the path, the return value is the size of the buffer that is required to hold the path and the terminating null character, in TCHARs. Therefore, if the return value is greater than nBufferLength, call the function again with a buffer that is large enough to hold the path.
If the function fails for any other reason, the return value is 0 (zero). To get extended error information, call GetLastError.
Peut-être que c'est src_file qui est trop long... La chaîne est bien terminée par un caractère nul?
Re: GetFullPathName et Win XP
Citation:
Envoyé par Médinoc
Sinon, Normalement, GetFullPathName() ne retourne pas zéro avec un buffer trop court:
Citation:
If the lpBuffer buffer is too small to contain the path, the return value is the size of the buffer that is required to hold the path and the terminating null character, in TCHARs. Therefore, if the return value is greater than nBufferLength, call the function again with a buffer that is large enough to hold the path.
If the function fails for any other reason, the return value is 0 (zero). To get extended error information, call GetLastError.
Peut-être que c'est src_file qui est trop long... La chaîne est bien terminée par un caractère nul?
exacte ça marche tres bien sous W2K par contre pas sous Win XP c'est inconprehensible :?