Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 0/2] some cleanups for compat/w32dlfcn.h
@ 2024-07-30 14:09 Ramiro Polla
  2024-07-30 14:09 ` [FFmpeg-devel] [PATCH 1/2] compat/w32dlfcn: remove backup definitions for safe LoadLibrary flags Ramiro Polla
  2024-07-30 14:09 ` [FFmpeg-devel] [PATCH 2/2] compat/w32dlfcn: remove support for pre-KB2533623 Win7 systems Ramiro Polla
  0 siblings, 2 replies; 6+ messages in thread
From: Ramiro Polla @ 2024-07-30 14:09 UTC (permalink / raw)
  To: ffmpeg-devel

I have only tested that it builds, but not that it runs on a real
Windows system.

Ramiro Polla (2):
  compat/w32dlfcn: remove backup definitions for safe LoadLibrary flags
  compat/w32dlfcn: remove support for pre-KB2533623 Win7 systems

 compat/w32dlfcn.h | 58 -----------------------------------------------
 1 file changed, 58 deletions(-)

-- 
2.30.2

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [FFmpeg-devel] [PATCH 1/2] compat/w32dlfcn: remove backup definitions for safe LoadLibrary flags
  2024-07-30 14:09 [FFmpeg-devel] [PATCH 0/2] some cleanups for compat/w32dlfcn.h Ramiro Polla
@ 2024-07-30 14:09 ` Ramiro Polla
  2024-07-30 15:29   ` James Almer
  2024-07-30 14:09 ` [FFmpeg-devel] [PATCH 2/2] compat/w32dlfcn: remove support for pre-KB2533623 Win7 systems Ramiro Polla
  1 sibling, 1 reply; 6+ messages in thread
From: Ramiro Polla @ 2024-07-30 14:09 UTC (permalink / raw)
  To: ffmpeg-devel

Since we now expect C17, it is safe to assume that the toolchain will
have these flags defined.
---
 compat/w32dlfcn.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/compat/w32dlfcn.h b/compat/w32dlfcn.h
index ac20e83a7a..8ae718f4bd 100644
--- a/compat/w32dlfcn.h
+++ b/compat/w32dlfcn.h
@@ -120,12 +120,6 @@ exit:
         return module;
     }
 #endif
-#ifndef LOAD_LIBRARY_SEARCH_APPLICATION_DIR
-#   define LOAD_LIBRARY_SEARCH_APPLICATION_DIR 0x00000200
-#endif
-#ifndef LOAD_LIBRARY_SEARCH_SYSTEM32
-#   define LOAD_LIBRARY_SEARCH_SYSTEM32        0x00000800
-#endif
 #if HAVE_WINRT
     if (!name_w)
         return NULL;
-- 
2.30.2

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [FFmpeg-devel] [PATCH 2/2] compat/w32dlfcn: remove support for pre-KB2533623 Win7 systems
  2024-07-30 14:09 [FFmpeg-devel] [PATCH 0/2] some cleanups for compat/w32dlfcn.h Ramiro Polla
  2024-07-30 14:09 ` [FFmpeg-devel] [PATCH 1/2] compat/w32dlfcn: remove backup definitions for safe LoadLibrary flags Ramiro Polla
@ 2024-07-30 14:09 ` Ramiro Polla
  2024-07-30 15:17   ` Rémi Denis-Courmont
  1 sibling, 1 reply; 6+ messages in thread
From: Ramiro Polla @ 2024-07-30 14:09 UTC (permalink / raw)
  To: ffmpeg-devel

The KB2533623 security update has been released 13 years ago and
Windows 7 has reached end of extended support 4 years ago.
---
 compat/w32dlfcn.h | 52 -----------------------------------------------
 1 file changed, 52 deletions(-)

diff --git a/compat/w32dlfcn.h b/compat/w32dlfcn.h
index 8ae718f4bd..856ad74cc1 100644
--- a/compat/w32dlfcn.h
+++ b/compat/w32dlfcn.h
@@ -68,58 +68,6 @@ static inline HMODULE win32_dlopen(const char *name)
     HMODULE module = NULL;
     if (utf8towchar(name, &name_w))
         name_w = NULL;
-#if _WIN32_WINNT < 0x0602
-    // On Win7 and earlier we check if KB2533623 is available
-    if (!GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "SetDefaultDllDirectories")) {
-        wchar_t *path = NULL, *new_path;
-        DWORD pathlen, pathsize, namelen;
-        if (!name_w)
-            goto exit;
-        namelen = wcslen(name_w);
-        // Try local directory first
-        path = get_module_filename(NULL);
-        if (!path)
-            goto exit;
-        new_path = wcsrchr(path, '\\');
-        if (!new_path)
-            goto exit;
-        pathlen = new_path - path;
-        pathsize = pathlen + namelen + 2;
-        new_path = av_realloc_array(path, pathsize, sizeof *path);
-        if (!new_path)
-            goto exit;
-        path = new_path;
-        wcscpy(path + pathlen + 1, name_w);
-        module = LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
-        if (module == NULL) {
-            // Next try System32 directory
-            pathlen = GetSystemDirectoryW(path, pathsize);
-            if (!pathlen)
-                goto exit;
-            // Buffer is not enough in two cases:
-            // 1. system directory + \ + module name
-            // 2. system directory even without the module name.
-            if (pathlen + namelen + 2 > pathsize) {
-                pathsize = pathlen + namelen + 2;
-                new_path = av_realloc_array(path, pathsize, sizeof *path);
-                if (!new_path)
-                    goto exit;
-                path = new_path;
-                // Query again to handle the case #2.
-                pathlen = GetSystemDirectoryW(path, pathsize);
-                if (!pathlen)
-                    goto exit;
-            }
-            path[pathlen] = L'\\';
-            wcscpy(path + pathlen + 1, name_w);
-            module = LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
-        }
-exit:
-        av_free(path);
-        av_free(name_w);
-        return module;
-    }
-#endif
 #if HAVE_WINRT
     if (!name_w)
         return NULL;
