From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id EE49C43487 for ; Mon, 13 Jun 2022 17:03:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EA26568B5EE; Mon, 13 Jun 2022 20:03:26 +0300 (EEST) Received: from msg-6.mailo.com (ip-16.mailobj.net [213.182.54.16]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B51F068B515 for ; Mon, 13 Jun 2022 20:03:20 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1655139800; bh=7sjzDu6J2Kgqq7mIR7TjEcJSXd9stteNn6S6cRRJyck=; h=X-EA-Auth:From:To:Date:Subject:MIME-Version:X-Mailer:Message-ID: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=luNZ6xHUOEyJ9iqV8wEytbf5OAxUV3YN+qSbqGxAqE7uKBBuH47F32gD5FrZYB6UY UT5eu+avi20x1Q90jUCVpMl8eB7NG2Yqd3H8qUME8iKx45v1zyVI490FNOrQbHpoIj BbOjMNrcATX0nySMpO9aSp5PyoazQtXa3TTACSJo= Received: by www-7.mailo.com with http webmail; Mon, 13 Jun 2022 19:03:20 +0200 (CEST) X-EA-Auth: fTYnpBe83NPUNLqLnNVv9eMNWlH8QMdrIyHkknvXjveptHVleH1tMjR0AS6mMOhu3q7By5AEUyNdkGk1qRrK+QIf5prg40L1 From: nil-admirari@mailo.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 13 Jun 2022 19:03:20 +0200 (CEST) X-Priority: 3 MIME-Version: 1.0 X-Mailer: COMS/EA21.01/r20220415 Message-ID: In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v14 2/5] compat/w32dlfcn.h: Remove MAX_PATH limit and replace LoadLibraryExA with LoadLibraryExW X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > Why do you use a 'do' loop? Can't you use the normal 2-step > approach, i.e. call the winapi function with a NULL buffer, > and then use the returned size to allocate the buffer. > This way you always need a single allocation only. GetModuleFileNameW does not follow this convention: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew > If the length of the path exceeds the size that the nSize parameter specifies, > the function succeeds and the string is truncated to nSize characters > including the terminating null character. MS does the looping too in their WIL library: https://github.com/microsoft/wil/blob/master/include/wil/win32_helpers.h#L339-L341. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".