### ImageMagick version

7.1.1-21

### Operating system

Windows

### Operating system, version and so on

Windows 11

### Description

When an application is distributed with DLLs from ImageMagick-\*-x64-dll.exe installation, it needs to set `MAGICK_CODER_MODULE_PATH` at runtime to load the coders, however, it is impossible if ImageMagick uses `getenv`. Please see the discussion here: https://github.com/curl/curl/issues/4774.

### Steps to Reproduce

- Set `MAGICK_CODER_MODULE_PATH` by win32 `SetEnvironmentVariable`.
- Error: "failed to read image"


### Images

_No response_
Read environment variable using Windows API GetEnvironmentVariable instead of C runtime getenv
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Read environment variable using Windows API GetEnvironmentVariable instead of C runtime getenv
Issue date:

--- start body ---
### ImageMagick version

7.1.1-21

### Operating system

Windows

### Operating system, version and so on

Windows 11

### Description

When an application is distributed with DLLs from ImageMagick-\*-x64-dll.exe installation, it needs to set `MAGICK_CODER_MODULE_PATH` at runtime to load the coders, however, it is impossible if ImageMagick uses `getenv`. Please see the discussion here: https://github.com/curl/curl/issues/4774.

### Steps to Reproduce

- Set `MAGICK_CODER_MODULE_PATH` by win32 `SetEnvironmentVariable`.
- Error: "failed to read image"


### Images

_No response_
--- end body ---

None