-- 
2.30.2

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [FFmpeg-devel] [PATCH 2/2] compat/w32dlfcn: remove support for pre-KB2533623 Win7 systems
  2024-07-30 14:09 ` [FFmpeg-devel] [PATCH 2/2] compat/w32dlfcn: remove support for pre-KB2533623 Win7 systems Ramiro Polla
@ 2024-07-30 15:17   ` Rémi Denis-Courmont
  2024-07-30 16:22     ` Ramiro Polla
  0 siblings, 1 reply; 6+ messages in thread
From: Rémi Denis-Courmont @ 2024-07-30 15:17 UTC (permalink / raw)
  To: ffmpeg-devel

Le tiistaina 30. heinäkuuta 2024, 17.09.15 EEST Ramiro Polla a écrit :
> The KB2533623 security update has been released 13 years ago and
> Windows 7 has reached end of extended support 4 years ago.

No objections, but what will this imply in terms of which Windows versions 
FFmpeg supports?

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/



_______________________________________________
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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/2] compat/w32dlfcn: remove backup definitions for safe LoadLibrary flags
  2024-07-30 14:09 ` [FFmpeg-devel] [PATCH 1/2] compat/w32dlfcn: remove backup definitions for safe LoadLibrary flags Ramiro Polla
@ 2024-07-30 15:29   ` James Almer
  0 siblings, 0 replies; 6+ messages in thread
From: James Almer @ 2024-07-30 15:29 UTC (permalink / raw)
  To: ffmpeg-devel

On 7/30/2024 11:09 AM, Ramiro Polla wrote:
> Since we now expect C17, it is safe to assume that the toolchain will
> have these flags defined.

We expect C11, but probe for C17 and use it if available.

> ---
>   compat/w32dlfcn.h | 6 ------
>   1 file changed, 6 deletions(-)
> 
> diff --git a/compat/w32dlfcn.h b/compat/w32dlfcn.h
> index ac20e83a7a..8ae718f4bd 100644
> --- a/compat/w32dlfcn.h
> +++ b/compat/w32dlfcn.h
> @@ -120,12 +120,6 @@ exit:
>           return module;
>       }
>   #endif
> -#ifndef LOAD_LIBRARY_SEARCH_APPLICATION_DIR
> -#   define LOAD_LIBRARY_SEARCH_APPLICATION_DIR 0x00000200
> -#endif
> -#ifndef LOAD_LIBRARY_SEARCH_SYSTEM32
> -#   define LOAD_LIBRARY_SEARCH_SYSTEM32        0x00000800
> -#endif
>   #if HAVE_WINRT
>       if (!name_w)
>           return NULL;
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [FFmpeg-devel] [PATCH 2/2] compat/w32dlfcn: remove support for pre-KB2533623 Win7 systems
  2024-07-30 15:17   ` Rémi Denis-Courmont
@ 2024-07-30 16:22     ` Ramiro Polla
  0 siblings, 0 replies; 6+ messages in thread
From: Ramiro Polla @ 2024-07-30 16:22 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Tue, Jul 30, 2024 at 5:17 PM Rémi Denis-Courmont <remi@remlab.net> wrote:
> Le tiistaina 30. heinäkuuta 2024, 17.09.15 EEST Ramiro Polla a écrit :
> > The KB2533623 security update has been released 13 years ago and
> > Windows 7 has reached end of extended support 4 years ago.
>
> No objections, but what will this imply in terms of which Windows versions
> FFmpeg supports?

Calls to dlopen() with non-absolute and non-relative paths (i.e.: just
the module name) on systems with Windows 7 which do not have the
security update KB2533623 (and systems older than Windows 7) will not
restrict the search path to the executable's directory and the system
directory. They will instead use the default search order.

This will affect avisynth, mfenc, amfenc, vsrc_ddagrab, and
hwcontext_{d3d11va,d3d12va,dxva2,vaapi,vulkan}.

So support remains the same (all will still run), but for the older
systems security will be a bit more relaxed.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-07-30 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-30 14:09 [FFmpeg-devel] [PATCH 0/2] some cleanups for compat/w32dlfcn.h Ramiro Polla
2024-07-30 14:09 ` [FFmpeg-devel] [PATCH 1/2] compat/w32dlfcn: remove backup definitions for safe LoadLibrary flags Ramiro Polla
2024-07-30 15:29   ` James Almer
2024-07-30 14:09 ` [FFmpeg-devel] [PATCH 2/2] compat/w32dlfcn: remove support for pre-KB2533623 Win7 systems Ramiro Polla
2024-07-30 15:17   ` Rémi Denis-Courmont
2024-07-30 16:22     ` Ramiro Polla

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git