Skip to content

Commit b0ae527

Browse files
committed
Moved all windows implementations in utility-private to nt-base-private.
1 parent 139277a commit b0ae527

File tree

7 files changed

+665
-336
lines changed

7 files changed

+665
-336
lines changed

coders/dng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
488488
wchar_t
489489
*path;
490490

491-
path=create_wchar_path(image->filename);
491+
path=NTCreateWidePath(image->filename);
492492
if (path != (wchar_t *) NULL)
493493
{
494494
errcode=libraw_open_wfile(raw_info,path);

coders/emf.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ static Image *ReadEMFImage(const ImageInfo *image_info,
702702
*p;
703703

704704
wchar_t
705-
fileName[MaxTextExtent];
705+
*path;
706706

707707
assert(image_info != (const ImageInfo *) NULL);
708708
assert(image_info->signature == MagickCoreSignature);
@@ -714,14 +714,18 @@ static Image *ReadEMFImage(const ImageInfo *image_info,
714714
if (Gdiplus::GdiplusStartup(&token,&startup_input,NULL) !=
715715
Gdiplus::Status::Ok)
716716
ThrowReaderException(CoderError, "GdiplusStartupFailed");
717-
MultiByteToWideChar(CP_UTF8,0,image->filename,-1,fileName,MaxTextExtent);
718-
source=Gdiplus::Image::FromFile(fileName);
717+
source=(Gdiplus::Image *) NULL;
718+
path=NTCreateWidePath(image->filename);
719+
if (path != (wchar_t *) NULL)
720+
{
721+
source=Gdiplus::Image::FromFile(path);
722+
path=(wchar_t *) RelinquishMagickMemory(path);
723+
}
719724
if (source == (Gdiplus::Image *) NULL)
720725
{
721726
Gdiplus::GdiplusShutdown(token);
722727
ThrowReaderException(FileOpenError,"UnableToOpenFile");
723728
}
724-
725729
image->x_resolution=source->GetHorizontalResolution();
726730
image->y_resolution=source->GetVerticalResolution();
727731
image->columns=(size_t) source->GetWidth();

magick/blob.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2624,7 +2624,7 @@ static inline gzFile gzopen_utf8(const char *path,const char *mode)
26242624
wchar_t
26252625
*path_wide;
26262626

2627-
path_wide=create_wchar_path(path);
2627+
path_wide=NTCreateWidePath(path);
26282628
if (path_wide == (wchar_t *) NULL)
26292629
return((gzFile) NULL);
26302630
file=gzopen_w(path_wide,mode);

magick/nt-base-private.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ struct timezone
6262
tz_minuteswest,
6363
tz_dsttime;
6464
};
65+
66+
typedef int
67+
mode_t;
6568
#endif
6669

6770
#endif
@@ -86,6 +89,9 @@ static inline void *NTAcquireQuantumMemory(const size_t count,
8689
return(AcquireMagickMemory(size));
8790
}
8891

92+
extern MagickExport char
93+
*NTRealPathWide(const char *);
94+
8995
extern MagickPrivate char
9096
*NTGetEnvironmentValue(const char *);
9197

@@ -105,6 +111,18 @@ extern MagickPrivate double
105111
NTElapsedTime(void),
106112
NTUserTime(void);
107113

114+
extern MagickExport FILE
115+
*NTOpenFileWide(const char *,const char *),
116+
*NTOpenPipeWide(const char *,const char *);
117+
118+
extern MagickExport int
119+
NTAccessWide(const char *,int),
120+
NTOpenWide(const char *,int,mode_t),
121+
NTRemoveWide(const char *),
122+
NTRenameWide(const char *, const char *),
123+
NTSetFileTimestamp(const char *,struct stat *),
124+
NTStatWide(const char *,struct stat *);
125+
108126
extern MagickPrivate int
109127
#if !defined(__MINGW32__)
110128
gettimeofday(struct timeval *,struct timezone *),
@@ -148,6 +166,9 @@ extern MagickPrivate void
148166
NTWindowsGenesis(void),
149167
NTWindowsTerminus(void);
150168

169+
extern MagickExport wchar_t
170+
*NTCreateWidePath(const char *);
171+
151172
#endif /* !XS_VERSION */
152173

153174
#endif /* MAGICKCORE_WINDOWS_SUPPORT */

0 commit comments

Comments
 (0)