winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1085 discussions
Start a n
N
ew thread
Evan Stade : gdiplus: Added GdipBitmapLockBits.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 7a9a30d95c5b26bc93ce1698098d85cd488b4f53 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7a9a30d95c5b26bc93ce16980…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 7 18:41:55 2007 -0700 gdiplus: Added GdipBitmapLockBits. --- dlls/gdiplus/gdiplus.spec | 4 +- dlls/gdiplus/gdiplus_private.h | 3 + dlls/gdiplus/image.c | 141 ++++++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 2 + include/gdiplusgpstubs.h | 1 + include/gdiplusimaging.h | 31 +++++++++ include/gdiplustypes.h | 17 +++++ 7 files changed, 197 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index e0ea275..7e53322 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -41,10 +41,10 @@ @ stub GdipBitmapGetHistogram @ stub GdipBitmapGetHistogramSize @ stdcall GdipBitmapGetPixel(ptr long long ptr) -@ stub GdipBitmapLockBits +@ stdcall GdipBitmapLockBits(ptr ptr long long ptr) @ stub GdipBitmapSetPixel @ stub GdipBitmapSetResolution -@ stub GdipBitmapUnlockBits +@ stdcall GdipBitmapUnlockBits(ptr ptr) @ stub GdipClearPathMarkers @ stub GdipCloneBitmapArea @ stub GdipCloneBitmapAreaI diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index cea667f..79440a2 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -143,6 +143,9 @@ struct GpBitmap{ INT width; INT height; PixelFormat format; + ImageLockMode lockmode; + INT numlocks; + BYTE *bitmapbits; /* pointer to the buffer we passed in BitmapLockBits */ }; struct GpImageAttributes{ diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index c050fd2..59690c5 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -88,6 +88,147 @@ GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap* bitmap, INT x, INT y, return NotImplemented; } +/* This function returns a pointer to an array of pixels that represents the + * bitmap. The *entire* bitmap is locked according to the lock mode specified by + * flags. It is correct behavior that a user who calls this function with write + * privileges can write to the whole bitmap (not just the area in rect). + * + * FIXME: only used portion of format is bits per pixel. */ +GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, + UINT flags, PixelFormat format, BitmapData* lockeddata) +{ + BOOL bm_is_selected; + INT stride, bitspp = PIXELFORMATBPP(format); + OLE_HANDLE hbm; + HDC hdc; + HBITMAP old = NULL; + BITMAPINFO bmi; + BYTE *buff = NULL; + UINT abs_height; + + TRACE("%p %p %d %d %p\n", bitmap, rect, flags, format, lockeddata); + + if(!lockeddata || !bitmap || !rect) + return InvalidParameter; + + if(rect->X < 0 || rect->Y < 0 || (rect->X + rect->Width > bitmap->width) || + (rect->Y + rect->Height > bitmap->height) || !flags) + return InvalidParameter; + + if(flags & ImageLockModeUserInputBuf) + return NotImplemented; + + if((bitmap->lockmode & ImageLockModeWrite) || (bitmap->lockmode && + (flags & ImageLockModeWrite))) + return WrongState; + + IPicture_get_Handle(bitmap->image.picture, &hbm); + IPicture_get_CurDC(bitmap->image.picture, &hdc); + bm_is_selected = (hdc != 0); + + bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi.bmiHeader.biBitCount = 0; + + if(!bm_is_selected){ + hdc = GetDC(0); + old = SelectObject(hdc, (HBITMAP)hbm); + } + + /* fill out bmi */ + GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS); + + abs_height = abs(bmi.bmiHeader.biHeight); + stride = bmi.bmiHeader.biWidth * bitspp / 8; + stride = (stride + 3) & ~3; + + buff = GdipAlloc(stride * abs_height); + if(!buff) return OutOfMemory; + + bmi.bmiHeader.biBitCount = bitspp; + GetDIBits(hdc, (HBITMAP)hbm, 0, abs_height, buff, &bmi, DIB_RGB_COLORS); + + if(!bm_is_selected){ + SelectObject(hdc, old); + ReleaseDC(0, hdc); + } + + lockeddata->Width = rect->Width; + lockeddata->Height = rect->Height; + lockeddata->PixelFormat = format; + lockeddata->Reserved = flags; + + if(bmi.bmiHeader.biHeight > 0){ + lockeddata->Stride = -stride; + lockeddata->Scan0 = buff + (bitspp / 8) * rect->X + + stride * (abs_height - 1 - rect->Y); + } + else{ + lockeddata->Stride = stride; + lockeddata->Scan0 = buff + (bitspp / 8) * rect->X + stride * rect->Y; + } + + bitmap->lockmode = flags; + bitmap->numlocks++; + + if(flags & ImageLockModeWrite) + bitmap->bitmapbits = buff; + + return Ok; +} + +GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, + BitmapData* lockeddata) +{ + OLE_HANDLE hbm; + HDC hdc; + HBITMAP old = NULL; + BOOL bm_is_selected; + BITMAPINFO bmi; + + if(!bitmap || !lockeddata) + return InvalidParameter; + + if(!bitmap->lockmode) + return WrongState; + + if(lockeddata->Reserved & ImageLockModeUserInputBuf) + return NotImplemented; + + if(lockeddata->Reserved & ImageLockModeRead){ + if(!(--bitmap->numlocks)) + bitmap->lockmode = 0; + + GdipFree(lockeddata->Scan0); + return Ok; + } + + IPicture_get_Handle(bitmap->image.picture, &hbm); + IPicture_get_CurDC(bitmap->image.picture, &hdc); + bm_is_selected = (hdc != 0); + + bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi.bmiHeader.biBitCount = 0; + + if(!bm_is_selected){ + hdc = GetDC(0); + old = SelectObject(hdc, (HBITMAP)hbm); + } + + GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS); + bmi.bmiHeader.biBitCount = PIXELFORMATBPP(lockeddata->PixelFormat); + SetDIBits(hdc, (HBITMAP)hbm, 0, abs(bmi.bmiHeader.biHeight), + bitmap->bitmapbits, &bmi, DIB_RGB_COLORS); + + if(!bm_is_selected){ + SelectObject(hdc, old); + ReleaseDC(0, hdc); + } + + GdipFree(bitmap->bitmapbits); + + return Ok; +} + GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 8c96a2c..3035f0d 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -164,6 +164,8 @@ GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath*,GpPath*,GpLineCap,REAL, GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*); GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap*,INT,INT,ARGB*); +GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap*,GDIPCONST GpRect*,UINT, + PixelFormat,BitmapData*); GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*, GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream*,GpBitmap**); diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h index 772edd9..423cd9e 100644 --- a/include/gdiplusgpstubs.h +++ b/include/gdiplusgpstubs.h @@ -67,5 +67,6 @@ typedef DashStyle GpDashStyle; typedef MatrixOrder GpMatrixOrder; typedef Point GpPoint; typedef WrapMode GpWrapMode; +typedef Rect GpRect; #endif diff --git a/include/gdiplusimaging.h b/include/gdiplusimaging.h index c76aba5..28fe28b 100644 --- a/include/gdiplusimaging.h +++ b/include/gdiplusimaging.h @@ -19,6 +19,13 @@ #ifndef _GDIPLUSIMAGING_H #define _GDIPLUSIMAGING_H +enum ImageLockMode +{ + ImageLockModeRead = 1, + ImageLockModeWrite = 2, + ImageLockModeUserInputBuf = 4 +}; + #ifdef __cplusplus class EncoderParameter { @@ -35,8 +42,22 @@ public: UINT Count; EncoderParameter Parameter[1]; }; + +class BitmapData +{ +public: + UINT Width; + UINT Height; + INT Stride; + PixelFormat PixelFormat; + VOID* Scan0; + UINT_PTR Reserved; +}; + #else /* end of c++ typedefs */ +typedef enum ImageLockMode ImageLockMode; + typedef struct EncoderParameter { GUID Guid; @@ -51,6 +72,16 @@ typedef struct EncoderParameters EncoderParameter Parameter[1]; } EncoderParameters; +typedef struct BitmapData +{ + UINT Width; + UINT Height; + INT Stride; + PixelFormat PixelFormat; + VOID* Scan0; + UINT_PTR Reserved; /* undocumented: stores the lock mode */ +}BitmapData; + #endif /* end of c typedefs */ #endif /* _GDIPLUSIMAGING_H */ diff --git a/include/gdiplustypes.h b/include/gdiplustypes.h index c316073..96112ea 100644 --- a/include/gdiplustypes.h +++ b/include/gdiplustypes.h @@ -177,6 +177,15 @@ public: REAL Height; }; +class Rect +{ +public: + INT X; + INT Y; + INT Width; + INT Height; +}; + #else /* end of c++ typedefs */ typedef struct Point @@ -206,6 +215,14 @@ typedef struct RectF REAL Height; } RectF; +typedef struct Rect +{ + INT X; + INT Y; + INT Width; + INT Height; +} Rect; + typedef enum Status Status; #endif /* end of c typedefs */
1
0
0
0
Tijl Coosemans : ntdll: Implement CDROM_Verify for FreeBSD.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 5fb1c162765d392adff9729a3f622460de055aad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5fb1c162765d392adff9729a3…
Author: Tijl Coosemans <tijl(a)ulyssis.org> Date: Wed Aug 8 00:30:59 2007 +0200 ntdll: Implement CDROM_Verify for FreeBSD. --- dlls/ntdll/cdrom.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c index 269c41f..c6e6cd3 100644 --- a/dlls/ntdll/cdrom.c +++ b/dlls/ntdll/cdrom.c @@ -1036,6 +1036,13 @@ static NTSTATUS CDROM_Verify(int dev, int fd) return STATUS_SUCCESS; else return STATUS_NO_MEDIA_IN_DEVICE; +#elif defined(__FreeBSD__) + int ret; + ret = ioctl(fd, CDIOCSTART, NULL); + if(ret == 0) + return STATUS_SUCCESS; + else + return STATUS_NO_MEDIA_IN_DEVICE; #else FIXME("not implemented for non-linux\n"); return STATUS_NOT_SUPPORTED;
1
0
0
0
Tijl Coosemans : wineoss: Avoid SNDCTL_DSP_GETTRIGGER.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 3429068f35376f2d817b7ba8b98af69adc6a3a60 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3429068f35376f2d817b7ba8b…
Author: Tijl Coosemans <tijl(a)ulyssis.org> Date: Wed Aug 8 00:19:14 2007 +0200 wineoss: Avoid SNDCTL_DSP_GETTRIGGER. --- dlls/wineoss.drv/audio.c | 26 ++++++++------------------ 1 files changed, 8 insertions(+), 18 deletions(-) diff --git a/dlls/wineoss.drv/audio.c b/dlls/wineoss.drv/audio.c index e9c93f7..5c233da 100644 --- a/dlls/wineoss.drv/audio.c +++ b/dlls/wineoss.drv/audio.c @@ -389,18 +389,16 @@ static DWORD OSS_RawOpenDevice(OSS_DEVICE* ossdev, int strict_format) } ossdev->fd = fd; + ossdev->bOutputEnabled = TRUE; /* OSS enables by default */ + ossdev->bInputEnabled = TRUE; /* OSS enables by default */ + if (ossdev->open_access == O_RDONLY) + ossdev->bOutputEnabled = FALSE; + if (ossdev->open_access == O_WRONLY) + ossdev->bInputEnabled = FALSE; + if (ossdev->bTriggerSupport) { int trigger; - rc = ioctl(fd, SNDCTL_DSP_GETTRIGGER, &trigger); - if (rc != 0) { - ERR("ioctl(%s, SNDCTL_DSP_GETTRIGGER) failed (%s)\n", - ossdev->dev_name, strerror(errno)); - goto error; - } - - ossdev->bOutputEnabled = ((trigger & PCM_ENABLE_OUTPUT) == PCM_ENABLE_OUTPUT); - ossdev->bInputEnabled = ((trigger & PCM_ENABLE_INPUT) == PCM_ENABLE_INPUT); - + trigger = getEnables(ossdev); /* If we do not have full duplex, but they opened RDWR ** (as you have to in order for an mmap to succeed) ** then we start out with input off @@ -411,16 +409,8 @@ static DWORD OSS_RawOpenDevice(OSS_DEVICE* ossdev, int strict_format) trigger &= ~PCM_ENABLE_INPUT; ioctl(fd, SNDCTL_DSP_SETTRIGGER, &trigger); } - } else { - ossdev->bOutputEnabled = TRUE; /* OSS enables by default */ - ossdev->bInputEnabled = TRUE; /* OSS enables by default */ } - if (ossdev->open_access == O_RDONLY) - ossdev->bOutputEnabled = FALSE; - if (ossdev->open_access == O_WRONLY) - ossdev->bInputEnabled = FALSE; - return MMSYSERR_NOERROR; error:
1
0
0
0
Tijl Coosemans : wineoss: Add SNDCTL_MIXERINFO support.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 002596091712c61ce079e19fce1b8dc712dd8a96 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=002596091712c61ce079e19fc…
Author: Tijl Coosemans <tijl(a)ulyssis.org> Date: Wed Aug 8 00:11:01 2007 +0200 wineoss: Add SNDCTL_MIXERINFO support. --- dlls/wineoss.drv/audio.c | 63 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 60 insertions(+), 3 deletions(-) diff --git a/dlls/wineoss.drv/audio.c b/dlls/wineoss.drv/audio.c index 98f5a70..e9c93f7 100644 --- a/dlls/wineoss.drv/audio.c +++ b/dlls/wineoss.drv/audio.c @@ -720,7 +720,29 @@ static BOOL OSS_WaveOutInit(OSS_DEVICE* ossdev) ioctl(ossdev->fd, SNDCTL_DSP_RESET, 0); -#ifdef SOUND_MIXER_INFO +#if defined(SNDCTL_MIXERINFO) + { + int mixer; + if ((mixer = open(ossdev->mixer_name, O_RDONLY|O_NDELAY)) >= 0) { + oss_mixerinfo info; + info.dev = 0; + if (ioctl(mixer, SNDCTL_MIXERINFO, &info) >= 0) { + lstrcpynA(ossdev->ds_desc.szDesc, info.name, sizeof(info.name)); + strcpy(ossdev->ds_desc.szDrvname, "wineoss.drv"); + MultiByteToWideChar(CP_ACP, 0, info.name, sizeof(info.name), + ossdev->out_caps.szPname, + sizeof(ossdev->out_caps.szPname) / sizeof(WCHAR)); + TRACE("%s: %s\n", ossdev->mixer_name, ossdev->ds_desc.szDesc); + has_mixer = TRUE; + } else { + WARN("%s: cannot read SNDCTL_MIXERINFO!\n", ossdev->mixer_name); + } + close(mixer); + } else { + WARN("open(%s) failed (%s)\n", ossdev->mixer_name , strerror(errno)); + } + } +#elif defined(SOUND_MIXER_INFO) { int mixer; if ((mixer = open(ossdev->mixer_name, O_RDONLY|O_NDELAY)) >= 0) { @@ -874,7 +896,26 @@ static BOOL OSS_WaveInInit(OSS_DEVICE* ossdev) ioctl(ossdev->fd, SNDCTL_DSP_RESET, 0); -#ifdef SOUND_MIXER_INFO +#if defined(SNDCTL_MIXERINFO) + { + int mixer; + if ((mixer = open(ossdev->mixer_name, O_RDONLY|O_NDELAY)) >= 0) { + oss_mixerinfo info; + info.dev = 0; + if (ioctl(mixer, SNDCTL_MIXERINFO, &info) >= 0) { + MultiByteToWideChar(CP_ACP, 0, info.name, -1, + ossdev->in_caps.szPname, + sizeof(ossdev->in_caps.szPname) / sizeof(WCHAR)); + TRACE("%s: %s\n", ossdev->mixer_name, ossdev->ds_desc.szDesc); + } else { + WARN("%s: cannot read SNDCTL_MIXERINFO!\n", ossdev->mixer_name); + } + close(mixer); + } else { + WARN("open(%s) failed (%s)\n", ossdev->mixer_name, strerror(errno)); + } + } +#elif defined(SOUND_MIXER_INFO) { int mixer; if ((mixer = open(ossdev->mixer_name, O_RDONLY|O_NDELAY)) >= 0) { @@ -995,7 +1036,23 @@ static void OSS_WaveFullDuplexInit(OSS_DEVICE* ossdev) ioctl(ossdev->fd, SNDCTL_DSP_RESET, 0); -#ifdef SOUND_MIXER_INFO +#if defined(SNDCTL_MIXERINFO) + { + int mixer; + if ((mixer = open(ossdev->mixer_name, O_RDWR|O_NDELAY)) >= 0) { + oss_mixerinfo info; + info.dev = 0; + if (ioctl(mixer, SNDCTL_MIXERINFO, &info) >= 0) { + has_mixer = TRUE; + } else { + WARN("%s: cannot read SNDCTL_MIXERINFO!\n", ossdev->mixer_name); + } + close(mixer); + } else { + WARN("open(%s) failed (%s)\n", ossdev->mixer_name , strerror(errno)); + } + } +#elif defined(SOUND_MIXER_INFO) { int mixer; if ((mixer = open(ossdev->mixer_name, O_RDWR|O_NDELAY)) >= 0) {
1
0
0
0
Roderick Colenbrander : wined3d: Move over to WGL.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: ac3927a73e6bfb4e679ac4a1a92d7e64ad3f1489 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ac3927a73e6bfb4e679ac4a1a…
Author: Roderick Colenbrander <thunderbird2k(a)gmx.net> Date: Wed Aug 8 03:09:38 2007 +0200 wined3d: Move over to WGL. --- dlls/wined3d/context.c | 211 ++++++++++++++++----------------------- dlls/wined3d/device.c | 45 ++------- dlls/wined3d/directx.c | 163 +++++++++++++------------------ dlls/wined3d/swapchain.c | 37 +------ dlls/wined3d/wined3d_private.h | 12 +-- include/wine/wined3d_gl.h | 152 ++++++++++++++++++++--------- 6 files changed, 281 insertions(+), 339 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=ac3927a73e6bfb4e679ac…
1
0
0
0
Roderick Colenbrander : wined3d: Prepare pbuffer code for WGL transition.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 58275065a19a1db7a8e48e3c631052405055e8fa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=58275065a19a1db7a8e48e3c6…
Author: Roderick Colenbrander <thunderbird2k(a)gmx.net> Date: Mon Aug 6 20:53:20 2007 +0200 wined3d: Prepare pbuffer code for WGL transition. --- dlls/wined3d/context.c | 119 ++++++---------------------- dlls/wined3d/utils.c | 170 ---------------------------------------- dlls/wined3d/wined3d_private.h | 2 - 3 files changed, 26 insertions(+), 265 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=58275065a19a1db7a8e48…
1
0
0
0
Roderick Colenbrander : wined3d: Move fake context code over to WGL.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: 107ff2057de5fd8bf25feda05bb7bcbbfc93e64b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=107ff2057de5fd8bf25feda05…
Author: Roderick Colenbrander <thunderbird2k(a)gmx.net> Date: Tue Aug 7 23:45:00 2007 +0200 wined3d: Move fake context code over to WGL. --- dlls/wined3d/directx.c | 104 ++++++++++++++++++++++++------------------ dlls/wined3d/wined3d_main.c | 22 +++++++++ 2 files changed, 81 insertions(+), 45 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index b3182a5..8dd6d2c 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -164,7 +164,8 @@ DWORD minMipLookup[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1]; static int wined3d_fake_gl_context_ref = 0; static BOOL wined3d_fake_gl_context_foreign; static BOOL wined3d_fake_gl_context_available = FALSE; -static Display* wined3d_fake_gl_context_display = NULL; +static HDC wined3d_fake_gl_context_hdc = NULL; +static HWND wined3d_fake_gl_context_hwnd = NULL; static CRITICAL_SECTION wined3d_fake_gl_context_cs; static CRITICAL_SECTION_DEBUG wined3d_fake_gl_context_cs_debug = @@ -177,7 +178,7 @@ static CRITICAL_SECTION_DEBUG wined3d_fake_gl_context_cs_debug = static CRITICAL_SECTION wined3d_fake_gl_context_cs = { &wined3d_fake_gl_context_cs_debug, -1, 0, 0, 0, 0 }; static void WineD3D_ReleaseFakeGLContext(void) { - GLXContext glCtx; + HGLRC glCtx; EnterCriticalSection(&wined3d_fake_gl_context_cs); @@ -187,15 +188,21 @@ static void WineD3D_ReleaseFakeGLContext(void) { return; } - glCtx = glXGetCurrentContext(); + glCtx = wglGetCurrentContext(); TRACE_(d3d_caps)("decrementing ref from %i\n", wined3d_fake_gl_context_ref); if (0 == (--wined3d_fake_gl_context_ref) ) { if(!wined3d_fake_gl_context_foreign && glCtx) { TRACE_(d3d_caps)("destroying fake GL context\n"); - glXMakeCurrent(wined3d_fake_gl_context_display, None, NULL); - glXDestroyContext(wined3d_fake_gl_context_display, glCtx); + wglMakeCurrent(NULL, NULL); + wglDeleteContext(glCtx); } + if(wined3d_fake_gl_context_hdc) + ReleaseDC(wined3d_fake_gl_context_hwnd, wined3d_fake_gl_context_hdc); + wined3d_fake_gl_context_hdc = NULL; /* Make sure we don't think that it is still around */ + if(wined3d_fake_gl_context_hwnd) + DestroyWindow(wined3d_fake_gl_context_hwnd); + wined3d_fake_gl_context_hwnd = NULL; wined3d_fake_gl_context_available = FALSE; } assert(wined3d_fake_gl_context_ref >= 0); @@ -205,84 +212,89 @@ static void WineD3D_ReleaseFakeGLContext(void) { } static BOOL WineD3D_CreateFakeGLContext(void) { - XVisualInfo* visInfo; - GLXContext glCtx; + GLXContext glCtx; + HGLRC wglCtx = NULL; ENTER_GL(); EnterCriticalSection(&wined3d_fake_gl_context_cs); - TRACE_(d3d_caps)("getting context...\n"); + TRACE("getting context...\n"); if(wined3d_fake_gl_context_ref > 0) goto ret; assert(0 == wined3d_fake_gl_context_ref); wined3d_fake_gl_context_foreign = TRUE; - if(!wined3d_fake_gl_context_display) { - HDC device_context = GetDC(0); - - wined3d_fake_gl_context_display = get_display(device_context); - ReleaseDC(0, device_context); - } - - visInfo = NULL; glCtx = glXGetCurrentContext(); - if (!glCtx) { - Drawable drawable; - XVisualInfo template; - Visual* visual; - int num; - XWindowAttributes win_attr; + PIXELFORMATDESCRIPTOR pfd; + int iPixelFormat; wined3d_fake_gl_context_foreign = FALSE; - drawable = (Drawable) GetPropA(GetDesktopWindow(), "__wine_x11_whole_window"); - - TRACE_(d3d_caps)("Creating Fake GL Context\n"); - /* Get the X visual */ - if (XGetWindowAttributes(wined3d_fake_gl_context_display, drawable, &win_attr)) { - visual = win_attr.visual; - } else { - visual = DefaultVisual(wined3d_fake_gl_context_display, DefaultScreen(wined3d_fake_gl_context_display)); + /* We need a fake window as a hdc retrieved using GetDC(0) can't be used for much GL purposes */ + wined3d_fake_gl_context_hwnd = CreateWindowA("WineD3D_OpenGL", "WineD3D fake window", WS_OVERLAPPEDWINDOW, 10, 10, 10, 10, NULL, NULL, NULL, NULL); + if(!wined3d_fake_gl_context_hwnd) { + ERR("HWND creation failed!\n"); + goto fail; } - template.visualid = XVisualIDFromVisual(visual); - visInfo = XGetVisualInfo(wined3d_fake_gl_context_display, VisualIDMask, &template, &num); - if (!visInfo) { - WARN_(d3d_caps)("Error creating visual info for capabilities initialization\n"); + wined3d_fake_gl_context_hdc = GetDC(wined3d_fake_gl_context_hwnd); + if(!wined3d_fake_gl_context_hdc) { + ERR("GetDC failed!\n"); + goto fail; + } + + /* PixelFormat selection */ + ZeroMemory(&pfd, sizeof(pfd)); + pfd.nSize = sizeof(pfd); + pfd.nVersion = 1; + pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW;/*PFD_GENERIC_ACCELERATED*/ + pfd.iPixelType = PFD_TYPE_RGBA; + pfd.cColorBits = 32; + pfd.iLayerType = PFD_MAIN_PLANE; + + iPixelFormat = ChoosePixelFormat(wined3d_fake_gl_context_hdc, &pfd); + if(!iPixelFormat) { + /* If this happens something is very wrong as ChoosePixelFormat barely fails */ + ERR("Can't find a suitable iPixelFormat\n"); goto fail; } + DescribePixelFormat(wined3d_fake_gl_context_hdc, iPixelFormat, sizeof(pfd), &pfd); + SetPixelFormat(wined3d_fake_gl_context_hdc, iPixelFormat, &pfd); /* Create a GL context */ - glCtx = glXCreateContext(wined3d_fake_gl_context_display, visInfo, NULL, GL_TRUE); - if (!glCtx) { + wglCtx = wglCreateContext(wined3d_fake_gl_context_hdc); + if (!wglCtx) { WARN_(d3d_caps)("Error creating default context for capabilities initialization\n"); goto fail; } /* Make it the current GL context */ - if (!glXMakeCurrent(wined3d_fake_gl_context_display, drawable, glCtx)) { + if (!wglMakeCurrent(wined3d_fake_gl_context_hdc, wglCtx)) { WARN_(d3d_caps)("Error setting default context as current for capabilities initialization\n"); goto fail; } - - XFree(visInfo); - } ret: - TRACE_(d3d_caps)("incrementing ref from %i\n", wined3d_fake_gl_context_ref); + TRACE("incrementing ref from %i\n", wined3d_fake_gl_context_ref); wined3d_fake_gl_context_ref++; wined3d_fake_gl_context_available = TRUE; LeaveCriticalSection(&wined3d_fake_gl_context_cs); return TRUE; fail: - if(visInfo) XFree(visInfo); - if(glCtx) glXDestroyContext(wined3d_fake_gl_context_display, glCtx); + if(wined3d_fake_gl_context_hdc) + ReleaseDC(wined3d_fake_gl_context_hwnd, wined3d_fake_gl_context_hdc); + wined3d_fake_gl_context_hdc = NULL; + if(wined3d_fake_gl_context_hwnd) + DestroyWindow(wined3d_fake_gl_context_hwnd); + wined3d_fake_gl_context_hwnd = NULL; + if(wglCtx) wglDeleteContext(wglCtx); LeaveCriticalSection(&wined3d_fake_gl_context_cs); LEAVE_GL(); return FALSE; } + /********************************************************** * IUnknown parts follows **********************************************************/ @@ -1490,6 +1502,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceType(IWineD3D *iface, UINT Adapter GLXFBConfig* cfgs = NULL; int nCfgs = 0; int it; + Display *display; HRESULT hr = WINED3DERR_NOTAVAILABLE; TRACE_(d3d_caps)("(%p)-> (STUB) (Adptr:%d, CheckType:(%x,%s), DispFmt:(%x,%s), BackBuf:(%x,%s), Win?%d): stub\n", @@ -1507,9 +1520,10 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceType(IWineD3D *iface, UINT Adapter /* TODO: Store in adapter structure */ if (WineD3D_CreateFakeGLContext()) { - cfgs = glXGetFBConfigs(wined3d_fake_gl_context_display, DefaultScreen(wined3d_fake_gl_context_display), &nCfgs); + display = get_display(wined3d_fake_gl_context_hdc); + cfgs = glXGetFBConfigs(display, DefaultScreen(display), &nCfgs); for (it = 0; it < nCfgs; ++it) { - if (IWineD3DImpl_IsGLXFBConfigCompatibleWithRenderFmt(wined3d_fake_gl_context_display, cfgs[it], DisplayFormat)) { + if (IWineD3DImpl_IsGLXFBConfigCompatibleWithRenderFmt(display, cfgs[it], DisplayFormat)) { hr = WINED3D_OK; TRACE_(d3d_caps)("OK\n"); break ; diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index d1cf28a..1f35056 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -106,8 +106,30 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) HKEY hkey = 0; HKEY appkey = 0; DWORD len; + WNDCLASSA wc; + wined3d_settings.emulated_textureram = 64*1024*1024; + /* We need our own window class for a fake window which we use to retrieve GL capabilities */ + /* We might need CS_OWNDC in the future if we notice strange things on Windows. + * Various articles/posts about OpenGL problems on Windows recommend this. */ + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = DefWindowProcA; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstDLL; + wc.hIcon = LoadIconA(NULL, (LPCSTR)IDI_WINLOGO); + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); + wc.hbrBackground = NULL; + wc.lpszMenuName = NULL; + wc.lpszClassName = "WineD3D_OpenGL"; + + if (!RegisterClassA(&wc) && GetLastError() != ERROR_CLASS_ALREADY_EXISTS) + { + ERR("Failed to register window class 'WineD3D_OpenGL'!"); + return FALSE; + } + DisableThreadLibraryCalls(hInstDLL); mod = GetModuleHandleA( "winex11.drv" );
1
0
0
0
Juan Lang : crypt32: According to MSDN, inner content is only decoded when the content type is data.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: c9a54102883bab8357993b982c4ef1954c4dcbf2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c9a54102883bab8357993b982…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Aug 7 14:57:04 2007 -0700 crypt32: According to MSDN, inner content is only decoded when the content type is data. --- dlls/crypt32/msg.c | 30 ++++++++++++++++++------------ 1 files changed, 18 insertions(+), 12 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 30ec62a..70527bd 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1742,20 +1742,26 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType, case CMSG_CONTENT_PARAM: if (msg->u.signedInfo) { - CRYPT_DATA_BLOB *blob; - DWORD size; - - /* FIXME: does this depend on inner content type? */ - ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_OCTET_STRING, - msg->u.signedInfo->content.Content.pbData, - msg->u.signedInfo->content.Content.cbData, CRYPT_DECODE_ALLOC_FLAG, - NULL, (LPBYTE)&blob, &size); - if (ret) + if (!strcmp(msg->u.signedInfo->content.pszObjId, szOID_RSA_data)) { - ret = CRYPT_CopyParam(pvData, pcbData, blob->pbData, - blob->cbData); - LocalFree(blob); + CRYPT_DATA_BLOB *blob; + DWORD size; + + ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_OCTET_STRING, + msg->u.signedInfo->content.Content.pbData, + msg->u.signedInfo->content.Content.cbData, + CRYPT_DECODE_ALLOC_FLAG, NULL, (LPBYTE)&blob, &size); + if (ret) + { + ret = CRYPT_CopyParam(pvData, pcbData, blob->pbData, + blob->cbData); + LocalFree(blob); + } } + else + ret = CRYPT_CopyParam(pvData, pcbData, + msg->u.signedInfo->content.Content.pbData, + msg->u.signedInfo->content.Content.cbData); } else SetLastError(CRYPT_E_INVALID_MSG_TYPE);
1
0
0
0
Juan Lang : crypt32: Add a couple traces.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: c5a213a816379092f76e50dc6602ad03b953c8bf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c5a213a816379092f76e50dc6…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Aug 7 14:56:26 2007 -0700 crypt32: Add a couple traces. --- dlls/crypt32/context.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/context.c b/dlls/crypt32/context.c index ab57c57..977ea1d 100644 --- a/dlls/crypt32/context.c +++ b/dlls/crypt32/context.c @@ -71,6 +71,7 @@ void *Context_CreateDataContext(size_t contextSize) ret = NULL; } } + TRACE("returning %p\n", ret); return ret; } @@ -96,6 +97,7 @@ void *Context_CreateLinkContext(unsigned int contextSize, void *linked, unsigned InterlockedIncrement(&linkedBase->ref); TRACE("%p's ref count is %d\n", context, linkContext->ref); } + TRACE("returning %p\n", context); return context; }
1
0
0
0
Juan Lang : crypt32: Test and correct finding a subject certificate.
by Alexandre Julliard
08 Aug '07
08 Aug '07
Module: wine Branch: master Commit: bcbf5dcee337d83540c188a6572974ead74219cd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bcbf5dcee337d83540c188a65…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Aug 7 13:15:00 2007 -0700 crypt32: Test and correct finding a subject certificate. --- dlls/crypt32/cert.c | 8 +++++++- dlls/crypt32/tests/cert.c | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletions(-) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index 5e5bed8..ea1d261 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -906,9 +906,15 @@ static BOOL compare_cert_by_subject_cert(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, const void *pvPara) { CERT_INFO *pCertInfo = (CERT_INFO *)pvPara; + BOOL ret; - return CertCompareCertificateName(pCertContext->dwCertEncodingType, + ret = CertCompareCertificateName(pCertContext->dwCertEncodingType, &pCertInfo->Issuer, &pCertContext->pCertInfo->Subject); + if (ret && pCertInfo->SerialNumber.cbData) + ret = CertCompareIntegerBlob(&pCertContext->pCertInfo->SerialNumber, + &pCertInfo->SerialNumber); + TRACE("returning %d\n", ret); + return ret; } static BOOL compare_cert_by_cert_id(PCCERT_CONTEXT pCertContext, DWORD dwType, diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c index ab668ae..af58b5f 100644 --- a/dlls/crypt32/tests/cert.c +++ b/dlls/crypt32/tests/cert.c @@ -604,6 +604,7 @@ static void testFindCert(void) BOOL ret; CERT_INFO certInfo = { 0 }; CRYPT_HASH_BLOB blob; + BYTE otherSerialNumber[] = { 2 }; store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); @@ -685,6 +686,27 @@ static void testFindCert(void) CERT_FIND_SUBJECT_CERT, &certInfo.Subject, context); ok(context == NULL, "Expected one cert only\n"); } + /* The above search matched even though no serial number is set. A + * non-matching serial number will not match. + */ + certInfo.SerialNumber.pbData = otherSerialNumber; + certInfo.SerialNumber.cbData = sizeof(otherSerialNumber); + context = CertFindCertificateInStore(store, X509_ASN_ENCODING, 0, + CERT_FIND_SUBJECT_CERT, &certInfo, NULL); + ok(context == NULL, "Expected no match\n"); + /* A matching serial number will match. */ + certInfo.SerialNumber.pbData = serialNum; + certInfo.SerialNumber.cbData = sizeof(serialNum); + context = CertFindCertificateInStore(store, X509_ASN_ENCODING, 0, + CERT_FIND_SUBJECT_CERT, &certInfo, NULL); + ok(context != NULL, "CertFindCertificateInStore failed: %08x\n", + GetLastError()); + if (context) + { + context = CertFindCertificateInStore(store, X509_ASN_ENCODING, 0, + CERT_FIND_SUBJECT_CERT, &certInfo.Subject, context); + ok(context == NULL, "Expected one cert only\n"); + } /* The nice thing about hashes, they're unique */ blob.pbData = bigCertHash;
1
0
0
0
← Newer
1
...
78
79
80
81
82
83
84
...
109
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Results per page:
10
25
50
100
200