merge trunk head (37902)
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 6 Dec 2008 19:06:05 +0000 (19:06 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 6 Dec 2008 19:06:05 +0000 (19:06 +0000)
svn path=/branches/ros-amd64-bringup/; revision=37904

97 files changed:
reactos/base/services/umpnpmgr/umpnpmgr.c
reactos/baseaddress.rbuild
reactos/boot/bootdata/packages/reactos.dff
reactos/dll/win32/gdiplus/brush.c
reactos/dll/win32/gdiplus/font.c
reactos/dll/win32/gdiplus/gdiplus.c
reactos/dll/win32/gdiplus/gdiplus.spec
reactos/dll/win32/gdiplus/gdiplus_private.h
reactos/dll/win32/gdiplus/graphics.c
reactos/dll/win32/gdiplus/graphicspath.c
reactos/dll/win32/gdiplus/image.c
reactos/dll/win32/gdiplus/matrix.c
reactos/dll/win32/gdiplus/pen.c
reactos/dll/win32/gdiplus/region.c
reactos/dll/win32/localui/localui.c [new file with mode: 0644]
reactos/dll/win32/localui/localui.h [new file with mode: 0644]
reactos/dll/win32/localui/localui.rbuild [new file with mode: 0644]
reactos/dll/win32/localui/localui.rc [new file with mode: 0644]
reactos/dll/win32/localui/localui.spec [new file with mode: 0644]
reactos/dll/win32/localui/ui_Da.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_De.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_En.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_Fr.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_Ko.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_Nl.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_No.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_Pl.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_Pt.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_Ro.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_Ru.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_Si.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_Sv.rc [new file with mode: 0644]
reactos/dll/win32/localui/ui_Zh.rc [new file with mode: 0644]
reactos/dll/win32/mlang/mlang.c
reactos/dll/win32/setupapi/queue.c
reactos/dll/win32/setupapi/setupapi.spec
reactos/dll/win32/setupapi/stubs.c
reactos/dll/win32/win32.rbuild
reactos/dll/win32/winspool/stubs.c
reactos/dll/win32/winspool/winspool.spec
reactos/drivers/storage/class/cdrom/cdrom.c
reactos/drivers/wdm/audio/backpln/portcls/Miniport.cpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/MiniportMidi.cpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/Port.cpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/PortMidi.cpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/PortTopology.cpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/PortWaveCyclic.cpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/adapter.c
reactos/drivers/wdm/audio/backpln/portcls/api.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/dma_master.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/miniport.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/miniport_fmsynth.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/port.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/port_dmus.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/port_midi.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild
reactos/drivers/wdm/audio/backpln/portcls/private.h
reactos/drivers/wdm/audio/backpln/portcls/registry.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/resource.c [new file with mode: 0644]
reactos/drivers/wdm/audio/backpln/portcls/stubs.c
reactos/include/ddk/ntifs.h
reactos/include/ddk/wdm.h
reactos/include/ddk/winddk.h
reactos/include/ddk/winsplp.h [new file with mode: 0644]
reactos/include/psdk/gdiplusenums.h
reactos/include/psdk/gdiplusflat.h
reactos/include/psdk/gdiplusgpstubs.h
reactos/include/psdk/gdiplusimaging.h
reactos/include/psdk/gdiplusmem.h
reactos/include/psdk/ole2.h
reactos/include/psdk/shlobj.h
reactos/include/psdk/winspool.h
reactos/include/reactos/arm/armddk.h
reactos/media/doc/README.WINE
reactos/ntoskrnl/include/internal/ntoskrnl.h
reactos/subsystems/win32/csrss/win32csr/appswitch.c
reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild
reactos/tools/widl/client.c
reactos/tools/widl/header.c
reactos/tools/widl/header.h
reactos/tools/widl/parser.l
reactos/tools/widl/parser.tab.c
reactos/tools/widl/parser.y
reactos/tools/widl/parser.yy.c
reactos/tools/widl/proxy.c
reactos/tools/widl/server.c
reactos/tools/widl/typegen.c

index cb6daf4..39c9e14 100644 (file)
@@ -2221,11 +2221,6 @@ ServiceMain(DWORD argc, LPTSTR *argv)
 
     DPRINT("ServiceMain() called\n");
 
-    hNoPendingInstalls = CreateEventW(NULL,
-                                      TRUE,
-                                      FALSE,
-                                      L"Global\\PnP_No_Pending_Install_Events");
-
     hThread = CreateThread(NULL,
                            0,
                            PnpEventThread,
@@ -2283,6 +2278,17 @@ wmain(int argc, WCHAR *argv[])
         return dwError;
     }
 
+    hNoPendingInstalls = CreateEventW(NULL,
+                                      TRUE,
+                                      FALSE,
+                                      L"Global\\PnP_No_Pending_Install_Events");
+    if (hNoPendingInstalls == NULL)
+    {
+        dwError = GetLastError();
+        DPRINT1("Could not create the Event! (Error %lu)\n", dwError);
+        return dwError;
+    }
+
 #ifdef HAVE_SLIST_ENTRY_IMPLEMENTED
     InitializeSListHead(&DeviceInstallListHead);
 #else
index e7b181d..e45862d 100644 (file)
@@ -32,6 +32,7 @@
   <property name="BASEADDRESS_QEDIT" value="0x611c0000" />
   <property name="BASEADDRESS_MODEMUI" value="0x61650000" />
   <property name="BASEADDRESS_MAPI32" value="0x62250000" />
+  <property name="BASEADDRESS_LOCALUI" value="0x62f70000" />
   <property name="BASEADDRESS_HDWWIZ" value="0x64d40000" />
   <property name="BASEADDRESS_TIMEDATE" value="0x64da0000" />
   <property name="BASEADDRESS_SYSDM" value="0x64dd0000" />
index 7188181..8bbf91f 100644 (file)
@@ -270,6 +270,7 @@ Signature = "$ReactOS$"
 ;dll\win32\iphlpapi\iphlpapi.dll                     1
 ;dll\win32\jscript\jscript.dll                       1
 ;dll\win32\kernel32\kernel32.dll                     1
+;dll\win32\localui\localui.dll                       1
 ;dll\win32\lsasrv\lsasrv.dll                         1
 ;dll\win32\lz32\lz32.dll                             1
 ;dll\win32\mapi32\mapi32.dll                         1
index 067fdde..a24f54e 100644 (file)
@@ -34,6 +34,9 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
 
+/******************************************************************************
+ * GdipCloneBrush [GDIPLUS.@]
+ */
 GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
 {
     TRACE("(%p, %p)\n", brush, clone);
@@ -121,6 +124,9 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
     return Ok;
 }
 
+/******************************************************************************
+ * GdipCreateLineBrush [GDIPLUS.@]
+ */
 GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint,
     GDIPCONST GpPointF* endpoint, ARGB startcolor, ARGB endcolor,
     GpWrapMode wrap, GpLineGradient **line)
@@ -212,9 +218,13 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect,
     return GdipCreateLineBrushFromRect(&rectF, startcolor, endcolor, mode, wrap, line);
 }
 
-/* FIXME: angle value completely ignored. Don't know how to use it since native
-          always set Brush rectangle to rect (independetly of this angle).
-          Maybe it's used only on drawing.  */
+/******************************************************************************
+ * GdipCreateLineBrushFromRectWithAngle [GDIPLUS.@]
+ *
+ * FIXME: angle value completely ignored. Don't know how to use it since native
+ *        always set Brush rectangle to rect (independetly of this angle).
+ *        Maybe it's used only on drawing.
+ */
 GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF* rect,
     ARGB startcolor, ARGB endcolor, REAL angle, BOOL isAngleScalable, GpWrapMode wrap,
     GpLineGradient **line)
@@ -323,7 +333,11 @@ GpStatus WINGDIPAPI GdipCreatePathGradientI(GDIPCONST GpPoint* points,
     return ret;
 }
 
-/* FIXME: path gradient brushes not truly supported (drawn as solid brushes) */
+/******************************************************************************
+ * GdipCreatePathGradientFromPath [GDIPLUS.@]
+ *
+ * FIXME: path gradient brushes not truly supported (drawn as solid brushes)
+ */
 GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
     GpPathGradient **grad)
 {
@@ -379,6 +393,9 @@ GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
     return Ok;
 }
 
+/******************************************************************************
+ * GdipCreateSolidFill [GDIPLUS.@]
+ */
 GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
 {
     COLORREF col = ARGB2COLORREF(color);
@@ -401,7 +418,7 @@ GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
     return Ok;
 }
 
-/*******************************************************************************
+/******************************************************************************
  * GdipCreateTexture [GDIPLUS.@]
  *
  * PARAMS
@@ -435,6 +452,9 @@ GpStatus WINGDIPAPI GdipCreateTexture(GpImage *image, GpWrapMode wrapmode,
             texture);
 }
 
+/******************************************************************************
+ * GdipCreateTexture2 [GDIPLUS.@]
+ */
 GpStatus WINGDIPAPI GdipCreateTexture2(GpImage *image, GpWrapMode wrapmode,
         REAL x, REAL y, REAL width, REAL height, GpTexture **texture)
 {
@@ -448,19 +468,23 @@ GpStatus WINGDIPAPI GdipCreateTexture2(GpImage *image, GpWrapMode wrapmode,
             texture);
 }
 
-/* FIXME: imageattr ignored */
+/******************************************************************************
+ * GdipCreateTextureIA [GDIPLUS.@]
+ *
+ * FIXME: imageattr ignored
+ */
 GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image,
     GDIPCONST GpImageAttributes *imageattr, REAL x, REAL y, REAL width,
     REAL height, GpTexture **texture)
 {
     HDC hdc;
-    OLE_HANDLE hbm;
-    HBITMAP old = NULL;
-    BITMAPINFO bmi;
+    HBITMAP hbm, old = NULL;
+    BITMAPINFO *pbmi;
     BITMAPINFOHEADER *bmih;
     INT n_x, n_y, n_width, n_height, abs_height, stride, image_stride, i, bytespp;
     BOOL bm_is_selected;
     BYTE *dibits, *buff, *textbits;
+    GpStatus status;
 
     TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %p)\n", image, imageattr, x, y, width, height,
            texture);
@@ -482,46 +506,54 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image,
        n_y + n_height > ((GpBitmap*)image)->height)
         return InvalidParameter;
 
-    IPicture_get_Handle(image->picture, &hbm);
+    IPicture_get_Handle(image->picture, (OLE_HANDLE*)&hbm);
     if(!hbm)   return GenericError;
     IPicture_get_CurDC(image->picture, &hdc);
     bm_is_selected = (hdc != 0);
 
-    bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-    bmi.bmiHeader.biBitCount = 0;
+    pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
+    if (!pbmi)
+        return OutOfMemory;
+    pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+    pbmi->bmiHeader.biBitCount = 0;
 
     if(!bm_is_selected){
         hdc = CreateCompatibleDC(0);
-        old = SelectObject(hdc, (HBITMAP)hbm);
+        old = SelectObject(hdc, hbm);
     }
 
     /* fill out bmi */
-    GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS);
+    GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
 
-    bytespp = bmi.bmiHeader.biBitCount / 8;
-    abs_height = abs(bmi.bmiHeader.biHeight);
+    bytespp = pbmi->bmiHeader.biBitCount / 8;
+    abs_height = abs(pbmi->bmiHeader.biHeight);
 
-    if(n_x > bmi.bmiHeader.biWidth || n_x + n_width > bmi.bmiHeader.biWidth ||
-       n_y > abs_height || n_y + n_height > abs_height)
+    if(n_x > pbmi->bmiHeader.biWidth || n_x + n_width > pbmi->bmiHeader.biWidth ||
+       n_y > abs_height || n_y + n_height > abs_height){
+        GdipFree(pbmi);
         return InvalidParameter;
+    }
 
-    dibits = GdipAlloc(bmi.bmiHeader.biSizeImage);
+    dibits = GdipAlloc(pbmi->bmiHeader.biSizeImage);
 
     if(dibits)  /* this is not a good place to error out */
-        GetDIBits(hdc, (HBITMAP)hbm, 0, abs_height, dibits, &bmi, DIB_RGB_COLORS);
+        GetDIBits(hdc, hbm, 0, abs_height, dibits, pbmi, DIB_RGB_COLORS);
 
     if(!bm_is_selected){
         SelectObject(hdc, old);
         DeleteDC(hdc);
     }
 
-    if(!dibits)
+    if(!dibits){
+        GdipFree(pbmi);
         return OutOfMemory;
+    }
 
-    image_stride = (bmi.bmiHeader.biWidth * bytespp + 3) & ~3;
+    image_stride = (pbmi->bmiHeader.biWidth * bytespp + 3) & ~3;
     stride = (n_width * bytespp + 3) & ~3;
     buff = GdipAlloc(sizeof(BITMAPINFOHEADER) + stride * n_height);
     if(!buff){
+        GdipFree(pbmi);
         GdipFree(dibits);
         return OutOfMemory;
     }
@@ -533,25 +565,38 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image,
     bmih->biHeight = n_height;
     bmih->biCompression = BI_RGB;
     bmih->biSizeImage = stride * n_height;
-    bmih->biBitCount = bmi.bmiHeader.biBitCount;
+    bmih->biBitCount = pbmi->bmiHeader.biBitCount;
     bmih->biClrUsed = 0;
     bmih->biPlanes = 1;
 
     /* image is flipped */
-    if(bmi.bmiHeader.biHeight > 0){
-        dibits += bmi.bmiHeader.biSizeImage;
+    if(pbmi->bmiHeader.biHeight > 0){
+        dibits += pbmi->bmiHeader.biSizeImage;
         image_stride *= -1;
         textbits += stride * (n_height - 1);
         stride *= -1;
     }
 
+    GdipFree(pbmi);
+
     for(i = 0; i < n_height; i++)
         memcpy(&textbits[i * stride],
                &dibits[n_x * bytespp + (n_y + i) * image_stride],
                abs(stride));
 
     *texture = GdipAlloc(sizeof(GpTexture));
-    if (!*texture) return OutOfMemory;
+    if (!*texture){
+        GdipFree(dibits);
+        GdipFree(buff);
+        return OutOfMemory;
+    }
+
+    if((status = GdipCreateMatrix(&(*texture)->transform)) != Ok){
+        GdipFree(*texture);
+        GdipFree(dibits);
+        GdipFree(buff);
+        return status;
+    }
 
     (*texture)->brush.lb.lbStyle = BS_DIBPATTERNPT;
     (*texture)->brush.lb.lbColor = DIB_RGB_COLORS;
@@ -559,6 +604,7 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image,
 
     (*texture)->brush.gdibrush = CreateBrushIndirect(&(*texture)->brush.lb);
     (*texture)->brush.bt = BrushTypeTextureFill;
+    (*texture)->wrap = imageattr->wrap;
 
     GdipFree(dibits);
     GdipFree(buff);
@@ -566,6 +612,9 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image,
     return Ok;
 }
 
+/******************************************************************************
+ * GdipCreateTextureIAI [GDIPLUS.@]
+ */
 GpStatus WINGDIPAPI GdipCreateTextureIAI(GpImage *image, GDIPCONST GpImageAttributes *imageattr,
     INT x, INT y, INT width, INT height, GpTexture **texture)
 {
@@ -615,7 +664,10 @@ GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
             break;
         case BrushTypeSolidColor:
         case BrushTypeLinearGradient:
+            break;
         case BrushTypeTextureFill:
+            GdipDeleteMatrix(((GpTexture*)brush)->transform);
+            break;
         default:
             break;
     }
@@ -845,6 +897,77 @@ GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb)
     return Ok;
 }
 
+/******************************************************************************
+ * GdipGetTextureTransform [GDIPLUS.@]
+ */
+GpStatus WINGDIPAPI GdipGetTextureTransform(GpTexture *brush, GpMatrix *matrix)
+{
+    TRACE("(%p, %p)\n", brush, matrix);
+
+    if(!brush || !matrix)
+        return InvalidParameter;
+
+    memcpy(matrix, brush->transform, sizeof(GpMatrix));
+
+    return Ok;
+}
+
+/******************************************************************************
+ * GdipGetTextureWrapMode [GDIPLUS.@]
+ */
+GpStatus WINGDIPAPI GdipGetTextureWrapMode(GpTexture *brush, GpWrapMode *wrapmode)
+{
+    TRACE("(%p, %p)\n", brush, wrapmode);
+
+    if(!brush || !wrapmode)
+        return InvalidParameter;
+
+    *wrapmode = brush->wrap;
+
+    return Ok;
+}
+
+/******************************************************************************
+ * GdipMultiplyTextureTransform [GDIPLUS.@]
+ */
+GpStatus WINGDIPAPI GdipMultiplyTextureTransform(GpTexture* brush,
+    GDIPCONST GpMatrix *matrix, GpMatrixOrder order)
+{
+    TRACE("(%p, %p, %d)\n", brush, matrix, order);
+
+    if(!brush || !matrix)
+        return InvalidParameter;
+
+    return GdipMultiplyMatrix(brush->transform, matrix, order);
+}
+
+/******************************************************************************
+ * GdipResetTextureTransform [GDIPLUS.@]
+ */
+GpStatus WINGDIPAPI GdipResetTextureTransform(GpTexture* brush)
+{
+    TRACE("(%p)\n", brush);
+
+    if(!brush)
+        return InvalidParameter;
+
+    return GdipSetMatrixElements(brush->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
+}
+
+/******************************************************************************
+ * GdipScaleTextureTransform [GDIPLUS.@]
+ */
+GpStatus WINGDIPAPI GdipScaleTextureTransform(GpTexture* brush,
+    REAL sx, REAL sy, GpMatrixOrder order)
+{
+    TRACE("(%p, %.2f, %.2f, %d)\n", brush, sx, sy, order);
+
+    if(!brush)
+        return InvalidParameter;
+
+    return GdipScaleMatrix(brush->transform, sx, sy, order);
+}
+
 GpStatus WINGDIPAPI GdipSetLineBlend(GpLineGradient *brush,
     GDIPCONST REAL *blend, GDIPCONST REAL* positions, INT count)
 {
@@ -899,6 +1022,17 @@ GpStatus WINGDIPAPI GdipSetLineWrapMode(GpLineGradient *line,
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipSetPathGradientBlend(GpPathGradient *brush, GDIPCONST REAL *blend,
+    GDIPCONST REAL *pos, INT count)
+{
+    static int calls;
+
+    if(!(calls++))
+        FIXME("not implemented\n");
+
+    return NotImplemented;
+}
+
 GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient *grad,
     ARGB argb)
 {
@@ -1031,16 +1165,35 @@ GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb)
     return Ok;
 }
 
+/******************************************************************************
+ * GdipSetTextureTransform [GDIPLUS.@]
+ */
 GpStatus WINGDIPAPI GdipSetTextureTransform(GpTexture *texture,
     GDIPCONST GpMatrix *matrix)
 {
-    static int calls;
+    TRACE("(%p, %p)\n", texture, matrix);
 
     if(!texture || !matrix)
         return InvalidParameter;
 
-    if(!(calls++))
-        FIXME("not implemented\n");
+    memcpy(texture->transform, matrix, sizeof(GpMatrix));
+
+    return Ok;
+}
+
+/******************************************************************************
+ * GdipSetTextureWrapMode [GDIPLUS.@]
+ *
+ * WrapMode not used, only stored
+ */
+GpStatus WINGDIPAPI GdipSetTextureWrapMode(GpTexture *brush, GpWrapMode wrapmode)
+{
+    TRACE("(%p, %d)\n", brush, wrapmode);
+
+    if(!brush)
+        return InvalidParameter;
+
+    brush->wrap = wrapmode;
 
     return Ok;
 }
@@ -1072,6 +1225,20 @@ GpStatus WINGDIPAPI GdipGetLineColors(GpLineGradient *brush, ARGB *colors)
     return Ok;
 }
 
+/******************************************************************************
+ * GdipRotateTextureTransform [GDIPLUS.@]
+ */
+GpStatus WINGDIPAPI GdipRotateTextureTransform(GpTexture* brush, REAL angle,
+    GpMatrixOrder order)
+{
+    TRACE("(%p, %.2f, %d)\n", brush, angle, order);
+
+    if(!brush)
+        return InvalidParameter;
+
+    return GdipRotateMatrix(brush->transform, angle, order);
+}
+
 GpStatus WINGDIPAPI GdipSetLineLinearBlend(GpLineGradient *brush, REAL focus,
     REAL scale)
 {
@@ -1113,6 +1280,20 @@ GpStatus WINGDIPAPI GdipTranslateLineTransform(GpLineGradient* brush,
     return NotImplemented;
 }
 
+/******************************************************************************
+ * GdipTranslateTextureTransform [GDIPLUS.@]
+ */
+GpStatus WINGDIPAPI GdipTranslateTextureTransform(GpTexture* brush, REAL dx, REAL dy,
+    GpMatrixOrder order)
+{
+    TRACE("(%p, %.2f, %.2f, %d)\n", brush, dx, dy, order);
+
+    if(!brush)
+        return InvalidParameter;
+
+    return GdipTranslateMatrix(brush->transform, dx, dy, order);
+}
+
 GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
 {
     TRACE("(%p, %p)\n", brush, rect);
index 210ebff..220409b 100644 (file)
@@ -153,6 +153,8 @@ GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily,
 
     (*font)->unit = unit;
     (*font)->emSize = emSize;
+    (*font)->height = tmw->ntmSizeEM;
+    (*font)->line_spacing = tmw->tmAscent + tmw->tmDescent + tmw->tmExternalLeading;
 
     return Ok;
 }
@@ -194,6 +196,9 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc,
     (*font)->lfw.lfHeight = -textmet.tmHeight;
     (*font)->lfw.lfWeight = textmet.tmWeight;
 
+    (*font)->height = 1; /* FIXME: need NEWTEXTMETRIC.ntmSizeEM here */
+    (*font)->line_spacing = textmet.tmAscent + textmet.tmDescent + textmet.tmExternalLeading;
+
     SelectObject(hdc, oldfont);
     DeleteObject(hfont);
 
@@ -251,7 +256,7 @@ GpStatus WINGDIPAPI GdipCreateFontFromDC(HDC hdc, GpFont **font)
     if(!font)
         return InvalidParameter;
 
-    hfont = (HFONT)GetCurrentObject(hdc, OBJ_FONT);
+    hfont = GetCurrentObject(hdc, OBJ_FONT);
     if(!hfont)
         return GenericError;
 
@@ -444,15 +449,31 @@ GpStatus WINGDIPAPI GdipGetFontHeight(GDIPCONST GpFont *font,
  */
 GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, REAL *height)
 {
+    REAL font_height;
+
     TRACE("%p (%s), %f, %p\n", font,
             debugstr_w(font->lfw.lfFaceName), dpi, height);
 
     if (!(font && height)) return InvalidParameter;
 
+    font_height = font->line_spacing * (font->emSize / font->height);
+
     switch (font->unit)
     {
         case UnitPixel:
-            *height = font->emSize;
+            *height = font_height;
+            break;
+        case UnitPoint:
+            *height = font_height * dpi * inch_per_point;
+            break;
+        case UnitInch:
+            *height = font_height * dpi;
+            break;
+        case UnitDocument:
+            *height = font_height * (dpi / 300.0);
+            break;
+        case UnitMillimeter:
+            *height = font_height * (dpi / mm_per_inch);
             break;
         default:
             FIXME("Unhandled unit type: %d\n", font->unit);
@@ -667,8 +688,7 @@ GpStatus WINGDIPAPI GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, U
 {
     if (!(family && EmHeight)) return InvalidParameter;
 
-    TRACE("%p (%s), %d, %p, stub!\n", family,
-            debugstr_w(family->FamilyName), style, EmHeight);
+    TRACE("%p (%s), %d, %p\n", family, debugstr_w(family->FamilyName), style, EmHeight);
 
     *EmHeight = family->tmw.ntmSizeEM;
 
@@ -693,11 +713,16 @@ GpStatus WINGDIPAPI GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, U
 GpStatus WINGDIPAPI GdipGetLineSpacing(GDIPCONST GpFontFamily *family,
         INT style, UINT16* LineSpacing)
 {
-    if (!(family && LineSpacing)) return InvalidParameter;
+    TRACE("%p, %d, %p\n", family, style, LineSpacing);
 
-    FIXME("stub!\n");
+    if (!(family && LineSpacing))
+        return InvalidParameter;
 
-    return NotImplemented;
+    if (style) FIXME("ignoring style\n");
+
+    *LineSpacing = family->tmw.tmAscent + family->tmw.tmDescent + family->tmw.tmExternalLeading;
+
+    return Ok;
 }
 
 GpStatus WINGDIPAPI GdipIsStyleAvailable(GDIPCONST GpFontFamily* family,
@@ -785,12 +810,17 @@ GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamil
  */
 GpStatus WINGDIPAPI GdipNewPrivateFontCollection(GpFontCollection** fontCollection)
 {
-    FIXME("stub %p\n", fontCollection);
+    TRACE("%p\n", fontCollection);
 
     if (!fontCollection)
         return InvalidParameter;
 
-    return NotImplemented;
+    *fontCollection = GdipAlloc(sizeof(GpFontCollection));
+    if (!*fontCollection) return OutOfMemory;
+
+    (*fontCollection)->FontFamilies = NULL;
+    (*fontCollection)->count = 0;
+    return Ok;
 }
 
 /*****************************************************************************
@@ -798,12 +828,17 @@ GpStatus WINGDIPAPI GdipNewPrivateFontCollection(GpFontCollection** fontCollecti
  */
 GpStatus WINGDIPAPI GdipDeletePrivateFontCollection(GpFontCollection **fontCollection)
 {
-    FIXME("stub %p\n", fontCollection);
+    INT i;
+
+    TRACE("%p\n", fontCollection);
 
     if (!fontCollection)
         return InvalidParameter;
 
-    return NotImplemented;
+    for (i = 0; i < (*fontCollection)->count; i++) GdipFree((*fontCollection)->FontFamilies[i]);
+    GdipFree(*fontCollection);
+
+    return Ok;
 }
 
 /*****************************************************************************
@@ -820,18 +855,33 @@ GpStatus WINGDIPAPI GdipPrivateAddFontFile(GpFontCollection* fontCollection,
     return NotImplemented;
 }
 
+/*****************************************************************************
+ * GdipPrivateAddMemoryFont [GDIPLUS.@]
+ */
+GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection* fontCollection,
+        GDIPCONST void* memory, INT length)
+{
+    FIXME("%p, %p, %d\n", fontCollection, memory, length);
+
+    if (!(fontCollection && memory && length))
+        return InvalidParameter;
+
+    return Ok;
+}
+
 /*****************************************************************************
  * GdipGetFontCollectionFamilyCount [GDIPLUS.@]
  */
 GpStatus WINGDIPAPI GdipGetFontCollectionFamilyCount(
         GpFontCollection* fontCollection, INT* numFound)
 {
-    FIXME("stub: %p, %p\n", fontCollection, numFound);
+    TRACE("%p, %p\n", fontCollection, numFound);
 
     if (!(fontCollection && numFound))
         return InvalidParameter;
 
-    return NotImplemented;
+    *numFound = fontCollection->count;
+    return Ok;
 }
 
 /*****************************************************************************
@@ -841,11 +891,28 @@ GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList(
         GpFontCollection* fontCollection, INT numSought,
         GpFontFamily* gpfamilies[], INT* numFound)
 {
-    FIXME("stub: %p, %d, %p, %p\n", fontCollection, numSought, gpfamilies,
-            numFound);
+    INT i;
+
+    TRACE("%p, %d, %p, %p\n", fontCollection, numSought, gpfamilies, numFound);
 
     if (!(fontCollection && gpfamilies && numFound))
         return InvalidParameter;
 
+    for (i = 0; i < numSought && i < fontCollection->count; i++)
+    {
+        gpfamilies[i] = fontCollection->FontFamilies[i];
+    }
+    *numFound = i;
+    return Ok;
+}
+
+GpStatus WINGDIPAPI GdipNewInstalledFontCollection(
+        GpFontCollection** fontCollection)
+{
+    FIXME("stub: %p\n",fontCollection);
+
+    if (!fontCollection)
+        return InvalidParameter;
+
     return NotImplemented;
 }
index 046ee14..a11ad58 100644 (file)
@@ -93,11 +93,25 @@ Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput
         output->NotificationUnhook = NotificationUnhook;
     }
 
+    *token = 0xdeadbeef;
+
     /* FIXME: DebugEventCallback ignored */
 
     return Ok;
 }
 
+GpStatus WINAPI GdiplusNotificationHook(ULONG_PTR *token)
+{
+    FIXME("%p\n", token);
+    return NotificationHook(token);
+}
+
+void WINAPI GdiplusNotificationUnhook(ULONG_PTR token)
+{
+    FIXME("%ld\n", token);
+    NotificationUnhook(token);
+}
+
 /*****************************************************
  *      GdiplusShutdown [GDIPLUS.@]
  */
index f7b1d5d..b3d2103 100644 (file)
@@ -32,7 +32,7 @@
 @ stub GdipAddPathString
 @ stub GdipAddPathStringI
 @ stdcall GdipAlloc(long)
-@ stub GdipBeginContainer2
+@ stdcall GdipBeginContainer2(ptr ptr)
 @ stub GdipBeginContainer
 @ stub GdipBeginContainerI
 @ stub GdipBitmapApplyEffect
@@ -81,7 +81,7 @@
 @ stdcall GdipCreateBitmapFromScan0(long long long long ptr ptr)
 @ stdcall GdipCreateBitmapFromStream(ptr ptr)
 @ stdcall GdipCreateBitmapFromStreamICM(ptr ptr)
-@ stub GdipCreateCachedBitmap
+@ stdcall GdipCreateCachedBitmap(ptr ptr ptr)
 @ stdcall GdipCreateCustomLineCap(ptr ptr long long ptr)
 @ stub GdipCreateEffect
 @ stdcall GdipCreateFont(ptr long long long ptr)
@@ -95,7 +95,7 @@
 @ stdcall GdipCreateFromHWNDICM(long ptr)
 @ stdcall GdipCreateHBITMAPFromBitmap(ptr ptr long)
 @ stub GdipCreateHICONFromBitmap
-@ stub GdipCreateHalftonePalette
+@ stdcall GdipCreateHalftonePalette()
 @ stub GdipCreateHatchBrush
 @ stdcall GdipCreateImageAttributes(ptr)
 @ stdcall GdipCreateLineBrush(ptr ptr long long long ptr)
 @ stdcall GdipCreateTextureIA(ptr ptr long long long long ptr)
 @ stdcall GdipCreateTextureIAI(ptr ptr long long long long ptr)
 @ stdcall GdipDeleteBrush(ptr)
-@ stub GdipDeleteCachedBitmap
+@ stdcall GdipDeleteCachedBitmap(ptr)
 @ stdcall GdipDeleteCustomLineCap(ptr)
 @ stub GdipDeleteEffect
 @ stdcall GdipDeleteFont(ptr)
 @ stdcall GdipDrawBezierI(ptr ptr long long long long long long long long)
 @ stdcall GdipDrawBeziers(ptr ptr ptr long)
 @ stdcall GdipDrawBeziersI(ptr ptr ptr long)
-@ stub GdipDrawCachedBitmap
+@ stdcall GdipDrawCachedBitmap(ptr ptr long long)
 @ stdcall GdipDrawClosedCurve2(ptr ptr ptr long long)
 @ stdcall GdipDrawClosedCurve2I(ptr ptr ptr long long)
 @ stdcall GdipDrawClosedCurve(ptr ptr ptr long)
 @ stdcall GdipDrawRectanglesI(ptr ptr ptr long)
 @ stdcall GdipDrawString(ptr ptr long ptr ptr ptr ptr)
 @ stub GdipEmfToWmfBits
-@ stub GdipEndContainer
+@ stdcall GdipEndContainer(ptr ptr)
 @ stub GdipEnumerateMetafileDestPoint
 @ stub GdipEnumerateMetafileDestPointI
 @ stub GdipEnumerateMetafileDestPoints
 @ stdcall GdipGetAdjustableArrowCapHeight(ptr ptr)
 @ stdcall GdipGetAdjustableArrowCapMiddleInset(ptr ptr)
 @ stdcall GdipGetAdjustableArrowCapWidth(ptr ptr)
-@ stub GdipGetAllPropertyItems
+@ stdcall GdipGetAllPropertyItems(ptr long long ptr)
 @ stdcall GdipGetBrushType(ptr ptr)
 @ stdcall GdipGetCellAscent(ptr long ptr)
 @ stdcall GdipGetCellDescent(ptr long ptr)
 @ stub GdipGetHemfFromMetafile
 @ stub GdipGetImageAttributesAdjustedPalette
 @ stdcall GdipGetImageBounds(ptr ptr ptr)
-@ stub GdipGetImageDecoders
-@ stub GdipGetImageDecodersSize
+@ stdcall GdipGetImageDecoders(long long ptr)
+@ stdcall GdipGetImageDecodersSize(ptr ptr)
 @ stdcall GdipGetImageDimension(ptr ptr ptr)
 @ stdcall GdipGetImageEncoders(long long ptr)
 @ stdcall GdipGetImageEncodersSize(ptr ptr)
 @ stdcall GdipGetImageHorizontalResolution(ptr ptr)
 @ stub GdipGetImageItemData
 @ stub GdipGetImagePalette
-@ stub GdipGetImagePaletteSize
+@ stdcall GdipGetImagePaletteSize(ptr ptr)
 @ stdcall GdipGetImagePixelFormat(ptr ptr)
 @ stdcall GdipGetImageRawFormat(ptr ptr)
 @ stub GdipGetImageThumbnail
 @ stdcall GdipGetPenDashOffset(ptr ptr)
 @ stdcall GdipGetPenDashStyle(ptr ptr)
 @ stdcall GdipGetPenEndCap(ptr ptr)
-@ stub GdipGetPenFillType
+@ stdcall GdipGetPenFillType(ptr ptr)
 @ stdcall GdipGetPenLineJoin(ptr ptr)
 @ stdcall GdipGetPenMiterLimit(ptr ptr)
 @ stdcall GdipGetPenMode(ptr ptr)
 @ stdcall GdipGetPenWidth(ptr ptr)
 @ stdcall GdipGetPixelOffsetMode(ptr ptr)
 @ stdcall GdipGetPointCount(ptr ptr)
-@ stub GdipGetPropertyCount
-@ stub GdipGetPropertyIdList
-@ stub GdipGetPropertyItem
+@ stdcall GdipGetPropertyCount(ptr ptr)
+@ stdcall GdipGetPropertyIdList(ptr long ptr)
+@ stdcall GdipGetPropertyItem(ptr long long ptr)
 @ stdcall GdipGetPropertyItemSize(ptr long ptr)
-@ stub GdipGetPropertySize
+@ stdcall GdipGetPropertySize(ptr ptr ptr)
 @ stdcall GdipGetRegionBounds(ptr ptr ptr)
 @ stdcall GdipGetRegionBoundsI(ptr ptr ptr)
 @ stdcall GdipGetRegionData(ptr ptr long ptr)
 @ stdcall GdipGetStringFormatTabStopCount(ptr ptr)
 @ stdcall GdipGetStringFormatTabStops(ptr long ptr ptr)
 @ stdcall GdipGetStringFormatTrimming(ptr ptr)
-@ stub GdipGetTextContrast
+@ stdcall GdipGetTextContrast(ptr ptr)
 @ stdcall GdipGetTextRenderingHint(ptr ptr)
 @ stub GdipGetTextureImage
-@ stub GdipGetTextureTransform
-@ stub GdipGetTextureWrapMode
+@ stdcall GdipGetTextureTransform(ptr ptr)
+@ stdcall GdipGetTextureWrapMode(ptr ptr)
 @ stub GdipGetVisibleClipBounds
 @ stub GdipGetVisibleClipBoundsI
 @ stdcall GdipGetWorldTransform(ptr ptr)
 @ stdcall GdipGraphicsClear(ptr long)
 @ stub GdipGraphicsSetAbort
-@ stub GdipImageForceValidation
+@ stdcall GdipImageForceValidation(ptr)
 @ stdcall GdipImageGetFrameCount(ptr ptr ptr)
 @ stdcall GdipImageGetFrameDimensionsCount(ptr ptr)
 @ stdcall GdipImageGetFrameDimensionsList(ptr ptr long)
 @ stub GdipIsVisibleClipEmpty
 @ stdcall GdipIsVisiblePathPoint(ptr long long ptr ptr)
 @ stdcall GdipIsVisiblePathPointI(ptr long long ptr ptr)
-@ stub GdipIsVisiblePoint
-@ stub GdipIsVisiblePointI
+@ stdcall GdipIsVisiblePoint(ptr long long ptr)
+@ stdcall GdipIsVisiblePointI(ptr long long ptr)
 @ stub GdipIsVisibleRect
 @ stub GdipIsVisibleRectI
 @ stub GdipIsVisibleRegionPoint
 @ stdcall GdipMultiplyMatrix(ptr ptr long)
 @ stub GdipMultiplyPathGradientTransform
 @ stub GdipMultiplyPenTransform
-@ stub GdipMultiplyTextureTransform
+@ stdcall GdipMultiplyTextureTransform(ptr ptr long)
 @ stdcall GdipMultiplyWorldTransform(ptr ptr long)
-@ stub GdipNewInstalledFontCollection
+@ stdcall GdipNewInstalledFontCollection(ptr)
 @ stdcall GdipNewPrivateFontCollection(ptr)
 @ stdcall GdipPathIterCopyData(ptr ptr ptr ptr long long)
 @ stdcall GdipPathIterEnumerate(ptr ptr ptr ptr long)
 @ stub GdipPlayMetafileRecord
 @ stub GdipPlayTSClientRecord
 @ stdcall GdipPrivateAddFontFile(ptr wstr)
-@ stub GdipPrivateAddMemoryFont
+@ stdcall GdipPrivateAddMemoryFont(ptr ptr long)
 @ stub GdipRecordMetafile
-@ stub GdipRecordMetafileFileName
-@ stub GdipRecordMetafileFileNameI
+@ stdcall GdipRecordMetafileFileName(wstr long long ptr long wstr ptr)
+@ stdcall GdipRecordMetafileFileNameI(wstr long long ptr long wstr ptr)
 @ stub GdipRecordMetafileI
 @ stub GdipRecordMetafileStream
 @ stub GdipRecordMetafileStreamI
 @ stdcall GdipResetPath(ptr)
 @ stub GdipResetPathGradientTransform
 @ stub GdipResetPenTransform
-@ stub GdipResetTextureTransform
+@ stdcall GdipResetTextureTransform(ptr)
 @ stdcall GdipResetWorldTransform(ptr)
 @ stdcall GdipRestoreGraphics(ptr long)
 @ stdcall GdipReversePath(ptr)
 @ stdcall GdipRotateMatrix(ptr long long)
 @ stub GdipRotatePathGradientTransform
 @ stub GdipRotatePenTransform
-@ stub GdipRotateTextureTransform
+@ stdcall GdipRotateTextureTransform(ptr long long)
 @ stdcall GdipRotateWorldTransform(ptr long long)
 @ stub GdipSaveAdd
 @ stub GdipSaveAddImage
 @ stdcall GdipScaleMatrix(ptr long long long)
 @ stub GdipScalePathGradientTransform
 @ stub GdipScalePenTransform
-@ stub GdipScaleTextureTransform
+@ stdcall GdipScaleTextureTransform(ptr long long long)
 @ stdcall GdipScaleWorldTransform(ptr long long long)
 @ stdcall GdipSetAdjustableArrowCapFillState(ptr long)
 @ stdcall GdipSetAdjustableArrowCapHeight(ptr long)
 @ stdcall GdipSetAdjustableArrowCapMiddleInset(ptr long)
 @ stdcall GdipSetAdjustableArrowCapWidth(ptr long)
-@ stub GdipSetClipGraphics
+@ stdcall GdipSetClipGraphics(ptr ptr long)
 @ stub GdipSetClipHrgn
-@ stub GdipSetClipPath
-@ stub GdipSetClipRect
+@ stdcall GdipSetClipPath(ptr ptr long)
+@ stdcall GdipSetClipRect(ptr long long long long long)
 @ stdcall GdipSetClipRectI(ptr long long long long long)
 @ stdcall GdipSetClipRegion(ptr ptr long)
 @ stdcall GdipSetCompositingMode(ptr long)
 @ stdcall GdipSetPageScale(ptr long)
 @ stdcall GdipSetPageUnit(ptr long)
 @ stdcall GdipSetPathFillMode(ptr long)
-@ stub GdipSetPathGradientBlend
+@ stdcall GdipSetPathGradientBlend(ptr ptr ptr long)
 @ stdcall GdipSetPathGradientCenterColor(ptr long)
 @ stdcall GdipSetPathGradientCenterPoint(ptr ptr)
 @ stdcall GdipSetPathGradientCenterPointI(ptr ptr)
 @ stdcall GdipSetPathMarker(ptr)
 @ stdcall GdipSetPenBrushFill(ptr ptr)
 @ stdcall GdipSetPenColor(ptr long)
-@ stub GdipSetPenCompoundArray
+@ stdcall GdipSetPenCompoundArray(ptr ptr long)
 @ stdcall GdipSetPenCustomEndCap(ptr ptr)
 @ stdcall GdipSetPenCustomStartCap(ptr ptr)
 @ stdcall GdipSetPenDashArray(ptr ptr long)
 @ stub GdipSetPenUnit
 @ stdcall GdipSetPenWidth(ptr long)
 @ stdcall GdipSetPixelOffsetMode(ptr long)
-@ stub GdipSetPropertyItem
+@ stdcall GdipSetPropertyItem(ptr ptr)
 @ stub GdipSetRenderingOrigin
 @ stdcall GdipSetSmoothingMode(ptr long)
 @ stdcall GdipSetSolidFillColor(ptr ptr)
 @ stdcall GdipSetStringFormatMeasurableCharacterRanges(ptr long ptr)
 @ stdcall GdipSetStringFormatTabStops(ptr long long ptr)
 @ stdcall GdipSetStringFormatTrimming(ptr long)
-@ stub GdipSetTextContrast
+@ stdcall GdipSetTextContrast(ptr long)
 @ stdcall GdipSetTextRenderingHint(ptr long)
 @ stdcall GdipSetTextureTransform(ptr ptr)
-@ stub GdipSetTextureWrapMode
+@ stdcall GdipSetTextureWrapMode(ptr long)
 @ stdcall GdipSetWorldTransform(ptr ptr)
 @ stdcall GdipShearMatrix(ptr long long long)
 @ stdcall GdipStartPathFigure(ptr)
 @ stdcall GdipStringFormatGetGenericDefault(ptr)
 @ stdcall GdipStringFormatGetGenericTypographic(ptr)
-@ stub GdipTestControl
+@ stdcall GdipTestControl(long ptr)
 @ stdcall GdipTransformMatrixPoints(ptr ptr long)
 @ stdcall GdipTransformMatrixPointsI(ptr ptr long)
 @ stdcall GdipTransformPath(ptr ptr)
 @ stub GdipTranslatePenTransform
 @ stdcall GdipTranslateRegion(ptr long long)
 @ stdcall GdipTranslateRegionI(ptr long long)
-@ stub GdipTranslateTextureTransform
+@ stdcall GdipTranslateTextureTransform(ptr long long long)
 @ stdcall GdipTranslateWorldTransform(ptr long long long)
 @ stdcall GdipVectorTransformMatrixPoints(ptr ptr long)
 @ stdcall GdipVectorTransformMatrixPointsI(ptr ptr long)
 @ stub GdipWarpPath
 @ stub GdipWidenPath
 @ stub GdipWindingModeOutline
-@ stub GdiplusNotificationHook
-@ stub GdiplusNotificationUnhook
+@ stdcall GdiplusNotificationHook(ptr)
+@ stdcall GdiplusNotificationUnhook(ptr)
 @ stdcall GdiplusShutdown(ptr)
 @ stdcall GdiplusStartup(ptr ptr ptr)
index 230eb8f..965265f 100644 (file)
@@ -54,6 +54,8 @@ extern void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj,
 
 extern BOOL lengthen_path(GpPath *path, INT len);
 
+extern GpStatus trace_path(GpGraphics *graphics, GpPath *path);
+
 typedef struct region_element region_element;
 extern inline void delete_element(region_element *element);
 
@@ -100,6 +102,7 @@ struct GpGraphics{
     GpMatrix * worldtrans; /* world transform */
     BOOL busy;      /* hdc handle obtained by GdipGetDC */
     GpRegion *clip;
+    UINT textcontrast; /* not used yet. get/set only */
 };
 
 struct GpBrush{
@@ -138,6 +141,8 @@ struct GpLineGradient{
 
 struct GpTexture{
     GpBrush brush;
+    GpMatrix *transform;
+    WrapMode wrap;  /* not used yet */
 };
 
 struct GpPath{
@@ -193,6 +198,10 @@ struct GpBitmap{
     BYTE *bitmapbits;   /* pointer to the buffer we passed in BitmapLockBits */
 };
 
+struct GpCachedBitmap{
+    GpImage *image;
+};
+
 struct GpImageAttributes{
     WrapMode wrap;
 };
@@ -200,6 +209,8 @@ struct GpImageAttributes{
 struct GpFont{
     LOGFONTW lfw;
     REAL emSize;
+    UINT height;
+    LONG line_spacing;
     Unit unit;
 };
 
@@ -218,7 +229,8 @@ struct GpStringFormat{
 };
 
 struct GpFontCollection{
-    GpFontFamily* FontFamilies;
+    GpFontFamily **FontFamilies;
+    INT count;
 };
 
 struct GpFontFamily{
index 8e88ad8..786af95 100644 (file)
@@ -715,6 +715,17 @@ end:
     return status;
 }
 
+GpStatus trace_path(GpGraphics *graphics, GpPath *path)
+{
+    GpStatus result;
+
+    BeginPath(graphics->hdc);
+    result = draw_poly(graphics, NULL, path->pathdata.Points,
+                       path->pathdata.Types, path->pathdata.Count, FALSE);
+    EndPath(graphics->hdc);
+    return result;
+}
+
 GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
 {
     TRACE("(%p, %p)\n", hdc, graphics);
@@ -763,6 +774,7 @@ GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **gra
     (*graphics)->unit = UnitDisplay;
     (*graphics)->scale = 1.0;
     (*graphics)->busy = FALSE;
+    (*graphics)->textcontrast = 4;
 
     return Ok;
 }
@@ -2507,6 +2519,18 @@ GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics *graphics, SmoothingMode *mo
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipGetTextContrast(GpGraphics *graphics, UINT *contrast)
+{
+    TRACE("(%p, %p)\n", graphics, contrast);
+
+    if(!graphics || !contrast)
+        return InvalidParameter;
+
+    *contrast = graphics->textcontrast;
+
+    return Ok;
+}
+
 /* FIXME: Text rendering hint is not used anywhere except the getter/setter. */
 GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics *graphics,
     TextRenderingHint *hint)
@@ -2583,6 +2607,32 @@ GpStatus WINGDIPAPI GdipIsClipEmpty(GpGraphics *graphics, BOOL *res)
     return GdipIsEmptyRegion(graphics->clip, graphics, res);
 }
 
+GpStatus WINGDIPAPI GdipIsVisiblePoint(GpGraphics *graphics, REAL x, REAL y, BOOL *result)
+{
+    FIXME("(%p, %.2f, %.2f, %p) stub\n", graphics, x, y, result);
+
+    if(!graphics || !result)
+        return InvalidParameter;
+
+    if(graphics->busy)
+        return ObjectBusy;
+
+    return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipIsVisiblePointI(GpGraphics *graphics, INT x, INT y, BOOL *result)
+{
+    FIXME("(%p, %d, %d, %p) stub\n", graphics, x, y, result);
+
+    if(!graphics || !result)
+        return InvalidParameter;
+
+    if(graphics->busy)
+        return ObjectBusy;
+
+    return NotImplemented;
+}
+
 GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics,
         GDIPCONST WCHAR* string, INT length, GDIPCONST GpFont* font,
         GDIPCONST RectF* layoutRect, GDIPCONST GpStringFormat *stringFormat,
@@ -2615,17 +2665,15 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
     if(!graphics || !string || !font || !rect)
         return InvalidParameter;
 
-    if(codepointsfitted || linesfilled){
-        FIXME("not implemented for given parameters\n");
-        return NotImplemented;
-    }
+    if(linesfilled) *linesfilled = 0;
+    if(codepointsfitted) *codepointsfitted = 0;
 
     if(format)
         TRACE("may be ignoring some format flags: attr %x\n", format->attr);
 
     if(length == -1) length = lstrlenW(string);
 
-    stringdup = GdipAlloc(length * sizeof(WCHAR));
+    stringdup = GdipAlloc((length + 1) * sizeof(WCHAR));
     if(!stringdup) return OutOfMemory;
 
     oldfont = SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw));
@@ -2683,7 +2731,10 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
                               nwidth, &j, NULL, &size);
 
         sum += fit + (lret < fitcpy ? 1 : 0);
+        if(codepointsfitted) *codepointsfitted = sum;
+
         height += size.cy;
+        if(linesfilled) *linesfilled += size.cy;
         max_width = max(max_width, size.cx);
 
         if(height > nheight)
@@ -2748,7 +2799,7 @@ GpStatus WINGDIPAPI GdipRestoreGraphics(GpGraphics *graphics, GraphicsState stat
     if(!(calls++))
         FIXME("graphics state not implemented\n");
 
-    return NotImplemented;
+    return Ok;
 }
 
 GpStatus WINGDIPAPI GdipRotateWorldTransform(GpGraphics *graphics, REAL angle,
@@ -2775,7 +2826,29 @@ GpStatus WINGDIPAPI GdipSaveGraphics(GpGraphics *graphics, GraphicsState *state)
     if(!(calls++))
         FIXME("graphics state not implemented\n");
 
-    return NotImplemented;
+    *state = 0xdeadbeef;
+    return Ok;
+}
+
+GpStatus WINGDIPAPI GdipBeginContainer2(GpGraphics *graphics, GraphicsContainer *state)
+{
+    FIXME("(%p, %p)\n", graphics, state);
+
+    if(!graphics || !state)
+        return InvalidParameter;
+
+    *state = 0xdeadbeef;
+    return Ok;
+}
+
+GpStatus WINGDIPAPI GdipEndContainer(GpGraphics *graphics, GraphicsState state)
+{
+    FIXME("(%p, 0x%x)\n", graphics, state);
+
+    if(!graphics || !state)
+        return InvalidParameter;
+
+    return Ok;
 }
 
 GpStatus WINGDIPAPI GdipScaleWorldTransform(GpGraphics *graphics, REAL sx,
@@ -2792,6 +2865,17 @@ GpStatus WINGDIPAPI GdipScaleWorldTransform(GpGraphics *graphics, REAL sx,
     return GdipScaleMatrix(graphics->worldtrans, sx, sy, order);
 }
 
+GpStatus WINGDIPAPI GdipSetClipGraphics(GpGraphics *graphics, GpGraphics *srcgraphics,
+    CombineMode mode)
+{
+    TRACE("(%p, %p, %d)\n", graphics, srcgraphics, mode);
+
+    if(!graphics || !srcgraphics)
+        return InvalidParameter;
+
+    return GdipCombineRegionRegion(graphics->clip, srcgraphics->clip, mode);
+}
+
 GpStatus WINGDIPAPI GdipSetCompositingMode(GpGraphics *graphics,
     CompositingMode mode)
 {
@@ -2904,6 +2988,18 @@ GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode mod
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipSetTextContrast(GpGraphics *graphics, UINT contrast)
+{
+    TRACE("(%p, %d)\n", graphics, contrast);
+
+    if(!graphics)
+        return InvalidParameter;
+
+    graphics->textcontrast = contrast;
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipSetTextRenderingHint(GpGraphics *graphics,
     TextRenderingHint hint)
 {
@@ -2948,11 +3044,46 @@ GpStatus WINGDIPAPI GdipTranslateWorldTransform(GpGraphics *graphics, REAL dx,
     return GdipTranslateMatrix(graphics->worldtrans, dx, dy, order);
 }
 
+GpStatus WINGDIPAPI GdipSetClipPath(GpGraphics *graphics, GpPath *path, CombineMode mode)
+{
+    TRACE("(%p, %p, %d)\n", graphics, path, mode);
+
+    if(!graphics)
+        return InvalidParameter;
+
+    if(graphics->busy)
+        return ObjectBusy;
+
+    return GdipCombineRegionPath(graphics->clip, path, mode);
+}
+
+GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics *graphics, REAL x, REAL y,
+                                    REAL width, REAL height,
+                                    CombineMode mode)
+{
+    GpRectF rect;
+
+    TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %d)\n", graphics, x, y, width, height, mode);
+
+    if(!graphics)
+        return InvalidParameter;
+
+    if(graphics->busy)
+        return ObjectBusy;
+
+    rect.X = x;
+    rect.Y = y;
+    rect.Width  = width;
+    rect.Height = height;
+
+    return GdipCombineRegionRect(graphics->clip, &rect, mode);
+}
+
 GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics *graphics, INT x, INT y,
                                      INT width, INT height,
-                                     CombineMode combineMode)
+                                     CombineMode mode)
 {
-    static int calls;
+    TRACE("(%p, %d, %d, %d, %d, %d)\n", graphics, x, y, width, height, mode);
 
     if(!graphics)
         return InvalidParameter;
@@ -2960,10 +3091,7 @@ GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics *graphics, INT x, INT y,
     if(graphics->busy)
         return ObjectBusy;
 
-    if(!(calls++))
-        FIXME("not implemented\n");
-
-    return NotImplemented;
+    return GdipSetClipRect(graphics, (REAL)x, (REAL)y, (REAL)width, (REAL)height, mode);
 }
 
 GpStatus WINGDIPAPI GdipSetClipRegion(GpGraphics *graphics, GpRegion *region,
@@ -3170,3 +3298,10 @@ GpStatus WINGDIPAPI GdipTransformPointsI(GpGraphics *graphics, GpCoordinateSpace
 
     return NotImplemented;
 }
+
+HPALETTE WINGDIPAPI GdipCreateHalftonePalette(void)
+{
+    FIXME("\n");
+
+    return NULL;
+}
index 68606a6..e8f8fb9 100644 (file)
@@ -984,17 +984,17 @@ GpStatus WINGDIPAPI GdipFlattenPath(GpPath *path, GpMatrix* matrix, REAL flatnes
 
         /* always add line points and start points */
         if((type == PathPointTypeStart) || (type == PathPointTypeLine)){
-            type = (path->pathdata.Types[i] & ~PathPointTypeBezier) | PathPointTypeLine;
-            if(!add_path_list_node(node, pt.X, pt.Y, type))
+            if(!add_path_list_node(node, pt.X, pt.Y, path->pathdata.Types[i]))
                 goto memout;
 
             node = node->next;
+            ++i;
             continue;
         }
 
         /* Bezier curve always stored as 4 points */
         if((path->pathdata.Types[i-1] & PathPointTypePathTypeMask) != PathPointTypeStart){
-            type = (path->pathdata.Types[i] & ~PathPointTypeBezier) | PathPointTypeLine;
+            type = (path->pathdata.Types[i] & ~PathPointTypePathTypeMask) | PathPointTypeLine;
             if(!add_path_list_node(node, pt.X, pt.Y, type))
                 goto memout;
 
@@ -1014,7 +1014,7 @@ GpStatus WINGDIPAPI GdipFlattenPath(GpPath *path, GpMatrix* matrix, REAL flatnes
 
         start = node;
         /* add Bezier end point */
-        type = (path->pathdata.Types[i] & ~PathPointTypeBezier) | PathPointTypeLine;
+        type = (path->pathdata.Types[i] & ~PathPointTypePathTypeMask) | PathPointTypeLine;
         if(!add_path_list_node(node, pt.X, pt.Y, type))
             goto memout;
         node = node->next;
index bcdc64f..0c61056 100644 (file)
@@ -28,6 +28,7 @@
 #include "olectl.h"
 #include "ole2.h"
 
+#include "initguid.h"
 #include "gdiplus.h"
 #include "gdiplus_private.h"
 #include "wine/debug.h"
@@ -95,10 +96,9 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
 {
     BOOL bm_is_selected;
     INT stride, bitspp = PIXELFORMATBPP(format);
-    OLE_HANDLE hbm;
     HDC hdc;
-    HBITMAP old = NULL;
-    BITMAPINFO bmi;
+    HBITMAP hbm, old = NULL;
+    BITMAPINFO *pbmi;
     BYTE *buff = NULL;
     UINT abs_height;
     GpRect act_rect; /* actual rect to be used */
@@ -127,46 +127,51 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
     if(bitmap->lockmode)
         return WrongState;
 
-    IPicture_get_Handle(bitmap->image.picture, &hbm);
+    IPicture_get_Handle(bitmap->image.picture, (OLE_HANDLE*)&hbm);
     IPicture_get_CurDC(bitmap->image.picture, &hdc);
     bm_is_selected = (hdc != 0);
 
-    bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-    bmi.bmiHeader.biBitCount = 0;
+    pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
+    if (!pbmi)
+        return OutOfMemory;
+    pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+    pbmi->bmiHeader.biBitCount = 0;
 
     if(!bm_is_selected){
         hdc = CreateCompatibleDC(0);
-        old = SelectObject(hdc, (HBITMAP)hbm);
+        old = SelectObject(hdc, hbm);
     }
 
     /* fill out bmi */
-    GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS);
+    GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
 
-    abs_height = abs(bmi.bmiHeader.biHeight);
-    stride = bmi.bmiHeader.biWidth * bitspp / 8;
+    abs_height = abs(pbmi->bmiHeader.biHeight);
+    stride = pbmi->bmiHeader.biWidth * bitspp / 8;
     stride = (stride + 3) & ~3;
 
     buff = GdipAlloc(stride * abs_height);
 
-    bmi.bmiHeader.biBitCount = bitspp;
+    pbmi->bmiHeader.biBitCount = bitspp;
 
     if(buff)
-        GetDIBits(hdc, (HBITMAP)hbm, 0, abs_height, buff, &bmi, DIB_RGB_COLORS);
+        GetDIBits(hdc, hbm, 0, abs_height, buff, pbmi, DIB_RGB_COLORS);
 
     if(!bm_is_selected){
         SelectObject(hdc, old);
         DeleteDC(hdc);
     }
 
-    if(!buff)
+    if(!buff){
+        GdipFree(pbmi);
         return OutOfMemory;
+    }
 
     lockeddata->Width  = act_rect.Width;
     lockeddata->Height = act_rect.Height;
     lockeddata->PixelFormat = format;
     lockeddata->Reserved = flags;
 
-    if(bmi.bmiHeader.biHeight > 0){
+    if(pbmi->bmiHeader.biHeight > 0){
         lockeddata->Stride = -stride;
         lockeddata->Scan0  = buff + (bitspp / 8) * act_rect.X +
                              stride * (abs_height - 1 - act_rect.Y);
@@ -181,17 +186,17 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
 
     bitmap->bitmapbits = buff;
 
+    GdipFree(pbmi);
     return Ok;
 }
 
 GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
     BitmapData* lockeddata)
 {
-    OLE_HANDLE hbm;
     HDC hdc;
-    HBITMAP old = NULL;
+    HBITMAP hbm, old = NULL;
     BOOL bm_is_selected;
-    BITMAPINFO bmi;
+    BITMAPINFO *pbmi;
 
     if(!bitmap || !lockeddata)
         return InvalidParameter;
@@ -211,28 +216,30 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
         return Ok;
     }
 
-    IPicture_get_Handle(bitmap->image.picture, &hbm);
+    IPicture_get_Handle(bitmap->image.picture, (OLE_HANDLE*)&hbm);
     IPicture_get_CurDC(bitmap->image.picture, &hdc);
     bm_is_selected = (hdc != 0);
 
-    bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-    bmi.bmiHeader.biBitCount = 0;
+    pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
+    pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+    pbmi->bmiHeader.biBitCount = 0;
 
     if(!bm_is_selected){
         hdc = CreateCompatibleDC(0);
-        old = SelectObject(hdc, (HBITMAP)hbm);
+        old = SelectObject(hdc, 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);
+    GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
+    pbmi->bmiHeader.biBitCount = PIXELFORMATBPP(lockeddata->PixelFormat);
+    SetDIBits(hdc, hbm, 0, abs(pbmi->bmiHeader.biHeight),
+              bitmap->bitmapbits, pbmi, DIB_RGB_COLORS);
 
     if(!bm_is_selected){
         SelectObject(hdc, old);
         DeleteDC(hdc);
     }
 
+    GdipFree(pbmi);
     GdipFree(bitmap->bitmapbits);
     bitmap->bitmapbits = NULL;
     bitmap->lockmode = 0;
@@ -245,6 +252,8 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
     IStream* stream;
     HRESULT hr;
     INT size;
+    LARGE_INTEGER move;
+    GpStatus stat = GenericError;
 
     TRACE("%p, %p\n", image, cloneImage);
 
@@ -255,15 +264,6 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
     if (FAILED(hr))
         return GenericError;
 
-    *cloneImage = GdipAlloc(sizeof(GpImage));
-    if (!*cloneImage)
-    {
-        IStream_Release(stream);
-        return OutOfMemory;
-    }
-    (*cloneImage)->type = image->type;
-    (*cloneImage)->flags = image->flags;
-
     hr = IPicture_SaveAsFile(image->picture, stream, FALSE, &size);
     if(FAILED(hr))
     {
@@ -271,21 +271,18 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
         goto out;
     }
 
-    hr = OleLoadPicture(stream, size, FALSE, &IID_IPicture,
-            (LPVOID*) &(*cloneImage)->picture);
+    /* Set seek pointer back to the beginning of the picture */
+    move.QuadPart = 0;
+    hr = IStream_Seek(stream, move, STREAM_SEEK_SET, NULL);
     if (FAILED(hr))
-    {
-        WARN("Failed to load image from stream\n");
         goto out;
-    }
 
-    IStream_Release(stream);
-    return Ok;
+    stat = GdipLoadImageFromStream(stream, cloneImage);
+    if (stat != Ok) WARN("Failed to load image from stream\n");
+
 out:
     IStream_Release(stream);
-    GdipFree(*cloneImage);
-    *cloneImage = NULL;
-    return GenericError;
+    return stat;
 }
 
 GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename,
@@ -294,6 +291,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename,
     GpStatus stat;
     IStream *stream;
 
+    TRACE("(%s) %p\n", debugstr_w(filename), bitmap);
+
     if(!filename || !bitmap)
         return InvalidParameter;
 
@@ -354,6 +353,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromGdiDib(GDIPCONST BITMAPINFO* info,
 GpStatus WINGDIPAPI GdipCreateBitmapFromFileICM(GDIPCONST WCHAR* filename,
     GpBitmap **bitmap)
 {
+    TRACE("(%s) %p\n", debugstr_w(filename), bitmap);
+
     return GdipCreateBitmapFromFile(filename, bitmap);
 }
 
@@ -363,11 +364,14 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromResource(HINSTANCE hInstance,
     HBITMAP hbm;
     GpStatus stat = InvalidParameter;
 
+    TRACE("%p (%s) %p\n", hInstance, debugstr_w(lpBitmapName), bitmap);
+
     if(!lpBitmapName || !bitmap)
         return InvalidParameter;
 
     /* load DIB */
-    hbm = (HBITMAP)LoadImageW(hInstance,lpBitmapName,IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION);
+    hbm = LoadImageW(hInstance, lpBitmapName, IMAGE_BITMAP, 0, 0,
+                     LR_CREATEDIBSECTION);
 
     if(hbm){
         stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, bitmap);
@@ -436,7 +440,9 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
 
     TRACE("%d %d %d %d %p %p\n", width, height, stride, format, scan0, bitmap);
 
-    if(!bitmap || width <= 0 || height <= 0 || (scan0 && (stride % 4))){
+    if (!bitmap) return InvalidParameter;
+
+    if(width <= 0 || height <= 0 || (scan0 && (stride % 4))){
         *bitmap = NULL;
         return InvalidParameter;
     }
@@ -516,6 +522,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream* stream,
 {
     GpStatus stat;
 
+    TRACE("%p %p\n", stream, bitmap);
+
     stat = GdipLoadImageFromStream(stream, (GpImage**) bitmap);
 
     if(stat != Ok)
@@ -534,13 +542,64 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream* stream,
 GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream* stream,
     GpBitmap **bitmap)
 {
+    TRACE("%p %p\n", stream, bitmap);
+
     return GdipCreateBitmapFromStream(stream, bitmap);
 }
 
+GpStatus WINGDIPAPI GdipCreateCachedBitmap(GpBitmap *bitmap, GpGraphics *graphics,
+    GpCachedBitmap **cachedbmp)
+{
+    GpStatus stat;
+
+    TRACE("%p %p %p\n", bitmap, graphics, cachedbmp);
+
+    if(!bitmap || !graphics || !cachedbmp)
+        return InvalidParameter;
+
+    *cachedbmp = GdipAlloc(sizeof(GpCachedBitmap));
+    if(!*cachedbmp)
+        return OutOfMemory;
+
+    stat = GdipCloneImage(&(bitmap->image), &(*cachedbmp)->image);
+    if(stat != Ok){
+        GdipFree(*cachedbmp);
+        return stat;
+    }
+
+    return Ok;
+}
+
+GpStatus WINGDIPAPI GdipDeleteCachedBitmap(GpCachedBitmap *cachedbmp)
+{
+    TRACE("%p\n", cachedbmp);
+
+    if(!cachedbmp)
+        return InvalidParameter;
+
+    GdipDisposeImage(cachedbmp->image);
+    GdipFree(cachedbmp);
+
+    return Ok;
+}
+
+GpStatus WINGDIPAPI GdipDrawCachedBitmap(GpGraphics *graphics,
+    GpCachedBitmap *cachedbmp, INT x, INT y)
+{
+    TRACE("%p %p %d %d\n", graphics, cachedbmp, x, y);
+
+    if(!graphics || !cachedbmp)
+        return InvalidParameter;
+
+    return GdipDrawImage(graphics, cachedbmp->image, (REAL)x, (REAL)y);
+}
+
 GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
 {
     HDC hdc;
 
+    TRACE("%p\n", image);
+
     if(!image)
         return InvalidParameter;
 
@@ -565,6 +624,8 @@ GpStatus WINGDIPAPI GdipFindFirstImageItem(GpImage *image, ImageItemData* item)
 GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect,
     GpUnit *srcUnit)
 {
+    TRACE("%p %p %p\n", image, srcRect, srcUnit);
+
     if(!image || !srcRect || !srcUnit)
         return InvalidParameter;
     if(image->type == ImageTypeMetafile){
@@ -593,6 +654,8 @@ GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect,
 GpStatus WINGDIPAPI GdipGetImageDimension(GpImage *image, REAL *width,
     REAL *height)
 {
+    TRACE("%p %p %p\n", image, width, height);
+
     if(!image || !height || !width)
         return InvalidParameter;
 
@@ -626,6 +689,8 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image,
 {
     HDC hdc;
 
+    TRACE("%p %p\n", image, graphics);
+
     if(!image || !graphics)
         return InvalidParameter;
 
@@ -646,6 +711,8 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image,
 
 GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
 {
+    TRACE("%p %p\n", image, height);
+
     if(!image || !height)
         return InvalidParameter;
 
@@ -680,9 +747,21 @@ GpStatus WINGDIPAPI GdipGetImageHorizontalResolution(GpImage *image, REAL *res)
     return NotImplemented;
 }
 
+GpStatus WINGDIPAPI GdipGetImagePaletteSize(GpImage *image, INT *size)
+{
+    FIXME("%p %p\n", image, size);
+
+    if(!image || !size)
+        return InvalidParameter;
+
+    return NotImplemented;
+}
+
 /* FIXME: test this function for non-bitmap types */
 GpStatus WINGDIPAPI GdipGetImagePixelFormat(GpImage *image, PixelFormat *format)
 {
+    TRACE("%p %p\n", image, format);
+
     if(!image || !format)
         return InvalidParameter;
 
@@ -702,13 +781,24 @@ GpStatus WINGDIPAPI GdipGetImageRawFormat(GpImage *image, GUID *format)
         return InvalidParameter;
 
     if(!(calls++))
-        FIXME("not implemented\n");
+        FIXME("stub\n");
 
-    return NotImplemented;
+    /* FIXME: should be detected from embedded picture or stored separately */
+    switch (image->type)
+    {
+    case ImageTypeBitmap:   *format = ImageFormatBMP; break;
+    case ImageTypeMetafile: *format = ImageFormatEMF; break;
+    default:
+        WARN("unknown type %u\n", image->type);
+        *format = ImageFormatUndefined;
+    }
+    return Ok;
 }
 
 GpStatus WINGDIPAPI GdipGetImageType(GpImage *image, ImageType *type)
 {
+    TRACE("%p %p\n", image, type);
+
     if(!image || !type)
         return InvalidParameter;
 
@@ -732,6 +822,8 @@ GpStatus WINGDIPAPI GdipGetImageVerticalResolution(GpImage *image, REAL *res)
 
 GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width)
 {
+    TRACE("%p %p\n", image, width);
+
     if(!image || !width)
         return InvalidParameter;
 
@@ -767,6 +859,48 @@ GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile * metafile,
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipGetAllPropertyItems(GpImage *image, UINT size,
+    UINT num, PropertyItem* items)
+{
+    static int calls;
+
+    if(!(calls++))
+        FIXME("not implemented\n");
+
+    return InvalidParameter;
+}
+
+GpStatus WINGDIPAPI GdipGetPropertyCount(GpImage *image, UINT* num)
+{
+    static int calls;
+
+    if(!(calls++))
+        FIXME("not implemented\n");
+
+    return InvalidParameter;
+}
+
+GpStatus WINGDIPAPI GdipGetPropertyIdList(GpImage *image, UINT num, PROPID* list)
+{
+    static int calls;
+
+    if(!(calls++))
+        FIXME("not implemented\n");
+
+    return InvalidParameter;
+}
+
+GpStatus WINGDIPAPI GdipGetPropertyItem(GpImage *image, PROPID id, UINT size,
+    PropertyItem* buffer)
+{
+    static int calls;
+
+    if(!(calls++))
+        FIXME("not implemented\n");
+
+    return InvalidParameter;
+}
+
 GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage *image, PROPID pid,
     UINT* size)
 {
@@ -783,6 +917,16 @@ GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage *image, PROPID pid,
     return NotImplemented;
 }
 
+GpStatus WINGDIPAPI GdipGetPropertySize(GpImage *image, UINT* size, UINT* num)
+{
+    static int calls;
+
+    if(!(calls++))
+        FIXME("not implemented\n");
+
+    return InvalidParameter;
+}
+
 GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image,
     GDIPCONST GUID* dimensionID, UINT* count)
 {
@@ -844,6 +988,8 @@ GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR* filename,
     GpStatus stat;
     IStream *stream;
 
+    TRACE("(%s) %p\n", debugstr_w(filename), image);
+
     if (!filename || !image)
         return InvalidParameter;
 
@@ -862,6 +1008,8 @@ GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR* filename,
 /* FIXME: no icm handling */
 GpStatus WINGDIPAPI GdipLoadImageFromFileICM(GDIPCONST WCHAR* filename,GpImage **image)
 {
+    TRACE("(%s) %p\n", debugstr_w(filename), image);
+
     return GdipLoadImageFromFile(filename, image);
 }
 
@@ -870,6 +1018,8 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image)
     IPicture *pic;
     short type;
 
+    TRACE("%p %p\n", stream, image);
+
     if(!stream || !image)
         return InvalidParameter;
 
@@ -882,38 +1032,44 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image)
     IPicture_get_Type(pic, &type);
 
     if(type == PICTYPE_BITMAP){
-        BITMAPINFO bmi;
+        BITMAPINFO *pbmi;
         BITMAPCOREHEADER* bmch;
-        OLE_HANDLE hbm;
+        HBITMAP hbm;
         HDC hdc;
 
+        pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
+        if (!pbmi)
+            return OutOfMemory;
         *image = GdipAlloc(sizeof(GpBitmap));
-        if(!*image) return OutOfMemory;
+        if(!*image){
+            GdipFree(pbmi);
+            return OutOfMemory;
+        }
         (*image)->type = ImageTypeBitmap;
 
         (*((GpBitmap**) image))->width = ipicture_pixel_width(pic);
         (*((GpBitmap**) image))->height = ipicture_pixel_height(pic);
 
         /* get the pixel format */
-        IPicture_get_Handle(pic, &hbm);
+        IPicture_get_Handle(pic, (OLE_HANDLE*)&hbm);
         IPicture_get_CurDC(pic, &hdc);
 
-        ZeroMemory(&bmi, sizeof(bmi));
-        bmch = (BITMAPCOREHEADER*) (&bmi.bmiHeader);
+        bmch = (BITMAPCOREHEADER*) (&pbmi->bmiHeader);
         bmch->bcSize = sizeof(BITMAPCOREHEADER);
 
         if(!hdc){
             HBITMAP old;
             hdc = CreateCompatibleDC(0);
-            old = SelectObject(hdc, (HBITMAP)hbm);
-            GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS);
+            old = SelectObject(hdc, hbm);
+            GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
             SelectObject(hdc, old);
             DeleteDC(hdc);
         }
         else
-            GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, &bmi, DIB_RGB_COLORS);
+            GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
 
         (*((GpBitmap**) image))->format = (bmch->bcBitCount << 8) | PixelFormatGDI;
+        GdipFree(pbmi);
     }
     else if(type == PICTYPE_METAFILE || type == PICTYPE_ENHMETAFILE){
         /* FIXME: missing initialization code */
@@ -936,6 +1092,8 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image)
 /* FIXME: no ICM */
 GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image)
 {
+    TRACE("%p %p\n", stream, image);
+
     return GdipLoadImageFromStream(stream, image);
 }
 
@@ -952,6 +1110,16 @@ GpStatus WINGDIPAPI GdipRemovePropertyItem(GpImage *image, PROPID propId)
     return NotImplemented;
 }
 
+GpStatus WINGDIPAPI GdipSetPropertyItem(GpImage *image, GDIPCONST PropertyItem* item)
+{
+    static int calls;
+
+    if(!(calls++))
+        FIXME("not implemented\n");
+
+    return NotImplemented;
+}
+
 GpStatus WINGDIPAPI GdipSaveImageToFile(GpImage *image, GDIPCONST WCHAR* filename,
                                         GDIPCONST CLSID *clsidEncoder,
                                         GDIPCONST EncoderParameters *encoderParams)
@@ -959,6 +1127,8 @@ GpStatus WINGDIPAPI GdipSaveImageToFile(GpImage *image, GDIPCONST WCHAR* filenam
     GpStatus stat;
     IStream *stream;
 
+    TRACE("%p (%s) %p %p\n", image, debugstr_w(filename), clsidEncoder, encoderParams);
+
     if (!image || !filename|| !clsidEncoder)
         return InvalidParameter;
 
@@ -1067,6 +1237,8 @@ GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage *image, IStream* stream,
     output = NULL;
     output_size = 0;
 
+    TRACE("%p %p %p %p\n", image, stream, clsid, params);
+
     if(!image || !stream)
         return InvalidParameter;
 
@@ -1176,11 +1348,42 @@ static const ImageCodecInfo codecs[NUM_ENCODERS_SUPPORTED] =
         },
     };
 
+/*****************************************************************************
+ * GdipGetImageDecodersSize [GDIPLUS.@]
+ */
+GpStatus WINGDIPAPI GdipGetImageDecodersSize(UINT *numDecoders, UINT *size)
+{
+    FIXME("%p %p stub!\n", numDecoders, size);
+
+    if (!numDecoders || !size)
+        return InvalidParameter;
+
+    *numDecoders = 0;
+    *size = 0;
+
+    return Ok;
+}
+
+/*****************************************************************************
+ * GdipGetImageDecoders [GDIPLUS.@]
+ */
+GpStatus WINGDIPAPI GdipGetImageDecoders(UINT numDecoders, UINT size, ImageCodecInfo *decoders)
+{
+    FIXME("%u %u %p stub!\n", numDecoders, size, decoders);
+
+    if (!decoders)
+        return GenericError;
+
+    return NotImplemented;
+}
+
 /*****************************************************************************
  * GdipGetImageEncodersSize [GDIPLUS.@]
  */
 GpStatus WINGDIPAPI GdipGetImageEncodersSize(UINT *numEncoders, UINT *size)
 {
+    TRACE("%p %p\n", numEncoders, size);
+
     if (!numEncoders || !size)
         return InvalidParameter;
 
@@ -1195,6 +1398,8 @@ GpStatus WINGDIPAPI GdipGetImageEncodersSize(UINT *numEncoders, UINT *size)
  */
 GpStatus WINGDIPAPI GdipGetImageEncoders(UINT numEncoders, UINT size, ImageCodecInfo *encoders)
 {
+    TRACE("%u %u %p\n", numEncoders, size, encoders);
+
     if (!encoders ||
         (numEncoders != NUM_ENCODERS_SUPPORTED) ||
         (size != sizeof (codecs)))
@@ -1214,6 +1419,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
     GpStatus retval;
     PixelFormat format;
 
+    TRACE("%p %p %p\n", hbm, hpal, bitmap);
+
     if(!hbm || !bitmap)
         return InvalidParameter;
 
@@ -1240,6 +1447,9 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
         case 24:
             format = PixelFormat24bppRGB;
             break;
+        case 32:
+            format = PixelFormat32bppRGB;
+            break;
         case 48:
             format = PixelFormat48bppRGB;
             break;
@@ -1273,6 +1483,8 @@ GpStatus WINGDIPAPI GdipSetEffectParameters(CGpEffect *effect,
  */
 GpStatus WINGDIPAPI GdipGetImageFlags(GpImage *image, UINT *flags)
 {
+    TRACE("%p %p\n", image, flags);
+
     if(!image || !flags)
         return InvalidParameter;
 
@@ -1280,3 +1492,52 @@ GpStatus WINGDIPAPI GdipGetImageFlags(GpImage *image, UINT *flags)
 
     return Ok;
 }
+
+GpStatus WINGDIPAPI GdipTestControl(GpTestControlEnum control, void *param)
+{
+    TRACE("(%d, %p)\n", control, param);
+
+    switch(control){
+        case TestControlForceBilinear:
+            if(param)
+                FIXME("TestControlForceBilinear not handled\n");
+            break;
+        case TestControlNoICM:
+            if(param)
+                FIXME("TestControlNoICM not handled\n");
+            break;
+        case TestControlGetBuildNumber:
+            *((DWORD*)param) = 3102;
+            break;
+    }
+
+    return Ok;
+}
+
+GpStatus WINGDIPAPI GdipRecordMetafileFileName(GDIPCONST WCHAR* fileName,
+                            HDC hdc, EmfType type, GDIPCONST GpRectF *pFrameRect,
+                            MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc,
+                            GpMetafile **metafile)
+{
+    FIXME("%s %p %d %p %d %s %p stub!\n", debugstr_w(fileName), hdc, type, pFrameRect,
+                                 frameUnit, debugstr_w(desc), metafile);
+
+    return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipRecordMetafileFileNameI(GDIPCONST WCHAR* fileName, HDC hdc, EmfType type,
+                            GDIPCONST GpRect *pFrameRect, MetafileFrameUnit frameUnit,
+                            GDIPCONST WCHAR *desc, GpMetafile **metafile)
+{
+    FIXME("%s %p %d %p %d %s %p stub!\n", debugstr_w(fileName), hdc, type, pFrameRect,
+                                 frameUnit, debugstr_w(desc), metafile);
+
+    return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipImageForceValidation(GpImage *image)
+{
+    FIXME("%p\n", image);
+
+    return Ok;
+}
index d2e1511..2176da6 100644 (file)
@@ -221,7 +221,7 @@ GpStatus WINGDIPAPI GdipIsMatrixInvertible(GDIPCONST GpMatrix *matrix, BOOL *res
     return Ok;
 }
 
-GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GpMatrix* matrix2,
+GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GDIPCONST GpMatrix* matrix2,
     GpMatrixOrder order)
 {
     TRACE("(%p, %p, %d)\n", matrix, matrix2, order);
index 104d9de..f41185a 100644 (file)
@@ -67,8 +67,28 @@ static DWORD gdip_to_gdi_join(GpLineJoin join)
     }
 }
 
+static GpPenType bt_to_pt(GpBrushType bt)
+{
+    switch(bt){
+        case BrushTypeSolidColor:
+            return PenTypeSolidColor;
+        case BrushTypeHatchFill:
+            return PenTypeHatchFill;
+        case BrushTypeTextureFill:
+            return PenTypeTextureFill;
+        case BrushTypePathGradient:
+            return PenTypePathGradient;
+        case BrushTypeLinearGradient:
+            return PenTypeLinearGradient;
+        default:
+            return PenTypeUnknown;
+    }
+}
+
 GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
 {
+    TRACE("(%p, %p)\n", pen, clonepen);
+
     if(!pen || !clonepen)
         return InvalidParameter;
 
@@ -90,6 +110,8 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit,
     GpBrush *brush;
     GpStatus status;
 
+    TRACE("(%x, %.2f, %d, %p)\n", color, width, unit, pen);
+
     GdipCreateSolidFill(color, (GpSolidFill **)(&brush));
     status = GdipCreatePen2(brush, width, unit, pen);
     GdipDeleteBrush(brush);
@@ -102,6 +124,8 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
     GpPen *gp_pen;
     GpBrush *clone_brush;
 
+    TRACE("(%p, %.2f, %d, %p)\n", brush, width, unit, pen);
+
     if(!pen || !brush)
         return InvalidParameter;
 
@@ -135,6 +159,8 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
 
 GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
 {
+    TRACE("(%p)\n", pen);
+
     if(!pen)    return InvalidParameter;
 
     GdipDeleteBrush(pen->brush);
@@ -148,6 +174,8 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
 
 GpStatus WINGDIPAPI GdipGetPenBrushFill(GpPen *pen, GpBrush **brush)
 {
+    TRACE("(%p, %p)\n", pen, brush);
+
     if(!pen || !brush)
         return InvalidParameter;
 
@@ -156,6 +184,8 @@ GpStatus WINGDIPAPI GdipGetPenBrushFill(GpPen *pen, GpBrush **brush)
 
 GpStatus WINGDIPAPI GdipGetPenColor(GpPen *pen, ARGB *argb)
 {
+    TRACE("(%p, %p)\n", pen, argb);
+
     if(!pen || !argb)
         return InvalidParameter;
 
@@ -167,6 +197,8 @@ GpStatus WINGDIPAPI GdipGetPenColor(GpPen *pen, ARGB *argb)
 
 GpStatus WINGDIPAPI GdipGetPenCustomEndCap(GpPen *pen, GpCustomLineCap** customCap)
 {
+    TRACE("(%p, %p)\n", pen, customCap);
+
     if(!pen || !customCap)
         return InvalidParameter;
 
@@ -180,6 +212,8 @@ GpStatus WINGDIPAPI GdipGetPenCustomEndCap(GpPen *pen, GpCustomLineCap** customC
 
 GpStatus WINGDIPAPI GdipGetPenCustomStartCap(GpPen *pen, GpCustomLineCap** customCap)
 {
+    TRACE("(%p, %p)\n", pen, customCap);
+
     if(!pen || !customCap)
         return InvalidParameter;
 
@@ -193,6 +227,8 @@ GpStatus WINGDIPAPI GdipGetPenCustomStartCap(GpPen *pen, GpCustomLineCap** custo
 
 GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count)
 {
+    TRACE("(%p, %p, %d)\n", pen, dash, count);
+
     if(!pen || !dash || count > pen->numdashes)
         return InvalidParameter;
 
@@ -207,6 +243,8 @@ GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count)
 
 GpStatus WINGDIPAPI GdipGetPenDashCap197819(GpPen *pen, GpDashCap *dashCap)
 {
+    TRACE("(%p, %p)\n", pen, dashCap);
+
     if(!pen || !dashCap)
         return InvalidParameter;
 
@@ -217,6 +255,8 @@ GpStatus WINGDIPAPI GdipGetPenDashCap197819(GpPen *pen, GpDashCap *dashCap)
 
 GpStatus WINGDIPAPI GdipGetPenDashCount(GpPen *pen, INT *count)
 {
+    TRACE("(%p, %p)\n", pen, count);
+
     if(!pen || !count)
         return InvalidParameter;
 
@@ -227,6 +267,8 @@ GpStatus WINGDIPAPI GdipGetPenDashCount(GpPen *pen, INT *count)
 
 GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen *pen, REAL *offset)
 {
+    TRACE("(%p, %p)\n", pen, offset);
+
     if(!pen || !offset)
         return InvalidParameter;
 
@@ -237,6 +279,8 @@ GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen *pen, REAL *offset)
 
 GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash)
 {
+    TRACE("(%p, %p)\n", pen, dash);
+
     if(!pen || !dash)
         return InvalidParameter;
 
@@ -247,6 +291,8 @@ GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dash)
 
 GpStatus WINGDIPAPI GdipGetPenEndCap(GpPen *pen, GpLineCap *endCap)
 {
+    TRACE("(%p, %p)\n", pen, endCap);
+
     if(!pen || !endCap)
         return InvalidParameter;
 
@@ -255,8 +301,22 @@ GpStatus WINGDIPAPI GdipGetPenEndCap(GpPen *pen, GpLineCap *endCap)
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipGetPenFillType(GpPen *pen, GpPenType* type)
+{
+    TRACE("(%p, %p)\n", pen, type);
+
+    if(!pen || !type)
+        return InvalidParameter;
+
+    *type = bt_to_pt(pen->brush->bt);
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipGetPenLineJoin(GpPen *pen, GpLineJoin *lineJoin)
 {
+    TRACE("(%p, %p)\n", pen, lineJoin);
+
     if(!pen || !lineJoin)
         return InvalidParameter;
 
@@ -267,6 +327,8 @@ GpStatus WINGDIPAPI GdipGetPenLineJoin(GpPen *pen, GpLineJoin *lineJoin)
 
 GpStatus WINGDIPAPI GdipGetPenMode(GpPen *pen, GpPenAlignment *mode)
 {
+    TRACE("(%p, %p)\n", pen, mode);
+
     if(!pen || !mode)
         return InvalidParameter;
 
@@ -277,6 +339,8 @@ GpStatus WINGDIPAPI GdipGetPenMode(GpPen *pen, GpPenAlignment *mode)
 
 GpStatus WINGDIPAPI GdipGetPenMiterLimit(GpPen *pen, REAL *miterLimit)
 {
+    TRACE("(%p, %p)\n", pen, miterLimit);
+
     if(!pen || !miterLimit)
         return InvalidParameter;
 
@@ -287,6 +351,8 @@ GpStatus WINGDIPAPI GdipGetPenMiterLimit(GpPen *pen, REAL *miterLimit)
 
 GpStatus WINGDIPAPI GdipGetPenStartCap(GpPen *pen, GpLineCap *startCap)
 {
+    TRACE("(%p, %p)\n", pen, startCap);
+
     if(!pen || !startCap)
         return InvalidParameter;
 
@@ -297,6 +363,8 @@ GpStatus WINGDIPAPI GdipGetPenStartCap(GpPen *pen, GpLineCap *startCap)
 
 GpStatus WINGDIPAPI GdipGetPenUnit(GpPen *pen, GpUnit *unit)
 {
+    TRACE("(%p, %p)\n", pen, unit);
+
     if(!pen || !unit)
         return InvalidParameter;
 
@@ -307,6 +375,8 @@ GpStatus WINGDIPAPI GdipGetPenUnit(GpPen *pen, GpUnit *unit)
 
 GpStatus WINGDIPAPI GdipGetPenWidth(GpPen *pen, REAL *width)
 {
+    TRACE("(%p, %p)\n", pen, width);
+
     if(!pen || !width)
         return InvalidParameter;
 
@@ -317,6 +387,8 @@ GpStatus WINGDIPAPI GdipGetPenWidth(GpPen *pen, REAL *width)
 
 GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen *pen, GpBrush *brush)
 {
+    TRACE("(%p, %p)\n", pen, brush);
+
     if(!pen || !brush)
         return InvalidParameter;
 
@@ -326,6 +398,8 @@ GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen *pen, GpBrush *brush)
 
 GpStatus WINGDIPAPI GdipSetPenColor(GpPen *pen, ARGB argb)
 {
+    TRACE("(%p, %x)\n", pen, argb);
+
     if(!pen)
         return InvalidParameter;
 
@@ -335,11 +409,24 @@ GpStatus WINGDIPAPI GdipSetPenColor(GpPen *pen, ARGB argb)
     return GdipSetSolidFillColor(((GpSolidFill*)pen->brush), argb);
 }
 
+GpStatus WINGDIPAPI GdipSetPenCompoundArray(GpPen *pen, GDIPCONST REAL *dash,
+    INT count)
+{
+    FIXME("(%p, %p, %i): stub", pen, dash, count);
+
+    if (!pen || !dash || count < 2 || count%2 == 1)
+        return InvalidParameter;
+
+    return NotImplemented;
+}
+
 GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen *pen, GpCustomLineCap* customCap)
 {
     GpCustomLineCap * cap;
     GpStatus ret;
 
+    TRACE("(%p, %p)\n", pen, customCap);
+
     /* native crashes on pen == NULL, customCap != NULL */
     if(!customCap) return InvalidParameter;
 
@@ -357,6 +444,8 @@ GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* custom
     GpCustomLineCap * cap;
     GpStatus ret;
 
+    TRACE("(%p, %p)\n", pen, customCap);
+
     /* native crashes on pen == NULL, customCap != NULL */
     if(!customCap) return InvalidParameter;
 
@@ -375,6 +464,8 @@ GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash,
     INT i;
     REAL sum = 0;
 
+    TRACE("(%p, %p, %d)\n", pen, dash, count);
+
     if(!pen || !dash)
         return InvalidParameter;
 
@@ -409,6 +500,8 @@ GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash,
 
 GpStatus WINGDIPAPI GdipSetPenDashCap197819(GpPen *pen, GpDashCap dashCap)
 {
+    TRACE("(%p, %d)\n", pen, dashCap);
+
     if(!pen)
         return InvalidParameter;
 
@@ -420,6 +513,8 @@ GpStatus WINGDIPAPI GdipSetPenDashCap197819(GpPen *pen, GpDashCap dashCap)
 /* FIXME: dash offset not used */
 GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen *pen, REAL offset)
 {
+    TRACE("(%p, %.2f)\n", pen, offset);
+
     if(!pen)
         return InvalidParameter;
 
@@ -430,6 +525,8 @@ GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen *pen, REAL offset)
 
 GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
 {
+    TRACE("(%p, %d)\n", pen, dash);
+
     if(!pen)
         return InvalidParameter;
 
@@ -449,6 +546,8 @@ GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
 
 GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen *pen, GpLineCap cap)
 {
+    TRACE("(%p, %d)\n", pen, cap);
+
     if(!pen)    return InvalidParameter;
 
     /* The old custom cap gets deleted even if the new style is LineCapCustom. */
@@ -463,6 +562,8 @@ GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen *pen, GpLineCap cap)
 GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen *pen, GpLineCap start,
     GpLineCap end, GpDashCap dash)
 {
+    TRACE("%p, %d, %d, %d)\n", pen, start, end, dash);
+
     if(!pen)
         return InvalidParameter;
 
@@ -482,6 +583,8 @@ GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen *pen, GpLineCap start,
  * Both kinds of miter joins clip if the angle is less than 11 degrees. */
 GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen *pen, GpLineJoin join)
 {
+    TRACE("(%p, %d)\n", pen, join);
+
     if(!pen)    return InvalidParameter;
 
     pen->join = join;
@@ -493,6 +596,8 @@ GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen *pen, GpLineJoin join)
 
 GpStatus WINGDIPAPI GdipSetPenMiterLimit(GpPen *pen, REAL limit)
 {
+    TRACE("(%p, %.2f)\n", pen, limit);
+
     if(!pen)
         return InvalidParameter;
 
@@ -503,6 +608,8 @@ GpStatus WINGDIPAPI GdipSetPenMiterLimit(GpPen *pen, REAL limit)
 
 GpStatus WINGDIPAPI GdipSetPenStartCap(GpPen *pen, GpLineCap cap)
 {
+    TRACE("(%p, %d)\n", pen, cap);
+
     if(!pen)    return InvalidParameter;
 
     GdipDeleteCustomLineCap(pen->customstart);
@@ -514,6 +621,8 @@ GpStatus WINGDIPAPI GdipSetPenStartCap(GpPen *pen, GpLineCap cap)
 
 GpStatus WINGDIPAPI GdipSetPenWidth(GpPen *pen, REAL width)
 {
+    TRACE("(%p, %.2f)\n", pen, width);
+
     if(!pen)    return InvalidParameter;
 
     pen->width = width;
@@ -523,6 +632,8 @@ GpStatus WINGDIPAPI GdipSetPenWidth(GpPen *pen, REAL width)
 
 GpStatus WINGDIPAPI GdipSetPenMode(GpPen *pen, GpPenAlignment mode)
 {
+    TRACE("(%p, %d)\n", pen, mode);
+
     if(!pen)    return InvalidParameter;
 
     pen->align = mode;
index 90aaf9e..d28292c 100644 (file)
@@ -573,6 +573,9 @@ GpStatus WINGDIPAPI GdipCreateRegionHrgn(HRGN hrgn, GpRegion **region)
 {
     FIXME("(%p, %p): stub\n", hrgn, region);
 
+    if(!hrgn || !region)
+        return InvalidParameter;
+
     *region = NULL;
     return NotImplemented;
 }
@@ -765,15 +768,189 @@ GpStatus WINGDIPAPI GdipGetRegionDataSize(GpRegion *region, UINT *needed)
     return Ok;
 }
 
+static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn)
+{
+    HDC new_hdc=NULL;
+    GpStatus stat;
+    INT save_state;
+
+    if (!graphics)
+    {
+        new_hdc = GetDC(0);
+        if (!new_hdc)
+            return OutOfMemory;
+
+        stat = GdipCreateFromHDC(new_hdc, &graphics);
+        if (stat != Ok)
+        {
+            ReleaseDC(0, new_hdc);
+            return stat;
+        }
+    }
+
+    save_state = SaveDC(graphics->hdc);
+    EndPath(graphics->hdc);
+
+    SetPolyFillMode(graphics->hdc, (path->fill == FillModeAlternate ? ALTERNATE
+                                                                    : WINDING));
+
+    stat = trace_path(graphics, path);
+    if (stat == Ok)
+    {
+        *hrgn = PathToRegion(graphics->hdc);
+        stat = *hrgn ? Ok : OutOfMemory;
+    }
+
+    RestoreDC(graphics->hdc, save_state);
+    if (new_hdc)
+    {
+        ReleaseDC(0, new_hdc);
+        GdipDeleteGraphics(graphics);
+    }
+
+    return stat;
+}
+
+static GpStatus get_region_hrgn(struct region_element *element, GpGraphics *graphics, HRGN *hrgn)
+{
+    switch (element->type)
+    {
+        case RegionDataInfiniteRect:
+            *hrgn = NULL;
+            return Ok;
+        case RegionDataEmptyRect:
+            *hrgn = CreateRectRgn(0, 0, 0, 0);
+            return *hrgn ? Ok : OutOfMemory;
+        case RegionDataPath:
+            return get_path_hrgn(element->elementdata.pathdata.path, graphics, hrgn);
+        case RegionDataRect:
+        {
+            GpPath* path;
+            GpStatus stat;
+            GpRectF* rc = &element->elementdata.rect;
+
+            stat = GdipCreatePath(FillModeAlternate, &path);
+            if (stat != Ok)
+                return stat;
+            stat = GdipAddPathRectangle(path, rc->X, rc->Y, rc->Width, rc->Height);
+
+            if (stat == Ok)
+                stat = get_path_hrgn(path, graphics, hrgn);
+
+            GdipDeletePath(path);
+
+            return stat;
+        }
+        case CombineModeIntersect:
+        case CombineModeUnion:
+        case CombineModeXor:
+        case CombineModeExclude:
+        case CombineModeComplement:
+        {
+            HRGN left, right;
+            GpStatus stat;
+            int ret;
+
+            stat = get_region_hrgn(element->elementdata.combine.left, graphics, &left);
+            if (stat != Ok)
+            {
+                *hrgn = NULL;
+                return stat;
+            }
+
+            if (left == NULL)
+            {
+                /* existing region is infinite */
+                switch (element->type)
+                {
+                    case CombineModeIntersect:
+                        return get_region_hrgn(element->elementdata.combine.right, graphics, hrgn);
+                    case CombineModeXor: case CombineModeExclude:
+                        FIXME("cannot exclude from an infinite region\n");
+                        /* fall-through */
+                    case CombineModeUnion: case CombineModeComplement:
+                        *hrgn = NULL;
+                        return Ok;
+                }
+            }
+
+            stat = get_region_hrgn(element->elementdata.combine.right, graphics, &right);
+            if (stat != Ok)
+            {
+                DeleteObject(left);
+                *hrgn = NULL;
+                return stat;
+            }
+
+            if (right == NULL)
+            {
+                /* new region is infinite */
+                switch (element->type)
+                {
+                    case CombineModeIntersect:
+                        *hrgn = left;
+                        return Ok;
+                    case CombineModeXor: case CombineModeComplement:
+                        FIXME("cannot exclude from an infinite region\n");
+                        /* fall-through */
+                    case CombineModeUnion: case CombineModeExclude:
+                        DeleteObject(left);
+                        *hrgn = NULL;
+                        return Ok;
+                }
+            }
+
+            switch (element->type)
+            {
+                case CombineModeIntersect:
+                    ret = CombineRgn(left, left, right, RGN_AND);
+                    break;
+                case CombineModeUnion:
+                    ret = CombineRgn(left, left, right, RGN_OR);
+                    break;
+                case CombineModeXor:
+                    ret = CombineRgn(left, left, right, RGN_XOR);
+                    break;
+                case CombineModeExclude:
+                    ret = CombineRgn(left, left, right, RGN_DIFF);
+                    break;
+                case CombineModeComplement:
+                    ret = CombineRgn(left, right, left, RGN_DIFF);
+                    break;
+                default:
+                    ret = ERROR;
+            }
+
+            DeleteObject(right);
+
+            if (ret == ERROR)
+            {
+                DeleteObject(left);
+                *hrgn = NULL;
+                return GenericError;
+            }
+
+            *hrgn = left;
+            return Ok;
+        }
+        default:
+            FIXME("GdipGetRegionHRgn unimplemented for region type=%x\n", element->type);
+            *hrgn = NULL;
+            return NotImplemented;
+    }
+}
+
 /*****************************************************************************
  * GdipGetRegionHRgn [GDIPLUS.@]
  */
 GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HRGN *hrgn)
 {
-    FIXME("(%p, %p, %p): stub\n", region, graphics, hrgn);
+    TRACE("(%p, %p, %p)\n", region, graphics, hrgn);
 
-    *hrgn = NULL;
-    return NotImplemented;
+    if (!region || !hrgn)
+        return InvalidParameter;
+
+    return get_region_hrgn(&region->node, graphics, hrgn);
 }
 
 GpStatus WINGDIPAPI GdipIsEmptyRegion(GpRegion *region, GpGraphics *graphics, BOOL *res)
diff --git a/reactos/dll/win32/localui/localui.c b/reactos/dll/win32/localui/localui.c
new file mode 100644 (file)
index 0000000..2acfc7e
--- /dev/null
@@ -0,0 +1,698 @@
+/*
+ * Implementation of the Local Printmonitor User Interface
+ *
+ * Copyright 2007 Detlef Riekenberg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#define NONAMELESSUNION
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winreg.h"
+#include "winuser.h"
+
+#include "winspool.h"
+#include "ddk/winsplp.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
+#include "localui.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(localui);
+
+/*****************************************************/
+
+static HINSTANCE LOCALUI_hInstance;
+
+static const WCHAR cmd_AddPortW[] = {'A','d','d','P','o','r','t',0};
+static const WCHAR cmd_ConfigureLPTPortCommandOKW[] = {'C','o','n','f','i','g','u','r','e',
+                                    'L','P','T','P','o','r','t',
+                                    'C','o','m','m','a','n','d','O','K',0};
+static const WCHAR cmd_DeletePortW[] = {'D','e','l','e','t','e','P','o','r','t',0};
+static const WCHAR cmd_GetDefaultCommConfigW[] = {'G','e','t',
+                                    'D','e','f','a','u','l','t',
+                                    'C','o','m','m','C','o','n','f','i','g',0};
+static const WCHAR cmd_GetTransmissionRetryTimeoutW[] = {'G','e','t',
+                                    'T','r','a','n','s','m','i','s','s','i','o','n',
+                                    'R','e','t','r','y','T','i','m','e','o','u','t',0};
+static const WCHAR cmd_PortIsValidW[] = {'P','o','r','t','I','s','V','a','l','i','d',0};
+static const WCHAR cmd_SetDefaultCommConfigW[] = {'S','e','t',
+                                    'D','e','f','a','u','l','t',
+                                    'C','o','m','m','C','o','n','f','i','g',0};
+
+static const WCHAR fmt_uW[]  = {'%','u',0};
+static const WCHAR portname_LPT[]  = {'L','P','T',0};
+static const WCHAR portname_COM[]  = {'C','O','M',0};
+static const WCHAR portname_FILE[] = {'F','I','L','E',':',0};
+static const WCHAR portname_CUPS[] = {'C','U','P','S',':',0};
+static const WCHAR portname_LPR[]  = {'L','P','R',':',0};
+
+static const WCHAR XcvMonitorW[] = {',','X','c','v','M','o','n','i','t','o','r',' ',0};
+static const WCHAR XcvPortW[] = {',','X','c','v','P','o','r','t',' ',0};
+
+/*****************************************************/
+
+typedef struct tag_addportui_t {
+    LPWSTR  portname;
+    HANDLE  hXcv;
+} addportui_t;
+
+typedef struct tag_lptconfig_t {
+    HANDLE  hXcv;
+    DWORD   value;
+} lptconfig_t;
+
+
+static INT_PTR CALLBACK dlgproc_lptconfig(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
+
+/*****************************************************
+ *   strdupWW [internal]
+ */
+
+static LPWSTR strdupWW(LPCWSTR pPrefix, LPCWSTR pSuffix)
+{
+    LPWSTR  ptr;
+    DWORD   len;
+
+    len = lstrlenW(pPrefix) + (pSuffix ? lstrlenW(pSuffix) : 0) + 1;
+    ptr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+    if (ptr) {
+        lstrcpyW(ptr, pPrefix);
+        if (pSuffix) lstrcatW(ptr, pSuffix);
+    }
+    return ptr;
+}
+
+/*****************************************************
+ *   dlg_configure_com [internal]
+ *
+ */
+
+static BOOL dlg_configure_com(HANDLE hXcv, HWND hWnd, PCWSTR pPortName)
+{
+    COMMCONFIG cfg;
+    LPWSTR shortname;
+    DWORD status;
+    DWORD dummy;
+    DWORD len;
+    BOOL  res;
+
+    /* strip the colon (pPortName is never empty here) */
+    len = lstrlenW(pPortName);
+    shortname = HeapAlloc(GetProcessHeap(), 0, len  * sizeof(WCHAR));
+    if (shortname) {
+        memcpy(shortname, pPortName, (len -1) * sizeof(WCHAR));
+        shortname[len-1] = '\0';
+
+        /* get current settings */
+        len = sizeof(cfg);
+        status = ERROR_SUCCESS;
+        res = XcvDataW( hXcv, cmd_GetDefaultCommConfigW,
+                        (PBYTE) shortname,
+                        (lstrlenW(shortname) +1) * sizeof(WCHAR),
+                        (PBYTE) &cfg, len, &len, &status);
+
+        if (res && (status == ERROR_SUCCESS)) {
+            /* display the Dialog */
+            res = CommConfigDialogW(pPortName, hWnd, &cfg);
+            if (res) {
+                status = ERROR_SUCCESS;
+                /* set new settings */
+                res = XcvDataW(hXcv, cmd_SetDefaultCommConfigW,
+                               (PBYTE) &cfg, len,
+                               (PBYTE) &dummy, 0, &len, &status);
+            }
+        }
+        HeapFree(GetProcessHeap(), 0, shortname);
+        return res;
+    }
+    return FALSE;
+}
+
+
+/*****************************************************
+ *   dlg_configure_lpt [internal]
+ *
+ */
+
+static BOOL dlg_configure_lpt(HANDLE hXcv, HWND hWnd)
+{
+    lptconfig_t data;
+    BOOL  res;
+
+
+    data.hXcv = hXcv;
+
+    res = DialogBoxParamW(LOCALUI_hInstance, MAKEINTRESOURCEW(LPTCONFIG_DIALOG), hWnd,
+                               dlgproc_lptconfig, (LPARAM) &data);
+
+    TRACE("got %u with %u\n", res, GetLastError());
+
+    if (!res) SetLastError(ERROR_CANCELLED);
+    return res;
+}
+
+/******************************************************************
+ *  dlg_port_already_exists [internal]
+ */
+
+static void dlg_port_already_exists(HWND hWnd, LPCWSTR portname)
+{
+    WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
+    WCHAR res_PortExistsW[IDS_PORTEXISTS_MAXLEN];
+    LPWSTR  message;
+    DWORD   len;
+
+    res_PortW[0] = '\0';
+    res_PortExistsW[0] = '\0';
+    LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
+    LoadStringW(LOCALUI_hInstance, IDS_PORTEXISTS, res_PortExistsW, IDS_PORTEXISTS_MAXLEN);
+
+    len = lstrlenW(portname) + IDS_PORTEXISTS_MAXLEN + 1;
+    message = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+    if (message) {
+        message[0] = '\0';
+        snprintfW(message, len, res_PortExistsW, portname);
+        MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR);
+        HeapFree(GetProcessHeap(), 0, message);
+    }
+}
+
+/******************************************************************
+ *  dlg_invalid_portname [internal]
+ */
+
+static void dlg_invalid_portname(HWND hWnd, LPCWSTR portname)
+{
+    WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
+    WCHAR res_InvalidNameW[IDS_INVALIDNAME_MAXLEN];
+    LPWSTR  message;
+    DWORD   len;
+
+    res_PortW[0] = '\0';
+    res_InvalidNameW[0] = '\0';
+    LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
+    LoadStringW(LOCALUI_hInstance, IDS_INVALIDNAME, res_InvalidNameW, IDS_INVALIDNAME_MAXLEN);
+
+    len = lstrlenW(portname) + IDS_INVALIDNAME_MAXLEN;
+    message = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+    if (message) {
+        message[0] = '\0';
+        snprintfW(message, len, res_InvalidNameW, portname);
+        MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR);
+        HeapFree(GetProcessHeap(), 0, message);
+    }
+}
+
+/******************************************************************
+ * display the Dialog "Nothing to configure"
+ *
+ */
+
+static void dlg_nothingtoconfig(HWND hWnd)
+{
+    WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
+    WCHAR res_nothingW[IDS_NOTHINGTOCONFIG_MAXLEN];
+
+    res_PortW[0] = '\0';
+    res_nothingW[0] = '\0';
+    LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
+    LoadStringW(LOCALUI_hInstance, IDS_NOTHINGTOCONFIG, res_nothingW, IDS_NOTHINGTOCONFIG_MAXLEN);
+
+    MessageBoxW(hWnd, res_nothingW, res_PortW, MB_OK | MB_ICONINFORMATION);
+}
+
+/******************************************************************
+ *  dlg_win32error [internal]
+ */
+
+static void dlg_win32error(HWND hWnd, DWORD lasterror)
+{
+    WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
+    LPWSTR  message = NULL;
+    DWORD   res;
+
+    res_PortW[0] = '\0';
+    LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
+
+
+    res = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+                        NULL, lasterror, 0, (LPWSTR) &message, 0, NULL);
+
+    if (res > 0) {
+        MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR);
+        LocalFree(message);
+    }
+}
+
+/*****************************************************************************
+ *
+ */
+
+static INT_PTR CALLBACK dlgproc_addport(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+    addportui_t * data;
+    DWORD   status;
+    DWORD   dummy;
+    DWORD   len;
+    DWORD   res;
+
+    switch(msg)
+    {
+    case WM_INITDIALOG:
+        SetWindowLongPtrW(hwnd, DWLP_USER, lparam);
+        return TRUE;
+
+    case WM_COMMAND:
+        if (wparam == MAKEWPARAM(IDOK, BN_CLICKED))
+        {
+            data = (addportui_t *) GetWindowLongPtrW(hwnd, DWLP_USER);
+            /* length in WCHAR, without the '\0' */
+            len = SendDlgItemMessageW(hwnd, ADDPORT_EDIT, WM_GETTEXTLENGTH, 0, 0);
+            data->portname = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
+
+            if (!data->portname) {
+                EndDialog(hwnd, FALSE);
+                return TRUE;
+            }
+            /* length is in WCHAR, including the '\0' */
+            GetDlgItemTextW(hwnd, ADDPORT_EDIT, data->portname, len + 1);
+            status = ERROR_SUCCESS;
+            res = XcvDataW( data->hXcv, cmd_PortIsValidW, (PBYTE) data->portname,
+                            (lstrlenW(data->portname) + 1) * sizeof(WCHAR),
+                            (PBYTE) &dummy, 0, &len, &status);
+
+            TRACE("got %u with status %u\n", res, status);
+            if (res && (status == ERROR_SUCCESS)) {
+                /* The caller must free data->portname */
+                EndDialog(hwnd, TRUE);
+                return TRUE;
+            }
+
+            if (res && (status == ERROR_INVALID_NAME)) {
+                dlg_invalid_portname(hwnd, data->portname);
+                HeapFree(GetProcessHeap(), 0, data->portname);
+                data->portname = NULL;
+                return TRUE;
+            }
+
+            dlg_win32error(hwnd, status);
+            HeapFree(GetProcessHeap(), 0, data->portname);
+            data->portname = NULL;
+            return TRUE;
+        }
+
+        if (wparam == MAKEWPARAM(IDCANCEL, BN_CLICKED))
+        {
+            EndDialog(hwnd, FALSE);
+            return TRUE;
+        }
+        return FALSE;
+    }
+    return FALSE;
+}
+
+/*****************************************************************************
+ *   dlgproc_lptconfig  [internal]
+ *
+ * Our message-proc is simple, as the range-check is done only during the
+ * command "OK" and the dialog is set to the start-value at "out of range".
+ *
+ * Native localui.dll does the check during keyboard-input and set the dialog
+ * to the previous value.
+ *
+ */
+
+static INT_PTR CALLBACK dlgproc_lptconfig(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+    lptconfig_t * data;
+    WCHAR   bufferW[16];
+    DWORD   status;
+    DWORD   dummy;
+    DWORD   len;
+    DWORD   res;
+
+
+    switch(msg)
+    {
+    case WM_INITDIALOG:
+        SetWindowLongPtrW(hwnd, DWLP_USER, lparam);
+        data = (lptconfig_t *) lparam;
+
+        /* Get current setting */
+        data->value = 45;
+        status = ERROR_SUCCESS;
+        res = XcvDataW( data->hXcv, cmd_GetTransmissionRetryTimeoutW,
+                        (PBYTE) &dummy, 0,
+                        (PBYTE) &data->value, sizeof(data->value), &len, &status);
+
+        TRACE("got %u with status %u\n", res, status);
+
+        /* Set current setting as the initial value in the Dialog */
+        SetDlgItemInt(hwnd, LPTCONFIG_EDIT, data->value, FALSE);
+        return TRUE;
+
+    case WM_COMMAND:
+        if (wparam == MAKEWPARAM(IDOK, BN_CLICKED))
+        {
+            data = (lptconfig_t *) GetWindowLongPtrW(hwnd, DWLP_USER);
+
+            status = FALSE;
+            res = GetDlgItemInt(hwnd, LPTCONFIG_EDIT, (BOOL *) &status, FALSE);
+            /* length is in WCHAR, including the '\0' */
+            GetDlgItemTextW(hwnd, LPTCONFIG_EDIT, bufferW, sizeof(bufferW) / sizeof(bufferW[0]));
+            TRACE("got %s and %u (translated: %u)\n", debugstr_w(bufferW), res, status);
+
+            /* native localui.dll use the same limits */
+            if ((res > 0) && (res < 1000000) && status) {
+                sprintfW(bufferW, fmt_uW, res);
+                res = XcvDataW( data->hXcv, cmd_ConfigureLPTPortCommandOKW,
+                        (PBYTE) bufferW,
+                        (lstrlenW(bufferW) +1) * sizeof(WCHAR),
+                        (PBYTE) &dummy, 0, &len, &status);
+
+                TRACE("got %u with status %u\n", res, status);
+                EndDialog(hwnd, TRUE);
+                return TRUE;
+            }
+
+            /* Set initial value and rerun the Dialog */
+            SetDlgItemInt(hwnd, LPTCONFIG_EDIT, data->value, FALSE);
+            return TRUE;
+        }
+
+        if (wparam == MAKEWPARAM(IDCANCEL, BN_CLICKED))
+        {
+            EndDialog(hwnd, FALSE);
+            return TRUE;
+        }
+        return FALSE;
+    }
+    return FALSE;
+}
+
+
+/*****************************************************
+ * get_type_from_name (internal)
+ *
+ */
+
+static DWORD get_type_from_name(LPCWSTR name)
+{
+    HANDLE  hfile;
+
+    if (!strncmpiW(name, portname_LPT, sizeof(portname_LPT) / sizeof(WCHAR) -1))
+        return PORT_IS_LPT;
+
+    if (!strncmpiW(name, portname_COM, sizeof(portname_COM) / sizeof(WCHAR) -1))
+        return PORT_IS_COM;
+
+    if (!strcmpiW(name, portname_FILE))
+        return PORT_IS_FILE;
+
+    if (name[0] == '/')
+        return PORT_IS_UNIXNAME;
+
+    if (name[0] == '|')
+        return PORT_IS_PIPE;
+
+    if (!strncmpW(name, portname_CUPS, sizeof(portname_CUPS) / sizeof(WCHAR) -1))
+        return PORT_IS_CUPS;
+
+    if (!strncmpW(name, portname_LPR, sizeof(portname_LPR) / sizeof(WCHAR) -1))
+        return PORT_IS_LPR;
+
+    /* Must be a file or a directory. Does the file exist ? */
+    hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+    TRACE("%p for OPEN_EXISTING on %s\n", hfile, debugstr_w(name));
+    if (hfile == INVALID_HANDLE_VALUE) {
+        /* Can we create the file? */
+        hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL);
+        TRACE("%p for OPEN_ALWAYS\n", hfile);
+    }
+    if (hfile != INVALID_HANDLE_VALUE) {
+        CloseHandle(hfile);
+        return PORT_IS_FILENAME;
+    }
+    /* We can't use the name. use GetLastError() for the reason */
+    return PORT_IS_UNKNOWN;
+}
+
+/*****************************************************
+ *   open_monitor_by_name [internal]
+ *
+ */
+static BOOL open_monitor_by_name(LPCWSTR pPrefix, LPCWSTR pPort, HANDLE * phandle)
+{
+    PRINTER_DEFAULTSW pd;
+    LPWSTR  fullname;
+    BOOL    res;
+
+    * phandle = 0;
+    TRACE("(%s,%s)\n", debugstr_w(pPrefix),debugstr_w(pPort) );
+
+    fullname = strdupWW(pPrefix, pPort);
+    pd.pDatatype = NULL;
+    pd.pDevMode  = NULL;
+    pd.DesiredAccess = SERVER_ACCESS_ADMINISTER;
+
+    res = OpenPrinterW(fullname, phandle, &pd);
+    HeapFree(GetProcessHeap(), 0, fullname);
+    return res;
+}
+
+/*****************************************************
+ *   localui_AddPortUI [exported through MONITORUI]
+ *
+ * Display a Dialog to add a local Port
+ *
+ * PARAMS
+ *  pName       [I] Servername or NULL (local Computer)
+ *  hWnd        [I] Handle to parent Window for the Dialog-Box or NULL
+ *  pMonitorName[I] Name of the Monitor, that should be used to add a Port or NULL
+ *  ppPortName  [O] PTR to PTR of a buffer, that receive the Name of the new Port or NULL
+ *
+ * RETURNS
+ *  Success: TRUE
+ *  Failure: FALSE
+ *
+ * NOTES
+ * The caller must free the buffer (returned in ppPortName) with GlobalFree().
+ * Native localui.dll failed with ERROR_INVALID_PARAMETER, when the user tried
+ * to add a Port, that start with "COM" or "LPT".
+ *
+ */
+static BOOL WINAPI localui_AddPortUI(PCWSTR pName, HWND hWnd, PCWSTR pMonitorName, PWSTR *ppPortName)
+{
+    addportui_t data;
+    HANDLE  hXcv;
+    LPWSTR  ptr = NULL;
+    DWORD   needed;
+    DWORD   dummy;
+    DWORD   status;
+    DWORD   res = FALSE;
+
+    TRACE(  "(%s, %p, %s, %p) (*ppPortName: %p)\n", debugstr_w(pName), hWnd,
+            debugstr_w(pMonitorName), ppPortName, ppPortName ? *ppPortName : NULL);
+
+    if (open_monitor_by_name(XcvMonitorW, pMonitorName, &hXcv)) {
+
+        ZeroMemory(&data, sizeof(addportui_t));
+        data.hXcv = hXcv;
+        res = DialogBoxParamW(LOCALUI_hInstance, MAKEINTRESOURCEW(ADDPORT_DIALOG), hWnd,
+                               dlgproc_addport, (LPARAM) &data);
+
+        TRACE("got %u with %u for %s\n", res, GetLastError(), debugstr_w(data.portname));
+
+        if (ppPortName) *ppPortName = NULL;
+
+        if (res) {
+            res = XcvDataW(hXcv, cmd_AddPortW, (PBYTE) data.portname,
+                            (lstrlenW(data.portname)+1) * sizeof(WCHAR),
+                            (PBYTE) &dummy, 0, &needed, &status);
+
+            TRACE("got %u with status %u\n", res, status);
+            if (res && (status == ERROR_SUCCESS)) {
+                /* Native localui uses GlobalAlloc also.
+                   The caller must GlobalFree the buffer */
+                ptr = GlobalAlloc(GPTR, (lstrlenW(data.portname)+1) * sizeof(WCHAR));
+                if (ptr) {
+                    lstrcpyW(ptr, data.portname);
+                    if (ppPortName) *ppPortName = ptr;
+                }
+            }
+
+            if (res && (status == ERROR_ALREADY_EXISTS)) {
+                dlg_port_already_exists(hWnd, data.portname);
+                /* Native localui also return "TRUE" from AddPortUI in this case */
+            }
+
+            HeapFree(GetProcessHeap(), 0, data.portname);
+        }
+        else
+        {
+            SetLastError(ERROR_CANCELLED);
+        }
+        ClosePrinter(hXcv);
+    }
+
+    TRACE("=> %u with %u\n", res, GetLastError());
+    return res;
+}
+
+
+/*****************************************************
+ *   localui_ConfigurePortUI [exported through MONITORUI]
+ *
+ * Display the Configuration-Dialog for a specific Port
+ *
+ * PARAMS
+ *  pName     [I] Servername or NULL (local Computer)
+ *  hWnd      [I] Handle to parent Window for the Dialog-Box or NULL
+ *  pPortName [I] Name of the Port, that should be configured
+ *
+ * RETURNS
+ *  Success: TRUE
+ *  Failure: FALSE
+ *
+ */
+static BOOL WINAPI localui_ConfigurePortUI(PCWSTR pName, HWND hWnd, PCWSTR pPortName)
+{
+    HANDLE  hXcv;
+    DWORD   res;
+
+    TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pPortName));
+    if (open_monitor_by_name(XcvPortW, pPortName, &hXcv)) {
+
+        res = get_type_from_name(pPortName);
+        switch(res)
+        {
+
+        case PORT_IS_COM:
+            res = dlg_configure_com(hXcv, hWnd, pPortName);
+            break;
+
+        case PORT_IS_LPT:
+            res = dlg_configure_lpt(hXcv, hWnd);
+            break;
+
+        default:
+            dlg_nothingtoconfig(hWnd);
+            SetLastError(ERROR_CANCELLED);
+            res = FALSE;
+        }
+
+        ClosePrinter(hXcv);
+        return res;
+    }
+    return FALSE;
+
+}
+
+/*****************************************************
+ *   localui_DeletePortUI [exported through MONITORUI]
+ *
+ * Delete a specific Port
+ *
+ * PARAMS
+ *  pName     [I] Servername or NULL (local Computer)
+ *  hWnd      [I] Handle to parent Window
+ *  pPortName [I] Name of the Port, that should be deleted
+ *
+ * RETURNS
+ *  Success: TRUE
+ *  Failure: FALSE
+ *
+ * NOTES
+ *  Native localui does not allow to delete a COM / LPT - Port (ERROR_NOT_SUPPORTED)
+ *
+ */
+static BOOL WINAPI localui_DeletePortUI(PCWSTR pName, HWND hWnd, PCWSTR pPortName)
+{
+    HANDLE  hXcv;
+    DWORD   dummy;
+    DWORD   needed;
+    DWORD   status;
+
+    TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pPortName));
+
+    if ((!pPortName) || (!pPortName[0])) {
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return FALSE;
+    }
+
+    if (open_monitor_by_name(XcvPortW, pPortName, &hXcv)) {
+        /* native localui tests here for LPT / COM - Ports and failed with
+           ERROR_NOT_SUPPORTED. */
+        if (XcvDataW(hXcv, cmd_DeletePortW, (LPBYTE) pPortName,
+            (lstrlenW(pPortName)+1) * sizeof(WCHAR), (LPBYTE) &dummy, 0, &needed, &status)) {
+
+            ClosePrinter(hXcv);
+            if (status != ERROR_SUCCESS) SetLastError(status);
+            return (status == ERROR_SUCCESS);
+        }
+        ClosePrinter(hXcv);
+        return FALSE;
+    }
+    SetLastError(ERROR_UNKNOWN_PORT);
+    return FALSE;
+}
+
+/*****************************************************
+ *      InitializePrintMonitorUI  (LOCALUI.@)
+ *
+ * Initialize the User-Interface for the Local Ports
+ *
+ * RETURNS
+ *  Success: Pointer to a MONITORUI Structure
+ *  Failure: NULL
+ *
+ */
+
+PMONITORUI WINAPI InitializePrintMonitorUI(void)
+{
+    static MONITORUI mymonitorui =
+    {
+        sizeof(MONITORUI),
+        localui_AddPortUI,
+        localui_ConfigurePortUI,
+        localui_DeletePortUI
+    };
+
+    TRACE("=> %p\n", &mymonitorui);
+    return &mymonitorui;
+}
+
+/*****************************************************
+ *      DllMain
+ */
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+    TRACE("(%p, %d, %p)\n",hinstDLL, fdwReason, lpvReserved);
+
+    switch(fdwReason)
+    {
+        case DLL_PROCESS_ATTACH:
+            DisableThreadLibraryCalls( hinstDLL );
+            LOCALUI_hInstance = hinstDLL;
+            break;
+    }
+    return TRUE;
+}
diff --git a/reactos/dll/win32/localui/localui.h b/reactos/dll/win32/localui/localui.h
new file mode 100644 (file)
index 0000000..aa244bd
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * internal include file of the Local Printmonitor User Interface
+ *
+ * Copyright 2007 Detlef Riekenberg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_LOCALUI__
+#define __WINE_LOCALUI__
+
+
+/* ## Resource-ID ## */
+#define ADDPORT_DIALOG  100
+#define ADDPORT_EDIT    101
+
+#define LPTCONFIG_DIALOG 200
+#define LPTCONFIG_GROUP  201
+#define LPTCONFIG_EDIT   202
+
+#define IDS_LOCALPORT       300
+#define IDS_INVALIDNAME     301
+#define IDS_PORTEXISTS      302
+#define IDS_NOTHINGTOCONFIG 303
+
+/* ## Reserved memorysize for the strings (in WCHAR) ## */
+#define IDS_LOCALPORT_MAXLEN 32
+#define IDS_INVALIDNAME_MAXLEN 48
+#define IDS_PORTEXISTS_MAXLEN  48
+#define IDS_NOTHINGTOCONFIG_MAXLEN 80
+
+/* ## Type of Ports ## */
+/* windows types */
+#define PORT_IS_UNKNOWN  0
+#define PORT_IS_LPT      1
+#define PORT_IS_COM      2
+#define PORT_IS_FILE     3
+#define PORT_IS_FILENAME 4
+
+/* wine extensions */
+#define PORT_IS_WINE     5
+#define PORT_IS_UNIXNAME 5
+#define PORT_IS_PIPE     6
+#define PORT_IS_CUPS     7
+#define PORT_IS_LPR      8
+
+
+#endif /* __WINE_LOCALUI__ */
diff --git a/reactos/dll/win32/localui/localui.rbuild b/reactos/dll/win32/localui/localui.rbuild
new file mode 100644 (file)
index 0000000..7ee4b14
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
+<group>
+<module name="localui" type="win32dll" baseaddress="${BASEADDRESS_LOCALUI}" installbase="system32" installname="localui.dll" allowwarnings="true">
+       <importlibrary definition="localui.spec" />
+       <include base="localui">.</include>
+       <include base="ReactOS">include/reactos/wine</include>
+       <define name="__WINESRC__" />
+       <file>localui.c</file>
+       <file>localui.rc</file>
+       <library>wine</library>
+       <library>winspool</library>
+       <library>user32</library>
+       <library>kernel32</library>
+       <library>uuid</library>
+       <library>ntdll</library>
+</module>
+</group>
diff --git a/reactos/dll/win32/localui/localui.rc b/reactos/dll/win32/localui/localui.rc
new file mode 100644 (file)
index 0000000..815cac0
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Top level resource file for localui
+ *
+ * Copyright 2007 Detlef Riekenberg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winver.h"
+#include "localui.h"
+
+#define WINE_FILENAME_STR "localui.dll"
+#define WINE_FILEDESCRIPTION_STR "User Interface for the Local Monitor"
+
+/* Same Version as WinXP_sp2 */
+#define WINE_FILEVERSION      5,1,2600,2180
+#define WINE_FILEVERSION_STR "5.1.2600.2180"
+
+#define WINE_PRODUCTVERSION      5,1,2600,2180
+#define WINE_PRODUCTVERSION_STR "5.1.2600.2180"
+
+#include "wine/wine_common_ver.rc"
+
+
+#include "ui_Da.rc"
+#include "ui_De.rc"
+#include "ui_En.rc"
+#include "ui_Fr.rc"
+#include "ui_Ko.rc"
+#include "ui_Nl.rc"
+#include "ui_No.rc"
+#include "ui_Pl.rc"
+#include "ui_Pt.rc"
+#include "ui_Ro.rc"
+#include "ui_Ru.rc"
+#include "ui_Si.rc"
+#include "ui_Sv.rc"
+#include "ui_Zh.rc"
diff --git a/reactos/dll/win32/localui/localui.spec b/reactos/dll/win32/localui/localui.spec
new file mode 100644 (file)
index 0000000..dafed22
--- /dev/null
@@ -0,0 +1 @@
+@ stdcall InitializePrintMonitorUI()
diff --git a/reactos/dll/win32/localui/ui_Da.rc b/reactos/dll/win32/localui/ui_Da.rc
new file mode 100644 (file)
index 0000000..9729926
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Danish resources for localui
+ *
+ * Copyright 2008 Jens Albretsen <jens@albretsen.dk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Opret en lokal port"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "&Skriv navnet på den nye port:", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "Annuller", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Opsæt LPT port"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Timeout (sekunder)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "&Transmission retry:", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Annuller", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Lokal port"
+    IDS_INVALIDNAME "'%s' er ikke et gyldigt port navn"
+    IDS_PORTEXISTS "Porten %s findes allerede"
+    IDS_NOTHINGTOCONFIG "Denne port har ingen indstillinger"
+}
diff --git a/reactos/dll/win32/localui/ui_De.rc b/reactos/dll/win32/localui/ui_De.rc
new file mode 100644 (file)
index 0000000..2fe35fc
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * German resources for localui
+ *
+ * Copyright 2007 Detlef Riekenberg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Lokalen Anschluss hinzufügen"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "&Lokaler Anschuss, der hinzugefügt werden soll:", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "OK", IDOK, 188, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Abbrechen", IDCANCEL, 188, 27, 50, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "LPT-Anschluss konfigurieren"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Zeitüberschreitung (Sekunden)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "Ü&bertragung wiederholen:", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Abbrechen", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Lokaler Anschluss"
+    IDS_INVALIDNAME "'%s' ist kein gültiger Anschlussname"
+    IDS_PORTEXISTS "Der Anschluss %s existiert bereits"
+    IDS_NOTHINGTOCONFIG "Dieser Anschluss hat keine Optionen zum Konfigurieren"
+}
diff --git a/reactos/dll/win32/localui/ui_En.rc b/reactos/dll/win32/localui/ui_En.rc
new file mode 100644 (file)
index 0000000..c2de626
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * English resources for localui
+ *
+ * Copyright 2007 Detlef Riekenberg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Add a Local Port"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "&Enter the port name to add:", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "Cancel", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Configure LPT Port"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Timeout (seconds)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "&Transmission Retry:", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Cancel", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Local Port"
+    IDS_INVALIDNAME "'%s' is not a valid port name"
+    IDS_PORTEXISTS "Port %s already exists"
+    IDS_NOTHINGTOCONFIG "This port has no options to configure"
+}
diff --git a/reactos/dll/win32/localui/ui_Fr.rc b/reactos/dll/win32/localui/ui_Fr.rc
new file mode 100644 (file)
index 0000000..261fa0b
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * French resources for localui
+ *
+ * Copyright 2007 Jonathan Ernst
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+#pragma code_page(65001)
+
+LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Ajouter un port local"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "&Saisisser le nom du port à ajouter :", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "Annuler", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Configurer un port LPT"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Délai (en secondes)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "&Essais de retransmission :", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Annuler", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Port local"
+    IDS_INVALIDNAME "« %s » n'est pas un nom de port valide"
+    IDS_PORTEXISTS "Le port %s existe déjà"
+    IDS_NOTHINGTOCONFIG "Ce port n'a pas d'options de configuration"
+}
+
+#pragma code_page(default)
diff --git a/reactos/dll/win32/localui/ui_Ko.rc b/reactos/dll/win32/localui/ui_Ko.rc
new file mode 100644 (file)
index 0000000..317d401
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Korean resources for localui
+ *
+ * Copyright 2007 Detlef Riekenberg
+ * Copyright 2007 YunSong Hwang(ȲÀ±¼º)(hys545@dreamwiz.com)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Áö¿ª Æ÷Æ® ´õÇϱâ"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "´õÇÒ Æ÷Æ® À̸§ ÀÔ·Â(&E):", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "È®ÀÎ", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "Ãë¼Ò", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "LPT Æ÷Æ® ¼³Á¤"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "½Ã°£ÃÊ°ú(ÃÊ)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "Àç Àü¼Û È½¼ö(&T):", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "È®ÀÎ", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Ãë¼Ò", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Áö¿ª Æ÷Æ®"
+    IDS_INVALIDNAME "'%s'´Â ¿Ã¹Ù¸¥ Æ÷Æ® À̸§ÀÌ ¾Æ´Õ´Ï´Ù"
+    IDS_PORTEXISTS "Æ÷Æ® %s´Â À̹̠Á¸ÀçÇÕ´Ï´Ù"
+    IDS_NOTHINGTOCONFIG "ÀÌ Æ÷Æ®´Â ¼³Á¤ÇÒ ¿É¼ÇÀÌ ¾ø½À´Ï´Ù"
+}
diff --git a/reactos/dll/win32/localui/ui_Nl.rc b/reactos/dll/win32/localui/ui_Nl.rc
new file mode 100644 (file)
index 0000000..59c58ff
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Dutch resources for localui
+ *
+ * Copyright 2008 Frans Kool
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Voeg een Lokale Poort toe"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "&Voer de toe te voegen poort naam in:", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "Annuleren", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Configureer LPT Poort"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Timeout (seconden)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "&Transmissie Herstart:", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Annuleren", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Lokale Poort"
+    IDS_INVALIDNAME "'%s' is geen valide poort naam"
+    IDS_PORTEXISTS "Poort %s bestaat reeds"
+    IDS_NOTHINGTOCONFIG "Deze poort heeft geen opties om in te stellen"
+}
diff --git a/reactos/dll/win32/localui/ui_No.rc b/reactos/dll/win32/localui/ui_No.rc
new file mode 100644 (file)
index 0000000..3a46bc8
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Norwegian Bokmål resources for localui
+ *
+ * Copyright 2007 Alexander N. Sørnes <alex@thehandofagony.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Legg til en lokal port"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "Skriv inn navn&et på den nye porten:", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "Avbryt", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Oppsett av LPT-port"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Tidsavbrudd (sekunder)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "Prøv å sende på nyt&t:", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Avbryt", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Lokal port"
+    IDS_INVALIDNAME "«%s» er ikke et gyldig portnavn"
+    IDS_PORTEXISTS "Porten %s finnes allerede"
+    IDS_NOTHINGTOCONFIG "Denne porten har ingen innstillinger"
+}
diff --git a/reactos/dll/win32/localui/ui_Pl.rc b/reactos/dll/win32/localui/ui_Pl.rc
new file mode 100644 (file)
index 0000000..74a5015
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Polish resources for localui
+ *
+ * Copyright 2007 Detlef Riekenberg
+ * Copyright 2007 Mikolaj Zalewski
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Dodaj port lokalny"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "&Nazwa nowego portu:", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "&OK", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "&Anuluj", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Konfiguracja portu LPT"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Czasy oczekiwania (sekundy)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "&Ponowienie transmisji:", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "&OK", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "&Anuluj", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Port lokalny"
+    IDS_INVALIDNAME "'%s' nie jest poprawn¹ nazw¹ portu"
+    IDS_PORTEXISTS "Port %s ju¿ istnieje"
+    IDS_NOTHINGTOCONFIG "Ten port nie ma opcji do skonfigurowania"
+}
diff --git a/reactos/dll/win32/localui/ui_Pt.rc b/reactos/dll/win32/localui/ui_Pt.rc
new file mode 100644 (file)
index 0000000..7bad521
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Portuguese resources for localui
+ *
+ * Copyright 2008 Ricardo Filipe
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Adicionar uma porta local"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "&Introduza o nome da porta a adicionar:", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "Cancelar", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Configurar porta LPT"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Tempo expirado (segundos)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "&Recomeço da transmissão:", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Cancelar", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Porta Local"
+    IDS_INVALIDNAME "'%s' não é um nome de porta válido"
+    IDS_PORTEXISTS "Porta %s já existe"
+    IDS_NOTHINGTOCONFIG "Esta porta não possui opções de configuração"
+}
diff --git a/reactos/dll/win32/localui/ui_Ro.rc b/reactos/dll/win32/localui/ui_Ro.rc
new file mode 100644 (file)
index 0000000..43edfe6
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2007 Detlef Riekenberg
+ * Copyright 2008 Michael Stefaniuc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
+
+#pragma code_page(65001)
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Adaugă un port local"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "&Nume port de adăugat:", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "Renunță", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Configurare port LPT"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Temporizare (secunde)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "Reîncearcă &transmisia:", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Renunță", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Port local"
+    IDS_INVALIDNAME "'%s' nu este un nume valid de port"
+    IDS_PORTEXISTS "Portul %s existsă deja"
+    IDS_NOTHINGTOCONFIG "Acest port nu are opțiuni de configurat"
+}
+
+#pragma code_page(default)
diff --git a/reactos/dll/win32/localui/ui_Ru.rc b/reactos/dll/win32/localui/ui_Ru.rc
new file mode 100644 (file)
index 0000000..96e78f1
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Russian resources for localui
+ *
+ * Copyright 2008 Vitaliy Margolen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Äîáàâèòü ëîêàëüíûé ïîðò"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "Ââåäèòå &íàçâàíèå ëîêàëüíîãî ïîðòà:", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "Îòìåíèòü", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Óñòàíîâêè ïàðàëëåëüíîãî ïîðòà"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Òàéì-àóò (ñåêóíä)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "&Ïîïûòîê ïåðåñûëêè:", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Îòìåíà", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Ëîêàëüíûé ïîðò"
+    IDS_INVALIDNAME "Íå ïðàâèëüíîå íàçâàíèå ïîðòà '%s'"
+    IDS_PORTEXISTS "Ïîðò '%s' óæå ñóùåñòâóåò"
+    IDS_NOTHINGTOCONFIG "Ýòîò ïîðò íå èìååò íàñòðîåê"
+}
diff --git a/reactos/dll/win32/localui/ui_Si.rc b/reactos/dll/win32/localui/ui_Si.rc
new file mode 100644 (file)
index 0000000..961a2e0
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Slovenian resources for localui
+ *
+ * Copyright 2008 Rok Mandeljc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#pragma code_page(65001)
+
+LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Dodaj lokalna vrata"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "&Ime vrat:", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "V redu", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "Prekliči", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Nastavitev LPT vrat"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Časovna omejitev (seconds)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "&Ponoven poskus prenosa:", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "V redu", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Prekliči", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Lokalna vrata"
+    IDS_INVALIDNAME "'%s' ni veljavno ime vrat"
+    IDS_PORTEXISTS "Vrata z imenom %s že obstajajo"
+    IDS_NOTHINGTOCONFIG "Ta vrata nimajo možnosti nastavitve"
+}
+
+#pragma code_page(default)
diff --git a/reactos/dll/win32/localui/ui_Sv.rc b/reactos/dll/win32/localui/ui_Sv.rc
new file mode 100644 (file)
index 0000000..3cd22fd
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Swedish resources for localui
+ *
+ * Copyright 2007 Daniel Nylander
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Lägg till en lokal port"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    LTEXT "&Ange portnamnet att lägga till:", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "Avbryt", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "Konfigurera LPT-port"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    GROUPBOX "Tidsgräns (sekunder)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "Öve&rföringsförsök:", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "OK", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "Avbryt", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "Lokal port"
+    IDS_INVALIDNAME "'%s' är inte ett giltigt portnamn"
+    IDS_PORTEXISTS "Porten %s finns redan"
+    IDS_NOTHINGTOCONFIG "Denna port har inga alternativ att konfigurera"
+}
diff --git a/reactos/dll/win32/localui/ui_Zh.rc b/reactos/dll/win32/localui/ui_Zh.rc
new file mode 100644 (file)
index 0000000..c1a3b61
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * localui (Simplified and Traditional Chinese Resources)
+ *
+ * Copyright 2008 Hongbo Ni <hongbo.at.njstar.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/* Chinese text is encoded in UTF-8 */
+#pragma code_page(65001)
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "添加本地端口"
+FONT 9, "MS Song"
+BEGIN
+    LTEXT "添加本地端口名称(&E):", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "确定", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "取消", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "设置打印端口"
+FONT 9, "MS Song"
+BEGIN
+    GROUPBOX "超时(秒)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "重试通讯(&T):", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "确定", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "取消", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "本地端口"
+    IDS_INVALIDNAME "'%s' 不是有效的端口名称"
+    IDS_PORTEXISTS "端口 %s 已经存在"
+    IDS_NOTHINGTOCONFIG "这个端口没有可设置选项"
+}
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
+
+ADDPORT_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "添加本地端口"
+FONT 8, "PMingLiu"
+BEGIN
+    LTEXT "添加本地端口名稱(&E):", -1, 7, 13, 194, 13, WS_VISIBLE
+    EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
+    DEFPUSHBUTTON "確定", IDOK, 199, 10, 40, 14, WS_VISIBLE
+    PUSHBUTTON "取消", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
+END
+
+
+LPTCONFIG_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 220, 47
+STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
+CAPTION "設定列印端口"
+FONT 8, "PMingLiu"
+BEGIN
+    GROUPBOX "超時(秒)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX
+    LTEXT "重試通訊(&T):", -1, 14, 22, 90, 13, WS_VISIBLE
+    EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER
+    DEFPUSHBUTTON "確定", IDOK, 164, 10, 50, 14, WS_VISIBLE
+    PUSHBUTTON "取消", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE
+END
+
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALPORT "本地端口"
+    IDS_INVALIDNAME "'%s' 不是有效的端口名稱"
+    IDS_PORTEXISTS "端口 %s 已經存在"
+    IDS_NOTHINGTOCONFIG "這個端口沒有可設定選項"
+}
+
+#pragma code_page(default)
index 0170631..2365b09 100644 (file)
@@ -503,7 +503,7 @@ static LONG dll_count;
 static UINT DetectJapaneseCode(LPCSTR input, DWORD count)
 {
     UINT code = 0;
-    int i = 0;
+    DWORD i = 0;
     unsigned char c1,c2;
 
     while ((code == 0 || code == 51932) && i < count)
@@ -615,7 +615,7 @@ static int han2zen(unsigned char *p1, unsigned char *p2)
 
 static UINT ConvertJIS2SJIS(LPCSTR input, DWORD count, LPSTR output)
 {
-    int i = 0;
+    DWORD i = 0;
     int j = 0;
     unsigned char p2,p;
     int shifted = FALSE;
@@ -683,7 +683,7 @@ static inline int enter_shift(LPSTR out, int c)
 
 static UINT ConvertSJIS2JIS(LPCSTR input, DWORD count, LPSTR output)
 {
-    int i = 0;
+    DWORD i = 0;
     int j = 0;
     unsigned char p2,p;
     int shifted = FALSE;
@@ -999,7 +999,6 @@ HRESULT WINAPI ConvertINetUnicodeToMultiByte(
 
         if (pDstStr)
         {
-            size = min(size, destsz);
             size = ConvertJapaneseUnicodeToJIS(pSrcStr, *pcSrcSize, pDstStr,
                                                destsz);
             if (!size)
@@ -1016,7 +1015,6 @@ HRESULT WINAPI ConvertINetUnicodeToMultiByte(
 
         if (pDstStr)
         {
-            size = min(size, destsz);
             size = WideCharToMultiByte(dwEncoding, 0, pSrcStr, *pcSrcSize,
                                        pDstStr, destsz, NULL, NULL);
             if (!size)
@@ -1343,7 +1341,7 @@ static const IClassFactoryVtbl MLANGCF_Vtbl =
  */
 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 {
-    int i;
+    unsigned int i;
     IClassFactoryImpl *factory;
 
     TRACE("%s %s %p\n",debugstr_guid(rclsid), debugstr_guid(iid), ppv);
@@ -1395,12 +1393,12 @@ typedef struct tagMLang_impl
     DWORD total_cp, total_scripts;
 } MLang_impl;
 
-static ULONG WINAPI MLang_AddRef( MLang_impl* This)
+static ULONG MLang_AddRef( MLang_impl* This)
 {
     return InterlockedIncrement(&This->ref);
 }
 
-static ULONG WINAPI MLang_Release( MLang_impl* This )
+static ULONG MLang_Release( MLang_impl* This )
 {
     ULONG ref = InterlockedDecrement(&This->ref);
 
@@ -1415,7 +1413,7 @@ static ULONG WINAPI MLang_Release( MLang_impl* This )
     return ref;
 }
 
-static HRESULT WINAPI MLang_QueryInterface(
+static HRESULT MLang_QueryInterface(
         MLang_impl* This,
         REFIID riid,
         void** ppvObject)
@@ -1855,8 +1853,27 @@ static HRESULT WINAPI fnIMLangFontLink_GetCharCodePages(
         WCHAR chSrc,
         DWORD* pdwCodePages)
 {
-    FIXME("\n");
-    return E_NOTIMPL;
+    int i;
+    CHAR buf;
+    BOOL used_dc;
+    DWORD codePages;
+
+    *pdwCodePages = 0;
+
+    for (i = 0; i < sizeof(mlang_data)/sizeof(mlang_data[0]); i++)
+    {
+        WideCharToMultiByte(mlang_data[i].family_codepage, WC_NO_BEST_FIT_CHARS,
+            &chSrc, 1, &buf, 1, NULL, &used_dc);
+
+        /* If default char is not used, current codepage include the given symbol */
+        if (!used_dc)
+        {
+            IMLangFontLink_CodePageToCodePages(iface,
+                mlang_data[i].family_codepage, &codePages);
+            *pdwCodePages |= codePages;
+        }
+    }
+    return S_OK;
 }
 
 static HRESULT WINAPI fnIMLangFontLink_GetStrCodePages(
@@ -2093,8 +2110,8 @@ static HRESULT WINAPI fnIMultiLanguage_GetCharsetInfo(
     BSTR Charset,
     PMIMECSETINFO pCharsetInfo)
 {
-    FIXME("\n");
-    return E_NOTIMPL;
+    ICOM_THIS_MULTI(MLang_impl, vtbl_IMultiLanguage, iface);
+    return IMultiLanguage3_GetCharsetInfo((IMultiLanguage3*)&This->vtbl_IMultiLanguage3, Charset, pCharsetInfo);
 }
 
 static HRESULT WINAPI fnIMultiLanguage_IsConvertible(
@@ -2772,8 +2789,42 @@ static HRESULT WINAPI fnIMultiLanguage2_ConvertStringInIStream(
     IStream* pstmIn,
     IStream* pstmOut)
 {
-    FIXME("\n");
-    return E_NOTIMPL;
+    char *src, *dst = NULL;
+    INT srclen, dstlen;
+    STATSTG stat;
+    HRESULT hr;
+
+    TRACE("%p %0x8 %s %u %u %p %p\n",
+          pdwMode, dwFlag, debugstr_w(lpFallBack), dwSrcEncoding, dwDstEncoding, pstmIn, pstmOut);
+
+    FIXME("dwFlag and lpFallBack not handled\n");
+
+    hr = IStream_Stat(pstmIn, &stat, STATFLAG_NONAME);
+    if (FAILED(hr)) return hr;
+
+    if (stat.cbSize.QuadPart > MAXLONG) return E_INVALIDARG;
+    if (!(src = HeapAlloc(GetProcessHeap(), 0, stat.cbSize.QuadPart))) return E_OUTOFMEMORY;
+
+    hr = IStream_Read(pstmIn, src, stat.cbSize.QuadPart, (ULONG *)&srclen);
+    if (FAILED(hr)) goto exit;
+
+    hr = ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, src, &srclen, NULL, &dstlen);
+    if (FAILED(hr)) goto exit;
+
+    if (!(dst = HeapAlloc(GetProcessHeap(), 0, dstlen)))
+    {
+        hr = E_OUTOFMEMORY;
+        goto exit;
+    }
+    hr = ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, src, &srclen, dst, &dstlen);
+    if (FAILED(hr)) goto exit;
+
+    hr = IStream_Write(pstmOut, dst, dstlen, NULL);
+
+exit:
+    HeapFree(GetProcessHeap(), 0, src);
+    HeapFree(GetProcessHeap(), 0, dst);
+    return hr;
 }
 
 /*
@@ -3049,7 +3100,9 @@ static HRESULT WINAPI fnIMLangFontLink2_GetStrCodePages( IMLangFontLink2* This,
         DWORD *pdwCodePages, long *pcchCodePages)
 {
     FIXME("(%p)->%s %li %x %p %p\n",This, debugstr_wn(pszSrc,cchSrc),cchSrc,dwPriorityCodePages,pdwCodePages,pcchCodePages);
-    return E_NOTIMPL;
+    *pdwCodePages = 0;
+    *pcchCodePages = 1;
+    return S_OK;
 }
 
 static HRESULT WINAPI fnIMLangFontLink2_CodePageToCodePages(IMLangFontLink2* This,
index 8c9ed44..12178ea 100644 (file)
@@ -1116,6 +1116,113 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style,
     return rc;
 }
 
+/***********************************************************************
+ *            SetupInstallFileA   (SETUPAPI.@)
+ */
+BOOL WINAPI SetupInstallFileA( HINF hinf, PINFCONTEXT inf_context, PCSTR source, PCSTR root,
+                               PCSTR dest, DWORD style, PSP_FILE_CALLBACK_A handler, PVOID context )
+{
+    BOOL ret = FALSE;
+    struct callback_WtoA_context ctx;
+    UNICODE_STRING sourceW, rootW, destW;
+
+    TRACE("%p %p %s %s %s %x %p %p\n", hinf, inf_context, debugstr_a(source), debugstr_a(root),
+          debugstr_a(dest), style, handler, context);
+
+    sourceW.Buffer = rootW.Buffer = destW.Buffer = NULL;
+    if (source && !RtlCreateUnicodeStringFromAsciiz( &sourceW, source ))
+    {
+        SetLastError( ERROR_NOT_ENOUGH_MEMORY );
+        return FALSE;
+    }
+    if (root && !RtlCreateUnicodeStringFromAsciiz( &rootW, root ))
+    {
+        SetLastError( ERROR_NOT_ENOUGH_MEMORY );
+        goto exit;
+    }
+    if (dest && !RtlCreateUnicodeStringFromAsciiz( &destW, dest ))
+    {
+        SetLastError( ERROR_NOT_ENOUGH_MEMORY );
+        goto exit;
+    }
+
+    ctx.orig_context = context;
+    ctx.orig_handler = handler;
+
+    ret = SetupInstallFileW( hinf, inf_context, sourceW.Buffer, rootW.Buffer, destW.Buffer, style, QUEUE_callback_WtoA, &ctx );
+
+exit:
+    RtlFreeUnicodeString( &sourceW );
+    RtlFreeUnicodeString( &rootW );
+    RtlFreeUnicodeString( &destW );
+    return ret;
+}
+
+/***********************************************************************
+ *            SetupInstallFileW   (SETUPAPI.@)
+ */
+BOOL WINAPI SetupInstallFileW( HINF hinf, PINFCONTEXT inf_context, PCWSTR source, PCWSTR root,
+                               PCWSTR dest, DWORD style, PSP_FILE_CALLBACK_W handler, PVOID context )
+{
+    static const WCHAR CopyFiles[] = {'C','o','p','y','F','i','l','e','s',0};
+
+    BOOL ret, absolute = (root && *root && !(style & SP_COPY_SOURCE_ABSOLUTE));
+    WCHAR *buffer, *p, *inf_source = NULL;
+    unsigned int len;
+
+    TRACE("%p %p %s %s %s %x %p %p\n", hinf, inf_context, debugstr_w(source), debugstr_w(root),
+          debugstr_w(dest), style, handler, context);
+
+    if (hinf)
+    {
+        INFCONTEXT ctx;
+
+        if (!inf_context)
+        {
+            inf_context = &ctx;
+            if (!SetupFindFirstLineW( hinf, CopyFiles, NULL, inf_context )) return FALSE;
+        }
+        if (!SetupGetStringFieldW( inf_context, 1, NULL, 0, (PDWORD) &len )) return FALSE;
+        if (!(inf_source = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
+        {
+            SetLastError( ERROR_NOT_ENOUGH_MEMORY );
+            return FALSE;
+        }
+        if (!SetupGetStringFieldW( inf_context, 1, inf_source, len, NULL )) return FALSE;
+        source = inf_source;
+    }
+    else if (!source)
+    {
+        SetLastError( ERROR_INVALID_PARAMETER );
+        return FALSE;
+    }
+
+    len = strlenW( source ) + 1;
+    if (absolute) len += strlenW( root ) + 1;
+
+    if (!(p = buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
+    {
+        HeapFree( GetProcessHeap(), 0, inf_source );
+        SetLastError( ERROR_NOT_ENOUGH_MEMORY );
+        return FALSE;
+    }
+
+    if (absolute)
+    {
+        strcpyW( buffer, root );
+        p += strlenW( buffer );
+        if (p[-1] != '\\') *p++ = '\\';
+    }
+    while (*source == '\\') source++;
+    strcpyW( p, source );
+
+    ret = do_file_copyW( buffer, dest, style, handler, context );
+
+    HeapFree( GetProcessHeap(), 0, inf_source );
+    HeapFree( GetProcessHeap(), 0, buffer );
+    return ret;
+}
+
 /***********************************************************************
  *            SetupCommitFileQueueW   (SETUPAPI.@)
  */
index a9c5e37..cb89b25 100644 (file)
 @ stdcall SetupInitDefaultQueueCallbackEx(long long long long ptr)
 @ stdcall SetupInitializeFileLogA(str long)
 @ stdcall SetupInitializeFileLogW(wstr long)
-@ stub SetupInstallFileA
+@ stdcall SetupInstallFileA(ptr ptr str str str long ptr ptr)
 @ stub SetupInstallFileExA
 @ stub SetupInstallFileExW
-@ stub SetupInstallFileW
+@ stdcall SetupInstallFileW(ptr ptr wstr wstr wstr long ptr ptr)
 @ stdcall SetupInstallFilesFromInfSectionA(long long long str str long)
 @ stdcall SetupInstallFilesFromInfSectionW(long long long wstr wstr long)
 @ stdcall SetupInstallFromInfSectionA(long long str long long str long ptr ptr long ptr)
 @ stdcall SetupOpenInfFileW(wstr wstr long ptr)
 @ stdcall SetupOpenLog(long)
 @ stdcall SetupOpenMasterInf()
-@ stub SetupPromptForDiskA
-@ stub SetupPromptForDiskW
+@ stdcall SetupPromptForDiskA(ptr str str str str str long ptr long ptr)
+@ stdcall SetupPromptForDiskW(ptr wstr wstr wstr wstr wstr long ptr long ptr)
 @ stdcall SetupPromptReboot(ptr ptr long)
 @ stub SetupQueryDrivesInDiskSpaceListA
 @ stub SetupQueryDrivesInDiskSpaceListW
index cf57fa4..cf7e3d5 100644 (file)
@@ -130,6 +130,34 @@ BOOL WINAPI SetupSetSourceListW(DWORD flags, PCWSTR *list, UINT count)
     return FALSE;
 }
 
+/***********************************************************************
+ *      SetupPromptForDiskA (SETUPAPI.@)
+ */
+UINT WINAPI SetupPromptForDiskA(HWND hwndParent, PCSTR DialogTitle, PCSTR DiskName,
+        PCSTR PathToSource, PCSTR FileSought, PCSTR TagFile, DWORD DiskPromptStyle,
+        PSTR PathBuffer, DWORD PathBufferSize, PDWORD PathRequiredSize)
+{
+    FIXME("%p %s %s %s %s %s %d %p %d %p: stub\n", hwndParent, debugstr_a(DialogTitle),
+          debugstr_a(DiskName), debugstr_a(PathToSource), debugstr_a(FileSought),
+          debugstr_a(TagFile), DiskPromptStyle, PathBuffer, PathBufferSize,
+          PathRequiredSize);
+    return 0;
+}
+
+/***********************************************************************
+ *      SetupPromptForDiskW (SETUPAPI.@)
+ */
+UINT WINAPI SetupPromptForDiskW(HWND hwndParent, PCWSTR DialogTitle, PCWSTR DiskName,
+        PCWSTR PathToSource, PCWSTR FileSought, PCWSTR TagFile, DWORD DiskPromptStyle,
+        PWSTR PathBuffer, DWORD PathBufferSize, PDWORD PathRequiredSize)
+{
+    FIXME("%p %s %s %s %s %s %d %p %d %p: stub\n", hwndParent, debugstr_w(DialogTitle),
+          debugstr_w(DiskName), debugstr_w(PathToSource), debugstr_w(FileSought),
+          debugstr_w(TagFile), DiskPromptStyle, PathBuffer, PathBufferSize,
+          PathRequiredSize);
+    return 0;
+}
+
 /***********************************************************************
  *             SetupDiRemoveDevice(SETUPAPI.@)
  */
index 4bfc57c..eafaf66 100644 (file)
 <directory name="kernel32">
        <xi:include href="kernel32/kernel32.rbuild" />
 </directory>
+<directory name="localui">
+       <xi:include href="localui/localui.rbuild" />
+</directory>
 <directory name="lpk">
        <xi:include href="lpk/lpk.rbuild" />
 </directory>
index 8d04c65..b245cdb 100644 (file)
@@ -1453,3 +1453,292 @@ WritePrinter(HANDLE Printer, PVOID Buffer, DWORD BufSize, PDWORD Written)
 
   return FALSE;
 }
+
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+XcvDataW(HANDLE hXcv,
+         LPCWSTR pszDataName,
+         PBYTE pInputData,
+         DWORD cbInputData,
+         PBYTE pOutputData,
+         DWORD cbOutputData,
+         PDWORD pcbOutputNeeded,
+         PDWORD pdwStatus)
+{
+    OutputDebugStringW(L"winspool XcvDataW stub called\n");
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+SetDefaultPrinterA(LPCSTR pszPrinter)
+{
+    OutputDebugStringW(L"winspool SetDefaultPrinterA stub called\n");
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+SetDefaultPrinterW(LPCWSTR pszPrinter)
+{
+    OutputDebugStringW(L"winspool SetDefaultPrinterW stub called\n");
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+AddPortExA(LPSTR pName,
+           DWORD dwLevel,
+           LPBYTE pBuffer,
+           LPSTR pMonitorName)
+{
+    OutputDebugStringW(L"winspool AddPortExA stub called\n");
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+AddPortExW(LPWSTR pName,
+           DWORD dwLevel,
+           LPBYTE pBuffer,
+           LPWSTR pMonitorName)
+{
+    OutputDebugStringW(L"winspool AddPortExW stub called\n");
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+AddPrinterDriverExA(LPSTR pName,
+                    DWORD dwLevel,
+                    LPBYTE pDriverInfo,
+                    DWORD dwFileCopyFlags)
+{
+    OutputDebugStringW(L"winspool AddPrinterDriverExA stub called\n");
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+AddPrinterDriverExW(LPWSTR pName,
+                    DWORD dwLevel,
+                    LPBYTE pDriverInfo,
+                    DWORD dwFileCopyFlags)
+{
+    OutputDebugStringW(L"winspool AddPrinterDriverExW stub called\n");
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+DWORD
+WINAPI
+DeletePrinterDataExA(HANDLE hPrinter,
+                     LPCSTR pKeyName,
+                     LPCSTR pValueName)
+{
+    OutputDebugStringW(L"winspool DeletePrinterDataExA stub called\n");
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+DWORD
+WINAPI
+DeletePrinterDataExW(HANDLE hPrinter,
+                     LPCWSTR pKeyName,
+                     LPCWSTR pValueName)
+{
+    OutputDebugStringW(L"winspool DeletePrinterDataExW stub called\n");
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+DeletePrinterDriverExA(LPSTR pName,
+                       LPSTR pEnvironment,
+                       LPSTR pDriverName,
+                       DWORD dwDeleteFlag,
+                       DWORD dwVersionFlag)
+{
+    OutputDebugStringW(L"winspool DeletePrinterDriverExA stub called\n");
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+DeletePrinterDriverExW(LPWSTR pName,
+                       LPWSTR pEnvironment,
+                       LPWSTR pDriverName,
+                       DWORD dwDeleteFlag,
+                       DWORD dwVersionFlag)
+{
+    OutputDebugStringW(L"winspool DeletePrinterDriverExW stub called\n");
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+DWORD
+WINAPI
+EnumPrinterDataExA(HANDLE hPrinter,
+                   LPCSTR pKeyName,
+                   LPBYTE pEnumValues,
+                   DWORD cbEnumValues,
+                   LPDWORD pcbEnumValues,
+                   LPDWORD pnEnumValues)
+{
+    OutputDebugStringW(L"winspool EnumPrinterDataExA stub called\n");
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+DWORD
+WINAPI
+EnumPrinterDataExW(HANDLE hPrinter,
+                   LPCWSTR pKeyName,
+                   LPBYTE pEnumValues,
+                   DWORD cbEnumValues,
+                   LPDWORD pcbEnumValues,
+                   LPDWORD pnEnumValues)
+{
+    OutputDebugStringW(L"winspool EnumPrinterDataExW stub called\n");
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+LONG
+WINAPI
+ExtDeviceMode(HWND hWnd,
+              HANDLE hInst,
+              LPDEVMODEA pDevModeOutput,
+              LPSTR pDeviceName,
+              LPSTR pPort,
+              LPDEVMODEA pDevModeInput,
+              LPSTR pProfile,
+              DWORD fMode)
+{
+    OutputDebugStringW(L"winspool ExtDeviceMode stub called\n");
+    return -1;
+}
+
+/*
+ * @unimplemented
+ */
+DWORD
+WINAPI
+GetPrinterDataExA(HANDLE hPrinter,
+                  LPCSTR pKeyName,
+                  LPCSTR pValueName,
+                  LPDWORD pType,
+                  LPBYTE pData,
+                  DWORD nSize,
+                  LPDWORD pcbNeeded)
+{
+    OutputDebugStringW(L"winspool GetPrinterDataExA stub called\n");
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+DWORD
+WINAPI
+GetPrinterDataExW(HANDLE hPrinter,
+                  LPCWSTR pKeyName,
+                  LPCWSTR pValueName,
+                  LPDWORD pType,
+                  LPBYTE pData,
+                  DWORD nSize,
+                  LPDWORD pcbNeeded)
+{
+    OutputDebugStringW(L"winspool GetPrinterDataExW stub called\n");
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+DWORD
+WINAPI
+SetPrinterDataExA(HANDLE hPrinter,
+                  LPCSTR pKeyName,
+                  LPCSTR pValueName,
+                  DWORD dwType,
+                  LPBYTE pData,
+                  DWORD cbData)
+{
+    OutputDebugStringW(L"winspool SetPrinterDataExA stub called\n");
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+DWORD
+WINAPI
+SetPrinterDataExW(HANDLE hPrinter,
+                  LPCWSTR pKeyName,
+                  LPCWSTR pValueName,
+                  DWORD dwType,
+                  LPBYTE pData,
+                  DWORD cbData)
+{
+    OutputDebugStringW(L"winspool SetPrinterDataExW stub called\n");
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+SpoolerInit(VOID)
+{
+    OutputDebugStringW(L"winspool SpoolerInit stub called\n");
+    return FALSE;
+}
index b681ded..e3e338b 100644 (file)
- 100 stub -noname EnumPrinterPropertySheets
- 101 stub -noname ClusterSplOpen
- 102 stub -noname ClusterSplClose
- 103 stub -noname ClusterSplIsAlive
- 104 stub PerfClose
- 105 stub PerfCollect
- 106 stub PerfOpen
- 201 stdcall GetDefaultPrinterA(ptr ptr)
- 202 stub SetDefaultPrinterA
- 203 stdcall GetDefaultPrinterW(ptr ptr)
- 204 stub SetDefaultPrinterW
- 205 stub -noname SplReadPrinter
- 206 stub -noname AddPerMachineConnectionA
- 207 stub -noname AddPerMachineConnectionW
- 208 stub -noname DeletePerMachineConnectionA
- 209 stub -noname DeletePerMachineConnectionW
- 210 stub -noname EnumPerMachineConnectionsA
- 211 stub -noname EnumPerMachineConnectionsW
- 212 stub -noname LoadPrinterDriver
- 213 stub -noname RefCntLoadDriver
- 214 stub -noname RefCntUnloadDriver
- 215 stub -noname ForceUnloadDriver
- 216 stub -noname PublishPrinterA
- 217 stub -noname PublishPrinterW
- 218 stub -noname CallCommonPropertySheetUI
- 219 stub -noname PrintUIQueueCreate
- 220 stub -noname PrintUIPrinterPropPages
- 221 stub -noname PrintUIDocumentDefaults
- 222 stub -noname SendRecvBidiData
- 223 stub -noname RouterFreeBidiResponseContainer
- 224 stub -noname ExternalConnectToLd64In32Server
- 226 stub -noname PrintUIWebPnpEntry
- 227 stub -noname PrintUIWebPnpPostEntry
- 228 stub -noname PrintUICreateInstance
- 229 stub -noname PrintUIDocumentPropertiesWrap
- 230 stub -noname PrintUIPrinterSetup
- 231 stub -noname PrintUIServerPropPages
- 232 stub -noname AddDriverCatalog
-
- @ stub ADVANCEDSETUPDIALOG
- @ stdcall AbortPrinter(long)
- @ stdcall AddFormA(long long ptr)
- @ stdcall AddFormW(long long ptr)
- @ stdcall AddJobA(long long ptr long ptr)
- @ stdcall AddJobW(long long ptr long ptr)
- @ stdcall AddMonitorA(str long ptr)
- @ stdcall AddMonitorW(wstr long ptr)
- @ stdcall AddPortA(str ptr str)
- @ stub AddPortExA
- @ stub AddPortExW
- @ stdcall AddPortW(wstr long wstr)
- @ stdcall AddPrintProcessorA(str str str str)
- @ stdcall AddPrintProcessorW(wstr wstr wstr wstr)
- @ stdcall AddPrintProvidorA(str long ptr)
- @ stdcall AddPrintProvidorW(wstr long ptr)
- @ stdcall AddPrinterA(str long ptr)
- @ stdcall AddPrinterConnectionA(str)
- @ stdcall AddPrinterConnectionW(wstr)
- @ stdcall AddPrinterDriverA(str long ptr)
- @ stub AddPrinterDriverExA
- @ stub AddPrinterDriverExW
- @ stdcall AddPrinterDriverW(wstr long ptr)
- @ stdcall AddPrinterW(wstr long ptr)
- @ stdcall AdvancedDocumentPropertiesA(long long str ptr ptr)
- @ stdcall AdvancedDocumentPropertiesW(long long wstr ptr ptr)
- @ stub AdvancedSetupDialog
- @ stdcall ClosePrinter(long)
- @ stdcall ConfigurePortA(str long str)
- @ stdcall ConfigurePortW(wstr long wstr)
- @ stdcall ConnectToPrinterDlg(long long)
- @ stub ConvertAnsiDevModeToUnicodeDevMode
- @ stub ConvertUnicodeDevModeToAnsiDevMode
- @ stub CreatePrinterIC
- @ stub DEVICECAPABILITIES
- @ stub DEVICEMODE
- @ stdcall DeleteFormA(long str)
- @ stdcall DeleteFormW(long wstr)
- @ stdcall DeleteMonitorA(str str str)
- @ stdcall DeleteMonitorW(wstr wstr wstr)
- @ stdcall DeletePortA(str long str)
- @ stdcall DeletePortW(wstr long wstr)
- @ stdcall DeletePrintProcessorA(str str str)
- @ stdcall DeletePrintProcessorW(wstr wstr wstr)
- @ stdcall DeletePrintProvidorA(str str str)
- @ stdcall DeletePrintProvidorW(wstr wstr wstr)
- @ stdcall DeletePrinter(long)
- @ stdcall DeletePrinterConnectionA(str)
- @ stdcall DeletePrinterConnectionW(wstr)
- @ stub DeletePrinterDataExA
- @ stub DeletePrinterDataExW
- @ stdcall DeletePrinterDriverA(str str str)
- @ stub DeletePrinterDriverExA
- @ stub DeletePrinterDriverExW
- @ stdcall DeletePrinterDriverW(wstr wstr wstr)
- @ stub DeletePrinterIC
- @ stub DevQueryPrint
- @ stdcall DeviceCapabilities(str str long ptr ptr) DeviceCapabilitiesA
- @ stdcall DeviceCapabilitiesA(str str long ptr ptr)
- @ stdcall DeviceCapabilitiesW(wstr wstr long wstr ptr)
- @ stub DeviceMode
- @ stub DocumentEvent
- @ stdcall DocumentPropertiesA(long long ptr ptr ptr long)
- @ stdcall DocumentPropertiesW(long long ptr ptr ptr long)
- @ stub EXTDEVICEMODE
- @ stdcall EndDocPrinter(long)
- @ stdcall EndPagePrinter(long)
- @ stdcall EnumFormsA(long long ptr long ptr ptr)
- @ stdcall EnumFormsW(long long ptr long ptr ptr)
- @ stdcall EnumJobsA(long long long long ptr long ptr ptr)
- @ stdcall EnumJobsW(long long long long ptr long ptr ptr)
- @ stdcall EnumMonitorsA(str long ptr long long long)
- @ stdcall EnumMonitorsW(wstr long ptr long long long)
- @ stdcall EnumPortsA(str long ptr ptr ptr ptr)
- @ stdcall EnumPortsW(wstr long ptr ptr ptr ptr)
- @ stdcall EnumPrintProcessorDatatypesA(str str long ptr long ptr ptr)
- @ stdcall EnumPrintProcessorDatatypesW(wstr wstr long ptr long ptr ptr)
- @ stdcall EnumPrintProcessorsA(str str long ptr long ptr ptr)
- @ stdcall EnumPrintProcessorsW(wstr wstr long ptr long ptr ptr)
- @ stdcall EnumPrinterDataA(long long ptr long ptr ptr ptr long ptr)
- @ stub EnumPrinterDataExA
- @ stub EnumPrinterDataExW
- @ stdcall EnumPrinterDataW(long long ptr long ptr ptr ptr long ptr) 
- @ stdcall EnumPrinterDriversA(str str long ptr long ptr ptr)
- @ stdcall EnumPrinterDriversW(wstr wstr long ptr long ptr ptr)
- @ stdcall EnumPrintersA(long ptr long ptr long ptr ptr)
- @ stdcall EnumPrintersW(long ptr long ptr long ptr ptr)
- @ stub ExtDeviceMode
- @ stdcall FindClosePrinterChangeNotification(long)
- @ stdcall FindFirstPrinterChangeNotification(long long long ptr)
- @ stdcall FindNextPrinterChangeNotification(long ptr ptr ptr)
- @ stdcall FreePrinterNotifyInfo(ptr)
- @ stdcall GetFormA(long str long ptr long ptr)
- @ stdcall GetFormW(long wstr long ptr long ptr)
- @ stdcall GetJobA(long long long ptr long ptr)
- @ stdcall GetJobW(long long long ptr long ptr)
- @ stdcall GetPrintProcessorDirectoryA(str str long ptr long ptr)
- @ stdcall GetPrintProcessorDirectoryW(wstr wstr long ptr long ptr)
- @ stdcall GetPrinterA(long long ptr long ptr)
- @ stdcall GetPrinterDataA(long str ptr ptr long ptr)
- @ stub GetPrinterDataExA
- @ stub GetPrinterDataExW
- @ stdcall GetPrinterDataW(long wstr ptr ptr long ptr)
- @ stdcall GetPrinterDriverA(long str long ptr long ptr)
- @ stdcall GetPrinterDriverDirectoryA(str str long ptr long ptr)
- @ stdcall GetPrinterDriverDirectoryW(wstr wstr long ptr long ptr)
- @ stdcall GetPrinterDriverW(long str long ptr long ptr)
- @ stdcall GetPrinterW(long long ptr long ptr)
- @ stdcall OpenPrinterA(str ptr ptr)
- @ stdcall OpenPrinterW(wstr ptr ptr)
- @ stub PlayGdiScriptOnPrinterIC
- @ stub PrinterMessageBoxA
- @ stub PrinterMessageBoxW
- @ stdcall PrinterProperties(long long)
- @ stdcall ReadPrinter(long ptr long ptr)
- @ stdcall ResetPrinterA(long ptr)
- @ stdcall ResetPrinterW(long ptr)
- @ stdcall ScheduleJob(long long)
- @ stub SetAllocFailCount
- @ stdcall SetFormA(long str long ptr)
- @ stdcall SetFormW(long wstr long ptr)
- @ stdcall SetJobA(long long long ptr long)
- @ stdcall SetJobW(long long long ptr long)
- @ stdcall SetPrinterA(long long ptr long)
- @ stdcall SetPrinterDataA(long str long ptr long)
- @ stub SetPrinterDataExA
- @ stub SetPrinterDataExW
- @ stdcall SetPrinterDataW(long wstr long ptr long)
- @ stdcall SetPrinterW(long long ptr long)
- @ stub SpoolerDevQueryPrintW
- @ stub SpoolerInit
- @ stub SpoolerPrinterEvent
- @ stub StartDocDlgA
- @ stub StartDocDlgW
- @ stub StartDocPrinterA
- @ stub StartDocPrinterW
- @ stdcall StartPagePrinter(long)
- @ stub WaitForPrinterChange
- @ stdcall WritePrinter(long ptr long ptr)
- @ stub XcvDataW
+100 stub -noname EnumPrinterPropertySheets
+101 stub -noname ClusterSplOpen
+102 stub -noname ClusterSplClose
+103 stub -noname ClusterSplIsAlive
+104 stub PerfClose
+105 stub PerfCollect
+106 stub PerfOpen
+201 stdcall GetDefaultPrinterA(ptr ptr)
+202 stdcall SetDefaultPrinterA(str)
+203 stdcall GetDefaultPrinterW(ptr ptr)
+204 stdcall SetDefaultPrinterW(wstr)
+205 stub -noname SplReadPrinter
+206 stub -noname AddPerMachineConnectionA
+207 stub -noname AddPerMachineConnectionW
+208 stub -noname DeletePerMachineConnectionA
+209 stub -noname DeletePerMachineConnectionW
+210 stub -noname EnumPerMachineConnectionsA
+211 stub -noname EnumPerMachineConnectionsW
+212 stub -noname LoadPrinterDriver
+213 stub -noname RefCntLoadDriver
+214 stub -noname RefCntUnloadDriver
+215 stub -noname ForceUnloadDriver
+216 stub -noname PublishPrinterA
+217 stub -noname PublishPrinterW
+218 stub -noname CallCommonPropertySheetUI
+219 stub -noname PrintUIQueueCreate
+220 stub -noname PrintUIPrinterPropPages
+221 stub -noname PrintUIDocumentDefaults
+222 stub -noname SendRecvBidiData
+223 stub -noname RouterFreeBidiResponseContainer
+224 stub -noname ExternalConnectToLd64In32Server
+226 stub -noname PrintUIWebPnpEntry
+227 stub -noname PrintUIWebPnpPostEntry
+228 stub -noname PrintUICreateInstance
+229 stub -noname PrintUIDocumentPropertiesWrap
+230 stub -noname PrintUIPrinterSetup
+231 stub -noname PrintUIServerPropPages
+232 stub -noname AddDriverCatalog
 
+@ stub ADVANCEDSETUPDIALOG
+@ stdcall AbortPrinter(long)
+@ stdcall AddFormA(long long ptr)
+@ stdcall AddFormW(long long ptr)
+@ stdcall AddJobA(long long ptr long ptr)
+@ stdcall AddJobW(long long ptr long ptr)
+@ stdcall AddMonitorA(str long ptr)
+@ stdcall AddMonitorW(wstr long ptr)
+@ stdcall AddPortA(str ptr str)
+@ stdcall AddPortExA(str long ptr str)
+@ stdcall AddPortExW(wstr long ptr wstr)
+@ stdcall AddPortW(wstr long wstr)
+@ stdcall AddPrinterA(str long ptr)
+@ stdcall AddPrinterConnectionA(str)
+@ stdcall AddPrinterConnectionW(wstr)
+@ stdcall AddPrinterDriverA(str long ptr)
+@ stdcall AddPrinterDriverExA(str long ptr long)
+@ stdcall AddPrinterDriverExW(wstr long ptr long)
+@ stdcall AddPrinterDriverW(wstr long ptr)
+@ stdcall AddPrinterW(wstr long ptr)
+@ stdcall AddPrintProcessorA(str str str str)
+@ stdcall AddPrintProcessorW(wstr wstr wstr wstr)
+@ stdcall AddPrintProvidorA(str long ptr)
+@ stdcall AddPrintProvidorW(wstr long ptr)
+@ stdcall AdvancedDocumentPropertiesA(long long str ptr ptr)
+@ stdcall AdvancedDocumentPropertiesW(long long wstr ptr ptr)
+@ stub AdvancedSetupDialog
+@ stdcall ClosePrinter(long)
+@ stdcall ConfigurePortA(str long str)
+@ stdcall ConfigurePortW(wstr long wstr)
+@ stdcall ConnectToPrinterDlg(long long)
+@ stub ConvertAnsiDevModeToUnicodeDevMode
+@ stub ConvertUnicodeDevModeToAnsiDevMode
+@ stub CreatePrinterIC
+@ stub DEVICECAPABILITIES
+@ stub DEVICEMODE
+@ stdcall DeleteFormA(long str)
+@ stdcall DeleteFormW(long wstr)
+@ stdcall DeleteMonitorA(str str str)
+@ stdcall DeleteMonitorW(wstr wstr wstr)
+@ stdcall DeletePortA(str long str)
+@ stdcall DeletePortW(wstr long wstr)
+@ stdcall DeletePrinter(long)
+@ stdcall DeletePrinterConnectionA(str)
+@ stdcall DeletePrinterConnectionW(wstr)
+@ stdcall DeletePrinterDataExA(long str str)
+@ stdcall DeletePrinterDataExW(long wstr wstr)
+@ stdcall DeletePrinterDataA(ptr str)
+@ stdcall DeletePrinterDataW(ptr wstr)
+@ stdcall DeletePrinterDriverA(str str str)
+@ stdcall DeletePrinterDriverExA(str str str long long)
+@ stdcall DeletePrinterDriverExW(wstr wstr wstr long long)
+@ stdcall DeletePrinterDriverW(wstr wstr wstr)
+@ stub DeletePrinterIC
+@ stub DevQueryPrint
+@ stdcall DeletePrintProcessorA(str str str)
+@ stdcall DeletePrintProcessorW(wstr wstr wstr)
+@ stdcall DeletePrintProvidorA(str str str)
+@ stdcall DeletePrintProvidorW(wstr wstr wstr)
+@ stdcall DeviceCapabilitiesA(str str long ptr ptr)
+@ stdcall DeviceCapabilitiesW(wstr wstr long ptr ptr)
+@ stub DeviceMode
+@ stub DocumentEvent
+@ stdcall DllMain(ptr long ptr)
+@ stdcall DocumentPropertiesA(long long ptr ptr ptr long)
+@ stdcall DocumentPropertiesW(long long ptr ptr ptr long)
+@ stub EXTDEVICEMODE
+@ stdcall EndDocPrinter(long)
+@ stdcall EndPagePrinter(long)
+@ stdcall EnumFormsA(long long ptr long ptr ptr)
+@ stdcall EnumFormsW(long long ptr long ptr ptr)
+@ stdcall EnumJobsA(long long long long ptr long ptr ptr)
+@ stdcall EnumJobsW(long long long long ptr long ptr ptr)
+@ stdcall EnumMonitorsA(str long ptr long long long)
+@ stdcall EnumMonitorsW(wstr long ptr long long long)
+@ stdcall EnumPortsA(str long ptr ptr ptr ptr)
+@ stdcall EnumPortsW(wstr long ptr ptr ptr ptr)
+@ stdcall EnumPrinterDataA(long long ptr long ptr ptr ptr long ptr)
+@ stdcall EnumPrinterDataExA(long str ptr long ptr ptr)
+@ stdcall EnumPrinterDataExW(long wstr ptr long ptr ptr)
+@ stdcall EnumPrinterDataW(long long ptr long ptr ptr ptr long ptr)
+@ stdcall EnumPrinterDriversA(str str long ptr long ptr ptr)
+@ stdcall EnumPrinterDriversW(wstr wstr long ptr long ptr ptr)
+@ stdcall EnumPrintersA(long ptr long ptr long ptr ptr)
+@ stdcall EnumPrintersW(long ptr long ptr long ptr ptr)
+@ stdcall ExtDeviceMode(long long ptr str str ptr str long)
+@ stdcall EnumPrintProcessorDatatypesA(str str long ptr long ptr ptr)
+@ stdcall EnumPrintProcessorDatatypesW(wstr wstr long ptr long ptr ptr)
+@ stdcall EnumPrintProcessorsA(str str long ptr long ptr ptr)
+@ stdcall EnumPrintProcessorsW(wstr wstr long ptr long ptr ptr)
+@ stdcall FindClosePrinterChangeNotification(long)
+@ stdcall FindFirstPrinterChangeNotification(long long long ptr)
+@ stdcall FindNextPrinterChangeNotification(long ptr ptr ptr)
+@ stdcall FreePrinterNotifyInfo(ptr)
+@ stdcall GetFormA(long str long ptr long ptr)
+@ stdcall GetFormW(long wstr long ptr long ptr)
+@ stdcall GetJobA(long long long ptr long ptr)
+@ stdcall GetJobW(long long long ptr long ptr)
+@ stdcall GetPrinterA(long long ptr long ptr)
+@ stdcall GetPrinterDataA(long str ptr ptr long ptr)
+@ stdcall GetPrinterDataExA(long str str ptr ptr long ptr)
+@ stdcall GetPrinterDataExW(long wstr wstr ptr ptr long ptr)
+@ stdcall GetPrinterDataW(long wstr ptr ptr long ptr)
+@ stdcall GetPrinterDriverA(long str long ptr long ptr)
+@ stdcall GetPrinterDriverDirectoryA(str str long ptr long ptr)
+@ stdcall GetPrinterDriverDirectoryW(wstr wstr long ptr long ptr)
+@ stdcall GetPrinterDriverW(long str long ptr long ptr)
+@ stdcall GetPrinterW(long long ptr long ptr)
+@ stdcall GetPrintProcessorDirectoryA(str str long ptr long ptr)
+@ stdcall GetPrintProcessorDirectoryW(wstr wstr long ptr long ptr)
+@ stdcall OpenPrinterA(str ptr ptr)
+@ stdcall OpenPrinterW(wstr ptr ptr)
+@ stub PlayGdiScriptOnPrinterIC
+@ stdcall PrinterMessageBoxA(ptr long ptr str str long)
+@ stdcall PrinterMessageBoxW(ptr long ptr wstr wstr long)
+@ stdcall PrinterProperties(long long)
+@ stdcall ReadPrinter(long ptr long ptr)
+@ stdcall ResetPrinterA(long ptr)
+@ stdcall ResetPrinterW(long ptr)
+@ stdcall ScheduleJob(long long)
+@ stub SetAllocFailCount
+@ stdcall SetFormA(long str long ptr)
+@ stdcall SetFormW(long wstr long ptr)
+@ stdcall SetJobA(long long long ptr long)
+@ stdcall SetJobW(long long long ptr long)
+@ stdcall SetPrinterA(long long ptr long)
+@ stdcall SetPrinterDataA(long str long ptr long)
+@ stdcall SetPrinterDataExA(long str str long ptr long)
+@ stdcall SetPrinterDataExW(long wstr wstr long ptr long)
+@ stdcall SetPrinterDataW(long wstr long ptr long)
+@ stdcall SetPrinterW(long long ptr long)
+@ stub SpoolerDevQueryPrintW
+@ stdcall SpoolerInit()
+@ stub SpoolerPrinterEvent
+@ stdcall StartDocPrinterA(long long ptr)
+@ stdcall StartDocPrinterW(long long ptr)
+@ stdcall StartPagePrinter(long)
+@ stdcall WaitForPrinterChange(ptr long)
+@ stdcall WritePrinter(long ptr long ptr)
+@ stdcall XcvDataW(long wstr ptr long ptr long ptr ptr)
index c5c5c4b..defc10e 100644 (file)
@@ -2913,7 +2913,7 @@ CdRomDeviceControlCompletion(
                                             srb,
                                             irpStack->MajorFunction,
                                             irpStack->Parameters.DeviceIoControl.IoControlCode,
-                                                                                       MAXIMUM_RETRIES - ((ULONG_PTR)realIrpNextStack->Parameters.Others.Argument1),
+                                            MAXIMUM_RETRIES - ((ULONG_PTR)realIrpNextStack->Parameters.Others.Argument1),
                                             &status);
 
         DebugPrint((2, "CdRomDeviceControlCompletion: IRP will %sbe retried\n",
@@ -2974,6 +2974,7 @@ CdRomDeviceControlCompletion(
 
         if (retry && (realIrpNextStack->Parameters.Others.Argument1 = (PVOID)((ULONG_PTR)realIrpNextStack->Parameters.Others.Argument1-1))) {
 
+
             if (((ULONG_PTR)realIrpNextStack->Parameters.Others.Argument1)) {
 
                 //
@@ -5882,7 +5883,7 @@ Return Value:
             // Decrement the countdown timer and put the IRP back in the list.
             //
 
-            count = (ULONG_PTR)irpStack->Parameters.Others.Argument3;
+            count = (ULONG_PTR) irpStack->Parameters.Others.Argument3;
             count--;
             irpStack->Parameters.Others.Argument3 = (PVOID) count;
 
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/Miniport.cpp b/reactos/drivers/wdm/audio/backpln/portcls/Miniport.cpp
deleted file mode 100644 (file)
index 26769c6..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-    ReactOS Operating System
-
-    Port Class API
-    IMiniPortMidi Implementation
-
-    by Andrew Greenwood
-
-    REFERENCE:
-        http://www.osronline.com/ddkx/stream/audmp-routines_64vn.htm
-*/
-
-#include "private.h"
-#include <portcls.h>
-
-NTSTATUS
-IMiniport::GetDescription(
-    OUT PPCFILTER_DESCRIPTOR* Description)
-{
-    return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-IMiniport::DataRangeIntersection(
-    IN  ULONG PinId,
-    IN  PKSDATARANGE DataRange,
-    IN  PKSDATARANGE MatchingDataRange,
-    IN  ULONG OutputBufferLength,
-    OUT PVOID ResultantFormat OPTIONAL,
-    OUT PULONG ResultantFormatLength)
-{
-    return STATUS_UNSUCCESSFUL;
-}
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp b/reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/MiniportMidi.cpp b/reactos/drivers/wdm/audio/backpln/portcls/MiniportMidi.cpp
deleted file mode 100644 (file)
index 16e688a..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-    ReactOS Operating System
-
-    Port Class API
-    IMiniPortMidi Implementation
-
-    by Andrew Greenwood
-
-    REFERENCE:
-        http://www.osronline.com/ddkx/stream/audmp-routines_1fsj.htm
-*/
-#include "private.h"
-#include <portcls.h>
-
-NTSTATUS
-IMiniportMidi::Init(
-    IN  PUNKNOWN UnknownAdapter,
-    IN  PRESOURCELIST ResourceList,
-    IN  PPORTMIDI Port,
-    OUT PSERVICEGROUP* ServiceGroup)
-{
-    /* http://www.osronline.com/ddkx/stream/audmp-routines_6jsj.htm */
-
-    return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-IMiniportMidi::NewStream(
-    OUT PMINIPORTMIDISTREAM Stream,
-    IN  PUNKNOWN OuterUnknown OPTIONAL,
-    IN  POOL_TYPE PoolType,
-    IN  ULONG Pin,
-    IN  BOOLEAN Capture,
-    IN  PKSDATAFORMAT DataFormat,
-    OUT PSERVICEGROUP* ServiceGroup)
-{
-    return STATUS_UNSUCCESSFUL;
-}
-
-void
-IMiniportMidi::Service(void)
-{
-}
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp b/reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp b/reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/Port.cpp b/reactos/drivers/wdm/audio/backpln/portcls/Port.cpp
deleted file mode 100644 (file)
index 8b8125f..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-    ReactOS Operating System
-    Port Class API / IPort Implementation
-
-    by Andrew Greenwood
-
-    REFERENCE:
-        http://www.osronline.com/ddkx/stream/audmp-routines_0tgz.htm
-
-    NOTE: I'm not sure if this file is even needed...
-*/
-
-#if 0
-#include "../private.h"
-#include <stdunk.h>
-#include <portcls.h>
-
-NTSTATUS
-IPort::GetDeviceProperty(
-    IN  DEVICE_REGISTRY_PROPERTY DeviceRegistryProperty,
-    IN  ULONG BufferLength,
-    OUT PVOID PropertyBuffer,
-    OUT PULONG ReturnLength)
-{
-    /* http://www.osronline.com/ddkx/stream/audmp-routines_93xv.htm */
-    return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-IPort::Init(
-    IN  PDEVICE_OBJECT DeviceObject,
-    IN  PIRP Irp,
-    IN  PUNKNOWN UnknownMiniport,
-    IN  PUNKNOWN UnknownAdapter OPTIONAL,
-    IN  PRESOURCELIST ResourceList)
-{
-    /* http://www.osronline.com/ddkx/stream/audmp-routines_7qcz.htm */
-    return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-IPort::NewRegistryKey(
-    OUT PREGISTRYKEY* OutRegistryKey,
-    IN  PUNKNOWN OuterUnknown OPTIONAL,
-    IN  ULONG RegistryKeyType,
-    IN  ACCESS_MASK DesiredAccess,
-    IN  POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
-    IN  ULONG CreateOptions OPTIONAL,
-    OUT PULONG Disposition OPTIONAL)
-{
-    /* http://www.osronline.com/ddkx/stream/audmp-routines_2jhv.htm */
-    return STATUS_UNSUCCESSFUL;
-}
-
-#endif
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp b/reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/PortMidi.cpp b/reactos/drivers/wdm/audio/backpln/portcls/PortMidi.cpp
deleted file mode 100644 (file)
index 6690434..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-    ReactOS Operating System
-    Port Class API / IPortMidi Implementation
-
-    by Andrew Greenwood
-
-    REFERENCE:
-        http://www.osronline.com/ddkx/stream/audmp-routines_49pv.htm
-
-    NOTES:
-        IPortMidi inherits from IPort. This file contains specific
-        extensions.
-*/
-#include "private.h"
-#include <stdunk.h>
-#include <portcls.h>
-#include "port.h"
-
-
-#if 0
-
-/*
-    IPort Methods
-*/
-
-NTSTATUS
-CPortMidi::GetDeviceProperty(
-    IN  DEVICE_REGISTRY_PROPERTY DeviceRegistryProperty,
-    IN  ULONG BufferLength,
-    OUT PVOID PropertyBuffer,
-    OUT PULONG ReturnLength)
-{
-    /* http://www.osronline.com/ddkx/stream/audmp-routines_93xv.htm */
-    return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-CPortMidi::Init(
-    IN  PDEVICE_OBJECT DeviceObject,
-    IN  PIRP Irp,
-    IN  PUNKNOWN UnknownMiniport,
-    IN  PUNKNOWN UnknownAdapter OPTIONAL,
-    IN  PRESOURCELIST ResourceList)
-{
-    /* http://www.osronline.com/ddkx/stream/audmp-routines_7qcz.htm */
-    return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-CPortMidi::NewRegistryKey(
-    OUT PREGISTRYKEY* OutRegistryKey,
-    IN  PUNKNOWN OuterUnknown OPTIONAL,
-    IN  ULONG RegistryKeyType,
-    IN  ACCESS_MASK DesiredAccess,
-    IN  POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
-    IN  ULONG CreateOptions OPTIONAL,
-    OUT PULONG Disposition OPTIONAL)
-{
-    /* http://www.osronline.com/ddkx/stream/audmp-routines_2jhv.htm */
-    return STATUS_UNSUCCESSFUL;
-}
-
-/*
-    IPortMidi Methods
-*/
-
-VOID
-CPortMidi::Notify(IN PSERVICEGROUP ServiceGroup OPTIONAL)
-{
-}
-
-NTSTATUS
-CPortMidi::RegisterServiceGroup(IN PSERVICEGROUP ServiceGroup)
-{
-    return STATUS_UNSUCCESSFUL;
-}
-
-#endif
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/PortTopology.cpp b/reactos/drivers/wdm/audio/backpln/portcls/PortTopology.cpp
deleted file mode 100644 (file)
index c84c064..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
-    Inherits from IPort only
-*/
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/PortWaveCyclic.cpp b/reactos/drivers/wdm/audio/backpln/portcls/PortWaveCyclic.cpp
deleted file mode 100644 (file)
index a89ee8b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-    ReactOS Operating System
-    Port Class API / IPort Implementation
-
-    by Andrew Greenwood
-*/
-
-#include "private.h"
-
-NTSTATUS
-IPortWaveCyclic::NewMasterDmaChannel(
-    OUT PDMACHANNEL* DmaChannel,
-    IN  PUNKNOWN OuterUnknown,
-    IN  PRESOURCELIST ResourceList OPTIONAL,
-    IN  ULONG MaximumLength,
-    IN  BOOL Dma32BitAddresses,
-    IN  BOOL Dma64BitAddresses,
-    IN  DMA_WIDTH DmaWidth,
-    IN  DMA_SPEED DmaSpeed)
-{
-    return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-IPortWaveCyclic::NewSlaveDmaChannel(
-    OUT PDMACHANNELSLAVE* DmaChannel,
-    IN  PUNKNOWN OuterUnknown,
-    IN  PRESOURCELIST ResourceList OPTIONAL,
-    IN  ULONG DmaIndex,
-    IN  ULONG MaximumLength,
-    IN  BOOL DemandMode,
-    IN  DMA_SPEED DmaSpeed)
-{
-    return STATUS_UNSUCCESSFUL;
-}
-
-VOID
-IPortWaveCyclic::Notify(
-    IN  PSERVICEGROUP ServiceGroup)
-{
-}
index e05883e..2a6a752 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include "private.h"
-
+#include <initguid.h>
 /*
     This is called from DriverEntry so that PortCls can take care of some
     IRPs and map some others to the main KS driver. In most cases this will
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/api.c b/reactos/drivers/wdm/audio/backpln/portcls/api.c
new file mode 100644 (file)
index 0000000..4ec0c12
--- /dev/null
@@ -0,0 +1,32 @@
+#include "private.h"
+
+/*
+ * @implemented
+ */
+NTSTATUS
+NTAPI
+PcGetDeviceProperty(
+    IN  PVOID DeviceObject,
+    IN  DEVICE_REGISTRY_PROPERTY DeviceProperty,
+    IN  ULONG BufferLength,
+    OUT PVOID PropertyBuffer,
+    OUT PULONG ResultLength)
+{
+    return IoGetDeviceProperty(DeviceObject, DeviceProperty, BufferLength, PropertyBuffer, ResultLength);
+}
+
+/*
+ * @implemented
+ */
+ULONGLONG
+NTAPI
+PcGetTimeInterval(
+    IN  ULONGLONG Since)
+{
+    LARGE_INTEGER CurrentTime;
+
+    KeQuerySystemTime(&CurrentTime);
+
+    return (CurrentTime.QuadPart - Since);
+}
+
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/dma_master.c b/reactos/drivers/wdm/audio/backpln/portcls/dma_master.c
new file mode 100644 (file)
index 0000000..d5afad2
--- /dev/null
@@ -0,0 +1,198 @@
+#include "private.h"
+
+
+typedef struct
+{
+    IDmaChannelSlaveVtbl *lpVtbl;
+
+    LONG ref;
+    ULONG BufferSize;
+    PHYSICAL_ADDRESS Address;
+
+}IDmaChannelImpl;
+
+
+/*
+    Basic IUnknown methods
+*/
+
+       NTSTATUS
+       STDMETHODCALLTYPE
+       IDmaChannel_fnQueryInterface(
+               IDmaChannel* iface,
+               IN  REFIID refiid,
+               OUT PVOID* Output)
+       {
+               /* TODO */
+               return STATUS_UNSUCCESSFUL;
+       }
+
+ULONG
+STDMETHODCALLTYPE
+IDmaChannel_fnAddRef(
+    IDmaChannel* iface)
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_AddRef: This %p\n", This);
+
+    return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+STDMETHODCALLTYPE
+IDmaChannel_fnRelease(
+    IDmaChannel* iface)
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    _InterlockedDecrement(&This->ref);
+
+    DPRINT("IDmaChannel_Release: This %p new ref %u\n", This, This->ref);
+
+    if (This->ref == 0)
+    {
+        ExFreePoolWithTag(This, TAG_PORTCLASS);
+        return 0;
+    }
+    /* Return new reference count */
+    return This->ref;
+}
+
+
+
+NTSTATUS
+NTAPI
+IDmaChannel_fnAllocateBuffer(
+    IN IDmaChannel * iface,
+    IN ULONG BufferSize,
+    IN PPHYSICAL_ADDRESS  PhysicalAddressConstraint  OPTIONAL)
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_AllocateBuffer: This %p BufferSize %u\n", This, BufferSize);
+
+    /* Did the caller already allocate a buffer ?*/
+    if (This->BufferSize) return STATUS_UNSUCCESSFUL;
+
+    /* FIXME */
+    //This->BufferSize = BufferSize;
+
+    return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+NTAPI
+IDmaChannel_fnAllocatedBufferSize(
+    IN IDmaChannel * iface)
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_AllocatedBufferSize: This %p BufferSize %u\n", This, This->BufferSize);
+    return This->BufferSize;
+}
+
+VOID
+NTAPI
+IDmaChannel_fnCopyFrom(
+    IN IDmaChannel * iface,
+    IN PVOID  Destination,
+    IN PVOID  Source,
+    IN ULONG  ByteCount
+    )
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_CopyFrom: This %p Destination %p Source %p ByteCount %u\n", This, Destination, Source, ByteCount);
+}
+
+VOID
+NTAPI
+IDmaChannel_fnCopyTo(
+    IN IDmaChannel * iface,
+    IN PVOID  Destination,
+    IN PVOID  Source,
+    IN ULONG  ByteCount
+    )
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_CopyTo: This %p Destination %p Source %p ByteCount %u\n", This, Destination, Source, ByteCount);
+}
+
+VOID
+NTAPI
+IDmaChannel_fnFreeBuffer(
+    IN IDmaChannel * iface)
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_FreeBuffer: This %p\n", This);
+}
+
+PADAPTER_OBJECT
+NTAPI
+IDmaChannel_fnGetAdapterObject(
+    IN IDmaChannel * iface)
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_GetAdapterObject: This %p\n", This);
+    return NULL;
+}
+
+ULONG
+NTAPI
+IDmaChannel_fnMaximumBufferSize(
+    IN IDmaChannel * iface)
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_MaximumBufferSize: This %p\n", This);
+    return 0;
+}
+
+PHYSICAL_ADDRESS
+NTAPI
+IDmaChannel_fnPhysicalAdress(
+    IN IDmaChannel * iface)
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_PhysicalAdress: This %p\n", This);
+    return This->Address;
+}
+
+VOID
+NTAPI
+IDmaChannel_fnSetBufferSize(
+    IN IDmaChannel * iface,
+    IN ULONG BufferSize)
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_SetBufferSize: This %p\n", This);
+
+}
+
+PVOID
+NTAPI
+IDmaChannel_fnSystemAddress(
+    IN IDmaChannel * iface)
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_SystemAddress: This %p\n", This);
+    return NULL;
+}
+
+ULONG
+NTAPI
+IDmaChannel_fnTransferCount(
+    IN IDmaChannel * iface)
+{
+    IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+    DPRINT("IDmaChannel_TransferCount: This %p\n", This);
+    return 0;
+}
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c b/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c
new file mode 100644 (file)
index 0000000..51cb5a2
--- /dev/null
@@ -0,0 +1,287 @@
+#include "private.h"
+
+
+typedef struct
+{
+    IDmaChannelSlaveVtbl *lpVtbl;
+
+    LONG ref;
+
+    ULONG BufferSize;
+    PHYSICAL_ADDRESS Address;
+
+}IDmaChannelSlaveImpl;
+
+
+//---------------------------------------------------------------
+// IUnknown methods
+//
+
+
+NTSTATUS
+NTAPI
+IDmaChannelSlave_fnQueryInterface(
+    IDmaChannelSlave * iface,
+    IN  REFIID refiid,
+    OUT PVOID* Output)
+{
+    /* TODO */
+    return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+STDMETHODCALLTYPE
+IDmaChannelSlave_fnAddRef(
+    IDmaChannelSlave * iface)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_AddRef: This %p\n", This);
+
+    return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+STDMETHODCALLTYPE
+IDmaChannelSlave_fnRelease(
+    IDmaChannelSlave* iface)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    _InterlockedDecrement(&This->ref);
+
+    DPRINT("IDmaChannelSlave_Release: This %p new ref %u\n", This, This->ref);
+
+    if (This->ref == 0)
+    {
+        ExFreePoolWithTag(This, TAG_PORTCLASS);
+        return 0;
+    }
+    /* Return new reference count */
+    return This->ref;
+}
+
+//---------------------------------------------------------------
+// IDmaChannel methods
+//
+
+
+NTSTATUS
+NTAPI
+IDmaChannelSlave_fnAllocateBuffer(
+    IN IDmaChannelSlave * iface,
+    IN ULONG BufferSize,
+    IN PPHYSICAL_ADDRESS  PhysicalAddressConstraint  OPTIONAL)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_AllocateBuffer: This %p BufferSize %u\n", This, BufferSize);
+
+    /* Did the caller already allocate a buffer ?*/
+    if (This->BufferSize) return STATUS_UNSUCCESSFUL;
+
+    /* FIXME */
+    //This->BufferSize = BufferSize;
+
+    return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+NTAPI
+IDmaChannelSlave_fnAllocatedBufferSize(
+    IN IDmaChannelSlave * iface)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_AllocatedBufferSize: This %p BufferSize %u\n", This, This->BufferSize);
+    return This->BufferSize;
+}
+
+VOID
+NTAPI
+IDmaChannelSlave_fnCopyFrom(
+    IN IDmaChannelSlave * iface,
+    IN PVOID  Destination,
+    IN PVOID  Source,
+    IN ULONG  ByteCount
+    )
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_CopyFrom: This %p Destination %p Source %p ByteCount %u\n", This, Destination, Source, ByteCount);
+}
+
+VOID
+NTAPI
+IDmaChannelSlave_fnCopyTo(
+    IN IDmaChannelSlave * iface,
+    IN PVOID  Destination,
+    IN PVOID  Source,
+    IN ULONG  ByteCount
+    )
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_CopyTo: This %p Destination %p Source %p ByteCount %u\n", This, Destination, Source, ByteCount);
+}
+
+VOID
+NTAPI
+IDmaChannelSlave_fnFreeBuffer(
+    IN IDmaChannelSlave * iface)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_FreeBuffer: This %p\n", This);
+}
+
+PADAPTER_OBJECT
+NTAPI
+IDmaChannelSlave_fnGetAdapterObject(
+    IN IDmaChannelSlave * iface)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_GetAdapterObject: This %p\n", This);
+    return NULL;
+}
+
+ULONG
+NTAPI
+IDmaChannelSlave_fnMaximumBufferSize(
+    IN IDmaChannelSlave * iface)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_MaximumBufferSize: This %p\n", This);
+    return 0;
+}
+
+PHYSICAL_ADDRESS
+NTAPI
+IDmaChannelSlave_fnPhysicalAdress(
+    IN IDmaChannelSlave * iface)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_PhysicalAdress: This %p\n", This);
+    return This->Address;
+}
+
+VOID
+NTAPI
+IDmaChannelSlave_fnSetBufferSize(
+    IN IDmaChannelSlave * iface,
+    IN ULONG BufferSize)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_SetBufferSize: This %p\n", This);
+
+}
+
+ULONG
+NTAPI
+IDmaChannelSlave_fnBufferSize(
+    IN IDmaChannelSlave * iface)
+{
+    return 0;
+}
+
+
+PVOID
+NTAPI
+IDmaChannelSlave_fnSystemAddress(
+    IN IDmaChannelSlave * iface)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_SystemAddress: This %p\n", This);
+    return NULL;
+}
+
+ULONG
+NTAPI
+IDmaChannelSlave_fnTransferCount(
+    IN IDmaChannelSlave * iface)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_TransferCount: This %p\n", This);
+    return 0;
+}
+
+ULONG
+NTAPI
+IDmaChannelSlave_fnReadCounter(
+    IN IDmaChannelSlave * iface)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_ReadCounter: This %p\n", This);
+    return 0;
+}
+
+NTSTATUS
+NTAPI
+IDmaChannelSlave_fnStart(
+    IN IDmaChannelSlave * iface,
+    ULONG  MapSize,
+    BOOLEAN WriteToDevice)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_Start: This %p\n", This);
+    return 0;
+}
+
+NTSTATUS
+NTAPI
+IDmaChannelSlave_fnStop(
+    IN IDmaChannelSlave * iface)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_fnStop: This %p\n", This);
+    return 0;
+}
+
+NTSTATUS
+NTAPI
+IDmaChannelSlave_fnWaitForTC(
+    IN IDmaChannelSlave * iface,
+    ULONG  Timeout)
+{
+    IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+    DPRINT("IDmaChannelSlave_WaitForTC: This %p\n", This);
+    return 0;
+
+}
+
+static IDmaChannelSlaveVtbl vt_IDmaChannelSlaveVtbl =
+{
+    /* IUnknown methods */
+    IDmaChannelSlave_fnQueryInterface,
+    IDmaChannelSlave_fnAddRef,
+    IDmaChannelSlave_fnRelease,
+    /* IDmaChannel methods */
+    IDmaChannelSlave_fnAllocateBuffer,
+    IDmaChannelSlave_fnFreeBuffer,
+    IDmaChannelSlave_fnTransferCount,
+    IDmaChannelSlave_fnMaximumBufferSize,
+    IDmaChannelSlave_fnAllocatedBufferSize,
+    IDmaChannelSlave_fnBufferSize,
+    IDmaChannelSlave_fnSetBufferSize,
+    IDmaChannelSlave_fnSystemAddress,
+    IDmaChannelSlave_fnPhysicalAdress,
+    IDmaChannelSlave_fnGetAdapterObject,
+    IDmaChannelSlave_fnCopyFrom,
+    IDmaChannelSlave_fnCopyTo,
+    /* IDmaChannelSlave methods */
+    IDmaChannelSlave_fnStart,
+    IDmaChannelSlave_fnStop,
+    IDmaChannelSlave_fnReadCounter,
+    IDmaChannelSlave_fnWaitForTC
+};
+
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/miniport.c b/reactos/drivers/wdm/audio/backpln/portcls/miniport.c
new file mode 100644 (file)
index 0000000..92d6970
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+    ReactOS Operating System
+
+    Port Class API
+    IMiniPortMidi Implementation
+
+    by Andrew Greenwood
+
+    REFERENCE:
+        http://www.osronline.com/ddkx/stream/audmp-routines_64vn.htm
+*/
+
+#include "private.h"
+
+const GUID CLSID_MiniportDriverDMusUART;
+const GUID CLSID_MiniportDriverUart;
+const GUID CLSID_MiniportDriverDMusUARTCapture;
+const GUID CLSID_MiniportDriverFmSynth;
+const GUID CLSID_MiniportDriverFmSynthWithVol;
+
+/*
+ * @implemented
+ */
+NTSTATUS NTAPI
+PcNewMiniport(
+    OUT PMINIPORT* OutMiniport,
+    IN  REFCLSID ClassId)
+{
+    NTSTATUS Status = STATUS_INVALID_PARAMETER;
+
+    if (!OutMiniport)
+    {
+        DPRINT("PcNewMiniport was supplied a NULL OutPort parameter\n");
+        return STATUS_INVALID_PARAMETER;
+    }
+
+    if (IsEqualGUIDAligned(ClassId, &CLSID_MiniportDriverDMusUART) ||
+        IsEqualGUIDAligned(ClassId, &CLSID_MiniportDriverUart) ||
+        IsEqualGUIDAligned(ClassId, &CLSID_MiniportDriverDMusUARTCapture))
+    {
+        Status = NewMiniportDMusUART(OutMiniport, ClassId);
+    }
+    else if (IsEqualGUIDAligned(ClassId, &CLSID_MiniportDriverFmSynth) ||
+             IsEqualGUIDAligned(ClassId, &CLSID_MiniportDriverFmSynthWithVol))
+    {
+        Status = NewMiniportFmSynth(OutMiniport, ClassId);
+    }
+    else
+    {
+        Status = STATUS_INVALID_PARAMETER;
+    }
+
+    DPRINT("PcNewMiniport Status %x\n", Status);
+    return Status;
+}
+
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.c b/reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.c
new file mode 100644 (file)
index 0000000..903d9e3
--- /dev/null
@@ -0,0 +1,164 @@
+#include "private.h"
+
+typedef struct
+{
+    IMiniportDMusVtbl *lpVtbl;
+    LONG ref;
+    CLSID ClassId;
+
+}IMiniportDMusImpl;
+
+const GUID IID_IMiniportDMus;
+
+/* IUnknown methods */
+
+NTSTATUS
+STDMETHODCALLTYPE
+IMiniportDMus_fnQueryInterface(
+    IMiniportDMus* iface,
+    IN  REFIID refiid,
+    OUT PVOID* Output)
+{
+    IMiniportDMusImpl * This = (IMiniportDMusImpl*)iface;
+
+    if (IsEqualGUIDAligned(refiid, &IID_IMiniportDMus))
+    {
+        *Output = &This->lpVtbl;
+        _InterlockedIncrement(&This->ref);
+        return STATUS_SUCCESS;
+    }
+    return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+STDMETHODCALLTYPE
+IMiniportDMus_fnAddRef(
+    IMiniportDMus* iface)
+{
+    IMiniportDMusImpl * This = (IMiniportDMusImpl*)iface;
+
+    return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+STDMETHODCALLTYPE
+IMiniportDMust_fnRelease(
+    IMiniportDMus* iface)
+{
+    IMiniportDMusImpl * This = (IMiniportDMusImpl*)iface;
+
+    _InterlockedDecrement(&This->ref);
+
+    if (This->ref == 0)
+    {
+        ExFreePoolWithTag(This, TAG_PORTCLASS);
+        return 0;
+    }
+    /* Return new reference count */
+    return This->ref;
+}
+
+/* IMiniport methods */
+
+NTSTATUS
+NTAPI
+IMiniportDMus_fnDataRangeIntersection(
+    IN IMiniportDMus * iface,
+    IN ULONG  PinId,
+    IN PKSDATARANGE  DataRange,
+    IN PKSDATARANGE  MatchingDataRange,
+    IN ULONG OutputBufferLength,
+    OUT PVOID ResultantFormat  OPTIONAL,
+    OUT PULONG ResultantFormatLength)
+{
+    return STATUS_UNSUCCESSFUL;
+}
+
+NTSTATUS
+NTAPI
+IMiniportDMus_fnGetDescription(
+    IN IMiniportDMus * iface,
+    OUT PPCFILTER_DESCRIPTOR  *Description
+    )
+{
+    return STATUS_UNSUCCESSFUL;
+}
+
+/* IMinIMiniportDMus methods */
+
+HRESULT
+NTAPI
+IMiniportDMus_fnInit(
+    IN IMiniportDMus * iface,
+    IN PUNKNOWN  pUnknownAdapter,
+    IN PRESOURCELIST  pResourceList,
+    IN PPORTDMUS  pPort,
+    OUT PSERVICEGROUP  *ppServiceGroup
+    )
+{
+    return STATUS_UNSUCCESSFUL;
+}
+
+HRESULT
+NTAPI
+IMiniportDMus_fnNewStream(
+    IN IMiniportDMus * iface,
+    OUT PMXF  *ppMXF,
+    IN PUNKNOWN  pOuterUnknown  OPTIONAL,
+    IN POOL_TYPE  PoolType,
+    IN ULONG  uPinId,
+    IN DMUS_STREAM_TYPE  StreamType,
+    IN PKSDATAFORMAT  pDataFormat,
+    OUT PSERVICEGROUP  *ppServiceGroup,
+    IN PAllocatorMXF  pAllocatorMXF,
+    IN PMASTERCLOCK  pMasterClock,
+    OUT PULONGLONG  puuSchedulePreFetch
+    )
+{
+    return STATUS_UNSUCCESSFUL;
+}
+
+VOID
+NTAPI
+IMiniportDMus_fnService(
+    IN IMiniportDMus * iface)
+{
+
+}
+
+static IMiniportDMusVtbl vt_PortDMusVtbl =
+{
+    /* IUnknown */
+    IMiniportDMus_fnQueryInterface,
+    IMiniportDMus_fnAddRef,
+    IMiniportDMust_fnRelease,
+    /* IMiniport */
+    IMiniportDMus_fnGetDescription,
+    IMiniportDMus_fnDataRangeIntersection,
+    /* IMiniportDMus */
+    IMiniportDMus_fnInit,
+    IMiniportDMus_fnService,
+    IMiniportDMus_fnNewStream
+};
+
+NTSTATUS
+NewMiniportDMusUART(
+    OUT PMINIPORT* OutMiniport,
+    IN  REFCLSID ClassId)
+{
+    IMiniportDMusImpl * This;
+
+    This = ExAllocatePoolWithTag(NonPagedPool, sizeof(IMiniportDMusImpl), TAG_PORTCLASS);
+    if (!This)
+        return STATUS_INSUFFICIENT_RESOURCES;
+
+    /* Initialize IMiniportDMus */
+    RtlCopyMemory(&This->ClassId, ClassId, sizeof(CLSID));
+    This->ref = 1;
+    This->lpVtbl = &vt_PortDMusVtbl;
+    *OutMiniport = (PMINIPORT)&This->lpVtbl;
+
+    return STATUS_SUCCESS;
+}
+
+
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp b/reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/miniport_fmsynth.c b/reactos/drivers/wdm/audio/backpln/portcls/miniport_fmsynth.c
new file mode 100644 (file)
index 0000000..44d7d66
--- /dev/null
@@ -0,0 +1,9 @@
+#include "private.h"
+
+
+NTSTATUS NewMiniportFmSynth(
+    OUT PMINIPORT* OutMiniport,
+    IN  REFCLSID ClassId)
+{
+    return STATUS_UNSUCCESSFUL;
+}
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/port.c b/reactos/drivers/wdm/audio/backpln/portcls/port.c
new file mode 100644 (file)
index 0000000..f892ff0
--- /dev/null
@@ -0,0 +1,41 @@
+#include "private.h"
+
+
+const GUID CLSID_PortTopology;
+const GUID CLSID_PortMidi;
+const GUID CLSID_PortWaveCyclic;
+const GUID CLSID_PortWavePci;
+const GUID CLSID_PortDMus;
+
+PORTCLASSAPI
+NTSTATUS
+NTAPI
+PcNewPort(
+    OUT PPORT* OutPort,
+    IN  REFCLSID ClassId)
+{
+    NTSTATUS Status;
+
+    if (!OutPort)
+    {
+        DPRINT("PcNewPort was supplied a NULL OutPort parameter\n");
+        return STATUS_INVALID_PARAMETER;
+    }
+
+    if (IsEqualGUIDAligned(ClassId, &CLSID_PortMidi))
+        Status = NewPortMidi(OutPort);
+    else if (IsEqualGUIDAligned(ClassId, &CLSID_PortDMus))
+        Status = NewPortDMus(OutPort);
+    else if (IsEqualGUIDAligned(ClassId, &CLSID_PortTopology))
+        Status = NewPortTopology(OutPort);
+    else if (IsEqualGUIDAligned(ClassId, &CLSID_PortWaveCyclic))
+        Status = NewPortWaveCyclic(OutPort);
+    else if (IsEqualGUIDAligned(ClassId, &CLSID_PortWavePci))
+        Status = NewPortWavePci(OutPort);
+    else
+        Status = STATUS_NOT_SUPPORTED;
+
+    DPRINT("PcNewPort Status %lx\n", Status);
+
+    return Status;
+}
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/port_dmus.c b/reactos/drivers/wdm/audio/backpln/portcls/port_dmus.c
new file mode 100644 (file)
index 0000000..d29c26e
--- /dev/null
@@ -0,0 +1,177 @@
+#include "private.h"
+
+typedef struct
+{
+    IPortDMusVtbl *lpVtbl;
+
+    LONG ref;
+    BOOL bInitialized;
+    IMiniportDMus *pMiniport;
+    DEVICE_OBJECT *pDeviceObject;
+    PSERVICEGROUP ServiceGroup;
+
+}IPortDMusImpl;
+
+const GUID IID_IPortDMus;
+
+//---------------------------------------------------------------
+// IUnknown interface functions
+//
+
+NTSTATUS
+NTAPI
+IPortDMus_fnQueryInterface(
+    IPortDMus* iface,
+    IN  REFIID refiid,
+    OUT PVOID* Output)
+{
+    IPortDMusImpl * This = (IPortDMusImpl*)iface;
+    if (IsEqualGUIDAligned(refiid, &IID_IPortDMus) ||
+        IsEqualGUIDAligned(refiid, &IID_IUnknown))
+    {
+        *Output = &This->lpVtbl;
+        _InterlockedIncrement(&This->ref);
+        return STATUS_SUCCESS;
+    }
+    return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+NTAPI
+IPortDMus_fnAddRef(
+    IPortDMus* iface)
+{
+    IPortDMusImpl * This = (IPortDMusImpl*)iface;
+
+    return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+NTAPI
+IPortDMus_fnRelease(
+    IPortDMus* iface)
+{
+    IPortDMusImpl * This = (IPortDMusImpl*)iface;
+
+    _InterlockedDecrement(&This->ref);
+
+    if (This->ref == 0)
+    {
+        if (This->bInitialized)
+        {
+            This->pMiniport->lpVtbl->Release(This->pMiniport);
+        }
+        ExFreePoolWithTag(This, TAG_PORTCLASS);
+        return 0;
+    }
+    /* Return new reference count */
+    return This->ref;
+}
+
+
+//---------------------------------------------------------------
+// IPort interface functions
+//
+
+NTSTATUS
+NTAPI
+IPortDMus_fnGetDeviceProperty(
+    IN IPortDMus * iface,
+    IN DEVICE_REGISTRY_PROPERTY  DeviceRegistryProperty,
+    IN ULONG  BufferLength,
+    OUT PVOID  PropertyBuffer,
+    OUT PULONG  ReturnLength)
+{
+    IPortDMusImpl * This = (IPortDMusImpl*)iface;
+
+    if (!This->bInitialized)
+    {
+        DPRINT("IPortDMus_fnNewRegistryKey called w/o initiazed\n");
+        return STATUS_UNSUCCESSFUL;
+    }
+
+    return IoGetDeviceProperty(This->pDeviceObject, DeviceRegistryProperty, BufferLength, PropertyBuffer, ReturnLength);
+}
+
+NTSTATUS
+NTAPI
+IPortDMus_fnInit(
+    IN IPortDMus * iface,
+    IN PDEVICE_OBJECT  DeviceObject,
+    IN PIRP  Irp,
+    IN PUNKNOWN  UnknownMiniport,
+    IN PUNKNOWN  UnknownAdapter  OPTIONAL,
+    IN PRESOURCELIST  ResourceList)
+{
+    IMiniportDMus * Miniport;
+    NTSTATUS Status;
+    IPortDMusImpl * This = (IPortDMusImpl*)iface;
+
+    if (This->bInitialized)
+    {
+        DPRINT("IPortDMus_Init called again\n");
+        return STATUS_SUCCESS;
+    }
+
+    Status = UnknownMiniport->lpVtbl->QueryInterface(UnknownMiniport, &IID_IMiniportDMus, (PVOID*)&Miniport);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT("IPortDMus_Init called with invalid IMiniport adapter\n");
+        return STATUS_INVALID_PARAMETER;
+    }
+
+    Status = Miniport->lpVtbl->Init(Miniport, UnknownAdapter, ResourceList, iface, &This->ServiceGroup);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT("IMinIPortDMus_Init failed with %x\n", Status);
+        return Status;
+    }
+
+    /* Initialize port object */
+    This->pMiniport = Miniport;
+    This->pDeviceObject = DeviceObject;
+    This->bInitialized = TRUE;
+
+    /* increment reference on miniport adapter */
+    Miniport->lpVtbl->AddRef(Miniport);
+
+    return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
+NTAPI
+IPortDMus_fnNewRegistryKey(
+    IN IPortDMus * iface,
+    OUT PREGISTRYKEY  *OutRegistryKey,
+    IN PUNKNOWN  OuterUnknown  OPTIONAL,
+    IN ULONG  RegistryKeyType,
+    IN ACCESS_MASK  DesiredAccess,
+    IN POBJECT_ATTRIBUTES  ObjectAttributes  OPTIONAL,
+    IN ULONG  CreateOptions  OPTIONAL,
+    OUT PULONG  Disposition  OPTIONAL)
+{
+    IPortDMusImpl * This = (IPortDMusImpl*)iface;
+
+    if (!This->bInitialized)
+    {
+        DPRINT("IPortDMus_fnNewRegistryKey called w/o initialized\n");
+        return STATUS_UNSUCCESSFUL;
+    }
+    return STATUS_UNSUCCESSFUL;
+}
+
+
+
+
+
+
+
+
+NTSTATUS
+NewPortDMus(
+    OUT PPORT* OutPort)
+{
+    return STATUS_UNSUCCESSFUL;
+}
+
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/port_midi.c b/reactos/drivers/wdm/audio/backpln/portcls/port_midi.c
new file mode 100644 (file)
index 0000000..3e9e37e
--- /dev/null
@@ -0,0 +1,8 @@
+#include "private.h"
+
+NTSTATUS
+NewPortMidi(
+    OUT PPORT* OutPort)
+{
+    return STATUS_UNSUCCESSFUL;
+}
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c b/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c
new file mode 100644 (file)
index 0000000..6ec3777
--- /dev/null
@@ -0,0 +1,11 @@
+#include "private.h"
+
+
+
+
+NTSTATUS
+NewPortTopology(
+    OUT PPORT* OutPort)
+{
+    return STATUS_UNSUCCESSFUL;
+}
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c b/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c
new file mode 100644 (file)
index 0000000..d459b36
--- /dev/null
@@ -0,0 +1,249 @@
+#include "private.h"
+
+typedef struct
+{
+    IPortWaveCyclicVtbl *lpVtbl;
+    IPortClsVersion  *lpVtblPortClsVersion;
+#if 0
+    IUnregisterSubdevice *lpVtblUnregisterSubDevice;
+#endif
+
+    LONG ref;
+
+    BOOL bInitialized;
+    PDEVICE_OBJECT pDeviceObject;
+    PMINIPORTWAVECYCLIC pMiniport;
+
+}IPortWaveCyclicImpl;
+
+const GUID IID_IMiniportWaveCyclic;
+const GUID IID_IPortWaveCyclic;
+const GUID IID_IUnknown;
+
+//---------------------------------------------------------------
+// IUnknown interface functions
+//
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnQueryInterface(
+    IPortWaveCyclic* iface,
+    IN  REFIID refiid,
+    OUT PVOID* Output)
+{
+    IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+    if (IsEqualGUIDAligned(refiid, &IID_IPortWaveCyclic) ||
+        IsEqualGUIDAligned(refiid, &IID_IUnknown))
+    {
+        *Output = &This->lpVtbl;
+        _InterlockedIncrement(&This->ref);
+        return STATUS_SUCCESS;
+    }
+    return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+NTAPI
+IPortWaveCyclic_fnAddRef(
+    IPortWaveCyclic* iface)
+{
+    IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+
+    return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+NTAPI
+IPortWaveCyclic_fnRelease(
+    IPortWaveCyclic* iface)
+{
+    IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+
+    _InterlockedDecrement(&This->ref);
+
+    if (This->ref == 0)
+    {
+        if (This->bInitialized)
+        {
+            This->pMiniport->lpVtbl->Release(This->pMiniport);
+        }
+        ExFreePoolWithTag(This, TAG_PORTCLASS);
+        return 0;
+    }
+    /* Return new reference count */
+    return This->ref;
+}
+
+
+//---------------------------------------------------------------
+// IPort interface functions
+//
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnGetDeviceProperty(
+    IN IPortWaveCyclic * iface,
+    IN DEVICE_REGISTRY_PROPERTY  DeviceRegistryProperty,
+    IN ULONG  BufferLength,
+    OUT PVOID  PropertyBuffer,
+    OUT PULONG  ReturnLength)
+{
+    IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+
+    if (!This->bInitialized)
+    {
+        DPRINT("IPortWaveCyclic_fnNewRegistryKey called w/o initiazed\n");
+        return STATUS_UNSUCCESSFUL;
+    }
+
+    return IoGetDeviceProperty(This->pDeviceObject, DeviceRegistryProperty, BufferLength, PropertyBuffer, ReturnLength);
+}
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnInit(
+    IN IPortWaveCyclic * iface,
+    IN PDEVICE_OBJECT  DeviceObject,
+    IN PIRP  Irp,
+    IN PUNKNOWN  UnknownMiniport,
+    IN PUNKNOWN  UnknownAdapter  OPTIONAL,
+    IN PRESOURCELIST  ResourceList)
+{
+    IMiniportWaveCyclic * Miniport;
+    NTSTATUS Status;
+    IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+
+    if (This->bInitialized)
+    {
+        DPRINT("IPortWaveCyclic_Init called again\n");
+        return STATUS_SUCCESS;
+    }
+
+    Status = UnknownMiniport->lpVtbl->QueryInterface(UnknownMiniport, &IID_IMiniportWaveCyclic, (PVOID*)&Miniport);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT("IPortWaveCyclic_Init called with invalid IMiniport adapter\n");
+        return STATUS_INVALID_PARAMETER;
+    }
+
+    Status = Miniport->lpVtbl->Init(Miniport, UnknownAdapter, ResourceList, iface);
+    if (!NT_SUCCESS(Status))
+    {
+        DPRINT("IMiniportWaveCyclic_Init failed with %x\n", Status);
+        return Status;
+    }
+
+    /* Initialize port object */
+    This->pMiniport = Miniport;
+    This->pDeviceObject = DeviceObject;
+    This->bInitialized = TRUE;
+
+    /* increment reference on miniport adapter */
+    Miniport->lpVtbl->AddRef(Miniport);
+
+    return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnNewRegistryKey(
+    IN IPortWaveCyclic * iface,
+    OUT PREGISTRYKEY  *OutRegistryKey,
+    IN PUNKNOWN  OuterUnknown  OPTIONAL,
+    IN ULONG  RegistryKeyType,
+    IN ACCESS_MASK  DesiredAccess,
+    IN POBJECT_ATTRIBUTES  ObjectAttributes  OPTIONAL,
+    IN ULONG  CreateOptions  OPTIONAL,
+    OUT PULONG  Disposition  OPTIONAL)
+{
+    IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+
+    if (!This->bInitialized)
+    {
+        DPRINT("IPortWaveCyclic_fnNewRegistryKey called w/o initialized\n");
+        return STATUS_UNSUCCESSFUL;
+    }
+    return STATUS_UNSUCCESSFUL;
+}
+
+
+//---------------------------------------------------------------
+// IPortWaveCyclic interface functions
+//
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnNewMasterDmaChannel(
+    IN IPortWaveCyclic * iface,
+    OUT PDMACHANNEL* DmaChannel,
+    IN  PUNKNOWN OuterUnknown,
+    IN  PRESOURCELIST ResourceList OPTIONAL,
+    IN  ULONG MaximumLength,
+    IN  BOOL Dma32BitAddresses,
+    IN  BOOL Dma64BitAddresses,
+    IN  DMA_WIDTH DmaWidth,
+    IN  DMA_SPEED DmaSpeed)
+{
+    return STATUS_UNSUCCESSFUL;
+}
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnNewSlaveDmaChannel(
+    IN IPortWaveCyclic * iface,
+    OUT PDMACHANNELSLAVE* DmaChannel,
+    IN  PUNKNOWN OuterUnknown,
+    IN  PRESOURCELIST ResourceList OPTIONAL,
+    IN  ULONG DmaIndex,
+    IN  ULONG MaximumLength,
+    IN  BOOL DemandMode,
+    IN  DMA_SPEED DmaSpeed)
+{
+    return STATUS_UNSUCCESSFUL;
+}
+
+VOID
+NTAPI
+IPortWaveCyclic_fnNotify(
+    IN IPortWaveCyclic * iface,
+    IN  PSERVICEGROUP ServiceGroup)
+{
+}
+
+
+static const IPortWaveCyclicVtbl vt_IPortWaveCyclicVtbl =
+{
+    IPortWaveCyclic_fnQueryInterface,
+    IPortWaveCyclic_fnAddRef,
+    IPortWaveCyclic_fnRelease,
+    IPortWaveCyclic_fnInit,
+    IPortWaveCyclic_fnGetDeviceProperty,
+    IPortWaveCyclic_fnNewRegistryKey,
+    IPortWaveCyclic_fnNotify,
+    IPortWaveCyclic_fnNewMasterDmaChannel,
+    IPortWaveCyclic_fnNewSlaveDmaChannel,
+};
+
+//---------------------------------------------------------------
+// IPortWaveCyclic constructor
+//
+
+NTSTATUS
+NewPortWaveCyclic(
+    OUT PPORT* OutPort)
+{
+    IPortWaveCyclicImpl * This;
+
+    This = ExAllocatePoolWithTag(NonPagedPool, sizeof(IPortWaveCyclicImpl), TAG_PORTCLASS);
+    if (!This)
+        return STATUS_INSUFFICIENT_RESOURCES;
+
+    This->lpVtbl = (IPortWaveCyclicVtbl*)&vt_IPortWaveCyclicVtbl;
+    This->ref = 1;
+    This->bInitialized = FALSE;
+    *OutPort = (PPORT)(&This->lpVtbl);
+
+    return STATUS_SUCCESS;
+}
+
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c b/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c
new file mode 100644 (file)
index 0000000..8ff598f
--- /dev/null
@@ -0,0 +1,47 @@
+#include "private.h"
+
+typedef struct
+{
+    IPortWavePciVtbl *lpVtbl;
+    IPortClsVersion  *lpVtblPortClsVersion;
+#if 0
+    IUnregisterSubdevice *lpVtblUnregisterSubDevice;
+#endif
+    LONG ref;
+
+
+}IPortWavePciImpl;
+
+
+NTSTATUS
+NTAPI
+IPortWavePci_fnNewMasterDmaChannel(
+    IN IPortWavePci * iface,
+    OUT PDMACHANNEL* DmaChannel,
+    IN  PUNKNOWN OuterUnknown,
+    IN  POOL_TYPE PoolType,
+    IN  PRESOURCELIST ResourceList OPTIONAL,
+    IN  BOOL ScatterGather,
+    IN  BOOL Dma32BitAddresses,
+    IN  BOOL Dma64BitAddresses,
+    IN  DMA_WIDTH DmaWidth,
+    IN  DMA_SPEED DmaSpeed,
+    IN  ULONG MaximumLength,
+    IN  ULONG DmaPort)
+{
+    return STATUS_UNSUCCESSFUL;
+}
+
+VOID
+IPortWavePci_fnNotify(
+    IN IPortWavePci * iface,
+    IN  PSERVICEGROUP ServiceGroup)
+{
+}
+
+NTSTATUS
+NewPortWavePci(
+    OUT PPORT* OutPort)
+{
+    return STATUS_UNSUCCESSFUL;
+}
index 8ac5840..ba85fe6 100644 (file)
@@ -1,50 +1,33 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../../../tools/rbuild/project.dtd">
 <module name="portcls" type="kernelmodedriver" installbase="system32/drivers" installname="portcls.sys" allowwarnings="true">
-
-       <!-- MinGW32-specific linker options. Worth having but not essential. -->
-       <!--
-       <linkerflag>-fno-exceptions</linkerflag>
-       <linkerflag>-fno-rtti</linkerflag>
-       -->
        <importlibrary definition="portcls.spec" />
-
        <define name="_NTDDK_" />
        <define name="PC_NO_IMPORTS" />
-
        <include base="portcls">../include</include>
-
        <library>ntoskrnl</library>
        <library>ks</library>
        <library>drmk</library>
-
+       <library>rtl</library>
+       <file>api.c</file>
        <file>dll.c</file>
+       <file>dma_master.c</file>
+       <file>dma_slave.c</file>
        <file>adapter.c</file>
        <file>irp.c</file>
        <file>drm.c</file>
        <file>stubs.c</file>
        <file>undoc.c</file>
-
-       <!-- Probably not the best idea to have this separate -->
-       <!--<file>../stdunk/stdunk.c</file>-->
-
-       <file>ResourceList.c</file>
-
-       <file>port_factory.c</file>
-       <file>Port.cpp</file>
-       <file>PortDMus.cpp</file>
-       <file>PortMidi.cpp</file>
-       <file>PortTopology.cpp</file>
-       <file>PortWaveCyclic.cpp</file>
-       <file>PortWavePci.cpp</file>
-
-       <file>miniport_factory.cpp</file>
-       <file>Miniport.cpp</file>
-       <file>MiniportDMus.cpp</file>
-       <file>MiniportMidi.cpp</file>
-       <file>MiniportTopology.cpp</file>
-       <file>MiniportWaveCyclic.cpp</file>
-       <file>MiniportWavePci.cpp</file>
-
+       <file>resource.c</file>
+       <file>registry.c</file>
+       <file>port.c</file>
+       <file>port_dmus.c</file>
+       <file>port_midi.c</file>
+       <file>port_topology.c</file>
+       <file>port_wavepci.c</file>
+       <file>port_wavecyclic.c</file>
+       <file>miniport.c</file>
+       <file>miniport_dmus.c</file>
+       <file>miniport_fmsynth.c</file>
        <file>portcls.rc</file>
 </module>
index 61d8f8b..a2e127a 100644 (file)
@@ -11,6 +11,9 @@
 #include <portcls.h>
 #include <debug.h>
 
+#include <portcls.h>
+#include <dmusicks.h>
+
 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
 #define TAG_PORTCLASS TAG('P', 'C', 'L', 'S')
 
@@ -43,6 +46,28 @@ PortClsSysControl(
     IN  PDEVICE_OBJECT DeviceObject,
     IN  PIRP Irp);
 
+NTSTATUS NewMiniportDMusUART(
+    OUT PMINIPORT* OutMiniport,
+    IN  REFCLSID ClassId);
+
+NTSTATUS NewMiniportFmSynth(
+    OUT PMINIPORT* OutMiniport,
+    IN  REFCLSID ClassId);
+
+NTSTATUS NewPortMidi(
+    OUT PPORT* OutPort);
+
+NTSTATUS NewPortDMus(
+    OUT PPORT* OutPort);
+
+NTSTATUS NewPortTopology(
+    OUT PPORT* OutPort);
+
+NTSTATUS NewPortWaveCyclic(
+    OUT PPORT* OutPort);
+
+NTSTATUS NewPortWavePci(
+    OUT PPORT* OutPort);
 
 typedef struct
 {
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/registry.c b/reactos/drivers/wdm/audio/backpln/portcls/registry.c
new file mode 100644 (file)
index 0000000..8b3d229
--- /dev/null
@@ -0,0 +1,222 @@
+#include "private.h"
+
+typedef struct
+{
+    IRegistryKeyVtbl * lpVtbl;
+
+    LONG ref;
+    HANDLE hKey;
+
+}IRegistryKeyImpl;
+
+const GUID IID_IRegistryKey;
+
+/*
+    Basic IUnknown methods
+*/
+
+static IRegistryKeyVtbl vt_IRegistryKeyVtbl;
+
+
+ULONG
+STDMETHODCALLTYPE
+IRegistryKey_fnAddRef(
+    IN IRegistryKey* iface)
+{
+    IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+
+    DPRINT("IRegistryKey_AddRef: This %p\n", This);
+
+    return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+STDMETHODCALLTYPE
+IRegistryKey_fnRelease(
+    IN IRegistryKey* iface)
+{
+    IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+
+    _InterlockedDecrement(&This->ref);
+
+    if (This->ref == 0)
+    {
+        if (This->hKey)
+        {
+            ZwClose(This->hKey);
+        }
+        ExFreePoolWithTag(This, TAG_PORTCLASS);
+        return 0;
+    }
+    /* Return new reference count */
+    return This->ref;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnQueryInterface(
+    IN IRegistryKey* iface,
+    IN  REFIID refiid,
+    OUT PVOID* Output)
+{
+    IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+
+    if (IsEqualGUIDAligned(refiid, &IID_IRegistryKey))
+    {
+        *Output = (PVOID)&This->lpVtbl;
+        _InterlockedIncrement(&This->ref);
+        return STATUS_SUCCESS;
+    }
+
+    DPRINT("IRegistryKey_QueryInterface: This %p unknown iid\n", This, This->ref);
+    return STATUS_UNSUCCESSFUL;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnDeleteKey(
+    IN IRegistryKey* iface)
+{
+    IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+    return ZwDeleteKey(This->hKey);
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnEnumerateKey(
+    IN IRegistryKey* iface,
+    IN ULONG  Index,
+    IN KEY_INFORMATION_CLASS  KeyInformationClass,
+    OUT PVOID  KeyInformation,
+    IN ULONG  Length,
+    OUT PULONG  ResultLength)
+{
+    IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+    return ZwEnumerateKey(This->hKey, Index, KeyInformationClass, KeyInformation, Length, ResultLength);
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnEnumerateKeyValue(
+    IN IRegistryKey* iface,
+    IN ULONG  Index,
+    IN KEY_VALUE_INFORMATION_CLASS  KeyValueInformationClass,
+    OUT PVOID  KeyValueInformation,
+    IN ULONG  Length,
+    OUT PULONG  ResultLength)
+{
+    IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+    return ZwEnumerateValueKey(This->hKey, Index, KeyValueInformationClass, KeyValueInformation, Length, ResultLength);
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnNewSubKey(
+    IN IRegistryKey* iface,
+    OUT PREGISTRYKEY  *RegistrySubKey,
+    IN PUNKNOWN  OuterUnknown,
+    IN ACCESS_MASK  DesiredAccess,
+    IN PUNICODE_STRING  SubKeyName,
+    IN ULONG  CreateOptions,
+    OUT PULONG  Disposition  OPTIONAL)
+{
+    OBJECT_ATTRIBUTES Attributes;
+    NTSTATUS Status;
+    HANDLE hKey;
+    IRegistryKeyImpl * NewThis, *This = (IRegistryKeyImpl*)iface;
+
+    InitializeObjectAttributes(&Attributes, SubKeyName, 0, This->hKey, NULL);
+    Status = ZwCreateKey(&hKey, KEY_READ | KEY_WRITE, &Attributes, 0, NULL, 0, Disposition);
+    if (!NT_SUCCESS(Status))
+        return Status;
+
+
+    NewThis = ExAllocatePoolWithTag(NonPagedPool, sizeof(IRegistryKeyImpl), TAG_PORTCLASS);
+    if (!NewThis)
+    {
+        ZwClose(hKey);
+        return STATUS_INSUFFICIENT_RESOURCES;
+    }
+
+    NewThis->hKey = hKey;
+    NewThis->ref = 1;
+    NewThis->lpVtbl = &vt_IRegistryKeyVtbl;
+    *RegistrySubKey = (PREGISTRYKEY)&This->lpVtbl;
+    return STATUS_SUCCESS;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnQueryKey(
+    IN IRegistryKey* iface,
+    IN KEY_INFORMATION_CLASS  KeyInformationClass,
+    OUT PVOID  KeyInformation,
+    IN ULONG  Length,
+    OUT PULONG  ResultLength)
+{
+    IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+    return ZwQueryKey(This->hKey, KeyInformationClass, KeyInformation, Length, ResultLength);
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnQueryRegistryValues(
+    IN IRegistryKey* iface,
+    IN PRTL_QUERY_REGISTRY_TABLE  QueryTable,
+    IN PVOID  Context  OPTIONAL)
+{
+    IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+    DPRINT("IRegistryKey_QueryRegistryValues: This %p\n", This);
+    return STATUS_UNSUCCESSFUL;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnQueryValueKey(
+    IN IRegistryKey* iface,
+    IN PUNICODE_STRING  ValueName,
+    IN KEY_VALUE_INFORMATION_CLASS  KeyValueInformationClass,
+    OUT PVOID  KeyValueInformation,
+    IN ULONG  Length,
+    OUT PULONG  ResultLength)
+{
+    IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+    return ZwQueryValueKey(This->hKey, ValueName, KeyValueInformationClass, KeyValueInformation, Length, ResultLength);
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnSetValueKey(
+    IN IRegistryKey* iface,
+    IN PUNICODE_STRING  ValueName  OPTIONAL,
+    IN ULONG  Type,
+    IN PVOID  Data,
+    IN ULONG  DataSize
+    )
+{
+    IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+    return ZwSetValueKey(This->hKey, ValueName, 0, Type, Data, DataSize);
+}
+
+
+/*
+ * @unimplemented
+ */
+NTSTATUS NTAPI
+PcNewRegistryKey(
+    OUT PREGISTRYKEY* OutRegistryKey,
+    IN  PUNKNOWN OuterUnknown OPTIONAL,
+    IN  ULONG RegistryKeyType,
+    IN  ACCESS_MASK DesiredAccess,
+    IN  PVOID DeviceObject OPTIONAL,
+    IN  PVOID SubDevice OPTIONAL,
+    IN  POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
+    IN  ULONG CreateOptions OPTIONAL,
+    OUT PULONG Disposition OPTIONAL)
+{
+    UNIMPLEMENTED;
+    //IoGetDeviceProperty
+
+    return STATUS_UNSUCCESSFUL;
+}
+
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/resource.c b/reactos/drivers/wdm/audio/backpln/portcls/resource.c
new file mode 100644 (file)
index 0000000..a432353
--- /dev/null
@@ -0,0 +1,321 @@
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS
+ * FILE:            drivers/multimedia/portcls/helpers/ResourceList.c
+ * PURPOSE:         Port Class driver / ResourceList implementation
+ * PROGRAMMER:      Andrew Greenwood
+ *
+ * HISTORY:
+ *                  27 Jan 07   Created
+ */
+
+#include "private.h"
+#include <portcls.h>
+#include <stdunk.h>
+#include <intrin.h>
+
+typedef struct CResourceList
+{
+    IResourceListVtbl *lpVtbl;
+    LONG ref;
+    PUNKNOWN OuterUnknown;
+    POOL_TYPE PoolType;
+    PCM_RESOURCE_LIST TranslatedResourceList;
+    PCM_RESOURCE_LIST UntranslatedResourceList;
+} IResourceListImpl;
+
+const GUID IID_IResourceList;
+
+/*
+    Basic IUnknown methods
+*/
+
+NTSTATUS
+STDMETHODCALLTYPE
+IResourceList_fnQueryInterface(
+    IResourceList* iface,
+    IN  REFIID refiid,
+    OUT PVOID* Output)
+{
+    IResourceListImpl * This = (IResourceListImpl*)iface;
+    if (IsEqualGUIDAligned(refiid, &IID_IResourceList))
+    {
+        *Output = &This->lpVtbl;
+        _InterlockedIncrement(&This->ref);
+        return STATUS_SUCCESS;
+    }
+    return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+STDMETHODCALLTYPE
+IResourceList_fnAddRef(
+    IResourceList* iface)
+{
+    IResourceListImpl * This = (IResourceListImpl*)iface;
+
+    return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+STDMETHODCALLTYPE
+IResourceList_fnRelease(
+    IResourceList* iface)
+{
+    IResourceListImpl * This = (IResourceListImpl*)iface;
+
+    _InterlockedDecrement(&This->ref);
+
+    if (This->ref == 0)
+    {
+        ExFreePool(This->TranslatedResourceList);
+        ExFreePool(This->UntranslatedResourceList);
+        ExFreePoolWithTag(This, TAG_PORTCLASS);
+        return 0;
+    }
+    /* Return new reference count */
+    return This->ref;
+}
+
+
+/*
+    IResourceList methods
+*/
+
+ULONG
+STDMETHODCALLTYPE
+IResourceList_fnNumberOfEntries(IResourceList* iface)
+{
+    IResourceListImpl * This = (IResourceListImpl*)iface;
+
+    return This->TranslatedResourceList->List[0].PartialResourceList.Count;
+}
+
+ULONG
+STDMETHODCALLTYPE
+IResourceList_fnNumberOfEntriesOfType(
+    IResourceList* iface,
+    IN  CM_RESOURCE_TYPE Type)
+{
+    /* I guess the translated and untranslated lists will be same length? */
+
+    IResourceListImpl * This = (IResourceListImpl*)iface;
+    ULONG Index, Count = 0;
+    PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
+
+    for (Index = 0; Index < This->TranslatedResourceList->List[0].PartialResourceList.Count; Index ++ )
+    {
+        PartialDescriptor = &This->TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index];
+
+        if (PartialDescriptor->Type == Type)
+        {
+            /* Yay! Finally found one that matches! */
+            Count++;
+        }
+    }
+
+    DPRINT("Found %d\n", Count);
+    return Count;
+}
+
+PCM_PARTIAL_RESOURCE_DESCRIPTOR
+STDMETHODCALLTYPE
+IResourceList_fnFindTranslatedEntry(
+    IResourceList* iface,
+    IN  CM_RESOURCE_TYPE Type,
+    IN  ULONG Index)
+{
+    IResourceListImpl * This = (IResourceListImpl*)iface;
+    ULONG DescIndex, Count = 0;
+    PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
+
+    for (DescIndex = 0; DescIndex < This->TranslatedResourceList->List[0].PartialResourceList.Count; DescIndex ++ )
+    {
+        PartialDescriptor = &This->TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[DescIndex];
+
+        if (PartialDescriptor->Type == Type)
+        {
+            /* Yay! Finally found one that matches! */
+            if (Index == Count)
+            {
+                return PartialDescriptor;
+            }
+            Count++;
+        }
+    }
+
+    return NULL;
+}
+
+PCM_PARTIAL_RESOURCE_DESCRIPTOR
+STDMETHODCALLTYPE
+IResourceList_fnFindUntranslatedEntry(
+    IResourceList* iface,
+    IN  CM_RESOURCE_TYPE Type,
+    IN  ULONG Index)
+{
+    IResourceListImpl * This = (IResourceListImpl*)iface;
+    ULONG DescIndex, Count = 0;
+    PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
+
+    for (DescIndex = 0; DescIndex < This->UntranslatedResourceList->List[0].PartialResourceList.Count; DescIndex ++ )
+    {
+        PartialDescriptor = &This->UntranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[DescIndex];
+
+        if (PartialDescriptor->Type == Type)
+        {
+            /* Yay! Finally found one that matches! */
+            if (Index == Count)
+            {
+                return PartialDescriptor;
+            }
+            Count++;
+        }
+    }
+    return NULL;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IResourceList_fnAddEntry(
+    IResourceList* iface,
+    IN  PCM_PARTIAL_RESOURCE_DESCRIPTOR Translated,
+    IN  PCM_PARTIAL_RESOURCE_DESCRIPTOR Untranslated)
+{
+    PCM_RESOURCE_LIST NewUntranslatedResources, NewTranslatedResources;
+    ULONG NewTranslatedSize, NewUntranslatedSize;
+    IResourceListImpl * This = (IResourceListImpl*)iface;
+
+    NewTranslatedSize = sizeof(CM_RESOURCE_LIST) + This->TranslatedResourceList[0].List->PartialResourceList.Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
+    NewTranslatedResources = ExAllocatePoolWithTag(This->PoolType, NewTranslatedSize, TAG_PORTCLASS);
+    if (!NewTranslatedResources)
+        return STATUS_INSUFFICIENT_RESOURCES;
+
+    NewUntranslatedSize = sizeof(CM_RESOURCE_LIST) + This->UntranslatedResourceList[0].List->PartialResourceList.Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
+    NewUntranslatedResources = ExAllocatePoolWithTag(This->PoolType, NewUntranslatedSize, TAG_PORTCLASS);
+    if (!NewUntranslatedResources)
+    {
+        ExFreePoolWithTag(NewTranslatedResources, TAG_PORTCLASS);
+        return STATUS_INSUFFICIENT_RESOURCES;
+    }
+
+    RtlCopyMemory(NewTranslatedResources, This->TranslatedResourceList, sizeof(CM_RESOURCE_LIST) + (This->TranslatedResourceList[0].List->PartialResourceList.Count-1) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
+    RtlCopyMemory(&NewTranslatedResources->List[0].PartialResourceList.PartialDescriptors[This->TranslatedResourceList[0].List->PartialResourceList.Count], Translated, sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
+
+    RtlCopyMemory(NewUntranslatedResources, This->UntranslatedResourceList, sizeof(CM_RESOURCE_LIST) + (This->UntranslatedResourceList[0].List->PartialResourceList.Count-1) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
+    RtlCopyMemory(&NewUntranslatedResources->List[0].PartialResourceList.PartialDescriptors[This->UntranslatedResourceList[0].List->PartialResourceList.Count], Untranslated, sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
+
+    ExFreePoolWithTag(This->TranslatedResourceList, TAG_PORTCLASS);
+    ExFreePoolWithTag(This->UntranslatedResourceList, TAG_PORTCLASS);
+
+    This->UntranslatedResourceList = NewUntranslatedResources;
+    This->TranslatedResourceList = NewTranslatedResources;
+
+    NewUntranslatedResources->List[0].PartialResourceList.Count++;
+    NewTranslatedResources->List[0].PartialResourceList.Count++;
+
+    return STATUS_SUCCESS;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IResourceList_fnAddEntryFromParent(
+    IResourceList* iface,
+    IN  IResourceList* Parent,
+    IN  CM_RESOURCE_TYPE Type,
+    IN  ULONG Index)
+{
+    return STATUS_SUCCESS;
+}
+
+PCM_RESOURCE_LIST
+STDMETHODCALLTYPE
+IResourceList_fnTranslatedList(
+    IResourceList* iface)
+{
+    IResourceListImpl * This = (IResourceListImpl*)iface;
+
+    return This->TranslatedResourceList;
+}
+
+PCM_RESOURCE_LIST
+STDMETHODCALLTYPE
+IResourceList_fnUntranslatedList(
+    IResourceList* iface)
+{
+    IResourceListImpl * This = (IResourceListImpl*)iface;
+
+    return This->UntranslatedResourceList;
+}
+
+
+/*
+    ResourceList V-Table
+*/
+static const IResourceListVtbl vt_ResourceListVtbl =
+{
+    /* IUnknown */
+    IResourceList_fnQueryInterface,
+    IResourceList_fnAddRef,
+    IResourceList_fnRelease,
+    /* IResourceList */
+    IResourceList_fnNumberOfEntries,
+    IResourceList_fnNumberOfEntriesOfType,
+    IResourceList_fnFindTranslatedEntry,
+    IResourceList_fnFindUntranslatedEntry,
+    IResourceList_fnAddEntry,
+    IResourceList_fnAddEntryFromParent,
+    IResourceList_fnTranslatedList,
+    IResourceList_fnUntranslatedList
+};
+
+
+/*
+    Factory for creating a resource list
+*/
+PORTCLASSAPI NTSTATUS NTAPI
+PcNewResourceList(
+    OUT PRESOURCELIST* OutResourceList,
+    IN  PUNKNOWN OuterUnknown OPTIONAL,
+    IN  POOL_TYPE PoolType,
+    IN  PCM_RESOURCE_LIST TranslatedResources,
+    IN  PCM_RESOURCE_LIST UntranslatedResources)
+{
+    IResourceListImpl* NewList = NULL;
+
+    /* TODO: Validate parameters */
+
+    DPRINT("PcNewResourceList\n");
+
+    NewList = ExAllocatePoolWithTag(PoolType, sizeof(IResourceListImpl), TAG_PORTCLASS);
+
+    if (!NewList)
+    {
+        DPRINT("ExAllocatePoolWithTag failed\n");
+        return STATUS_INSUFFICIENT_RESOURCES;
+    }
+
+    /* Initialize */
+    NewList->lpVtbl = (IResourceListVtbl*)&vt_ResourceListVtbl;
+    NewList->ref = 1;
+    NewList->OuterUnknown = OuterUnknown;
+    NewList->TranslatedResourceList= TranslatedResources;
+    NewList->UntranslatedResourceList = UntranslatedResources;
+    NewList->PoolType = PoolType;
+
+    /* Increment our usage count and set the pointer to this object */
+    *OutResourceList = (IResourceList*)&NewList->lpVtbl;
+
+    return STATUS_SUCCESS;
+}
+
+PORTCLASSAPI NTSTATUS NTAPI
+PcNewResourceSublist(
+    OUT PRESOURCELIST* OutResourceList,
+    IN  PUNKNOWN OuterUnknown OPTIONAL,
+    IN  POOL_TYPE PoolType,
+    IN  PRESOURCELIST ParentList,
+    IN  ULONG MaximumEntries)
+{
+    return STATUS_UNSUCCESSFUL;
+}
index a8232cd..6408c4b 100644 (file)
@@ -16,9 +16,6 @@
     Factory Stubs
 */
 
-/*
- * @unimplemented
- */
 NTSTATUS NTAPI
 PcNewDmaChannel(
     OUT PDMACHANNEL* OutDmaChannel,
@@ -46,37 +43,6 @@ PcNewInterruptSync(
     return STATUS_UNSUCCESSFUL;
 }
 
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
-PcNewMiniport(
-    OUT PMINIPORT* OutMiniport,
-    IN  REFCLSID ClassId)
-{
-    UNIMPLEMENTED;
-    return STATUS_UNSUCCESSFUL;
-}
-
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
-PcNewRegistryKey(
-    OUT PREGISTRYKEY* OutRegistryKey,
-    IN  PUNKNOWN OuterUnknown OPTIONAL,
-    IN  ULONG RegistryKeyType,
-    IN  ACCESS_MASK DesiredAccess,
-    IN  PVOID DeviceObject OPTIONAL,
-    IN  PVOID SubDevice OPTIONAL,
-    IN  POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
-    IN  ULONG CreateOptions OPTIONAL,
-    OUT PULONG Disposition OPTIONAL)
-{
-    UNIMPLEMENTED;
-    return STATUS_UNSUCCESSFUL;
-}
-
 /*
  * @unimplemented
  */
@@ -123,21 +89,6 @@ PcRequestNewPowerState(
     Properties
 */
 
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
-PcGetDeviceProperty(
-    IN  PVOID DeviceObject,
-    IN  DEVICE_REGISTRY_PROPERTY DeviceProperty,
-    IN  ULONG BufferLength,
-    OUT PVOID PropertyBuffer,
-    OUT PULONG ResultLength)
-{
-    UNIMPLEMENTED;
-    return STATUS_UNSUCCESSFUL;
-}
-
 /*
  * @unimplemented
  */
@@ -239,13 +190,7 @@ PcRegisterPhysicalConnectionToExternal(
 /*
  * @unimplemented
  */
-ULONGLONG NTAPI
-PcGetTimeInterval(
-    IN  ULONGLONG Since)
-{
-    UNIMPLEMENTED;
-    return STATUS_UNSUCCESSFUL;
-}
+
 
 /*
  * @unimplemented
index 0f174b8..3e40ea7 100644 (file)
@@ -284,10 +284,10 @@ typedef enum _SECURITY_LOGON_TYPE
 #define FSRTL_FLAG_ADVANCED_HEADER      (0x40)
 #define FSRTL_FLAG_EOF_ADVANCE_ACTIVE   (0x80)
 
-#define FSRTL_FLAG2_DO_MODIFIED_WRITE   (0x01)
-#define FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS  (0x02)
-#define FSRTL_FLAG2_PURGE_WHEN_MAPPED (0x04)
-#define FSRTL_FLAG2_IS_PAGING_FILE (0x08)
+#define FSRTL_FLAG2_DO_MODIFIED_WRITE        (0x01)
+#define FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS (0x02)
+#define FSRTL_FLAG2_PURGE_WHEN_MAPPED        (0x04)
+#define FSRTL_FLAG2_IS_PAGING_FILE           (0x08)
 
 #define FSRTL_FSP_TOP_LEVEL_IRP         (0x01)
 #define FSRTL_CACHE_TOP_LEVEL_IRP       (0x02)
@@ -342,6 +342,8 @@ typedef enum _SECURITY_LOGON_TYPE
 #define MAP_SYSTEM                      2L
 #define MEM_DOS_LIM                     0x40000000
 
+#define MCB_FLAG_RAISE_ON_ALLOCATION_FAILURE 1
+
 #define OB_TYPE_TYPE                    1
 #define OB_TYPE_DIRECTORY               2
 #define OB_TYPE_SYMBOLIC_LINK           3
@@ -586,7 +588,7 @@ typedef LBN *PLBN;
 typedef ULONG VBN;
 typedef VBN *PVBN;
 
-typedef PVOID *PNOTIFY_SYNC;
+typedef PVOID PNOTIFY_SYNC;
 
 typedef enum _FAST_IO_POSSIBLE {
     FastIoIsNotPossible,
@@ -1009,6 +1011,14 @@ typedef struct _REPARSE_DATA_BUFFER {
 #define IO_REPARSE_TAG_IIS_CACHE                (0xA0000010L)
 #define IO_REPARSE_TAG_DFSR                     (0x80000012L)
 
+//
+// Reserved reparse tags
+//
+#define IO_REPARSE_TAG_RESERVED_ZERO            (0)
+#define IO_REPARSE_TAG_RESERVED_ONE             (1)
+#define IO_REPARSE_TAG_RESERVED_RANGE           IO_REPARSE_TAG_RESERVED_ONE
+
+
 #define REPARSE_DATA_BUFFER_HEADER_SIZE   FIELD_OFFSET(REPARSE_DATA_BUFFER, GenericReparseBuffer)
 
 typedef struct _FILE_ACCESS_INFORMATION {
@@ -1102,23 +1112,6 @@ typedef struct _FILE_ID_FULL_DIR_INFORMATION {
     WCHAR FileName[1];
 } FILE_ID_FULL_DIR_INFORMATION, *PFILE_ID_FULL_DIR_INFORMATION;
 
-typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
-    ULONG         NextEntryOffset;
-    ULONG         FileIndex;
-    LARGE_INTEGER CreationTime;
-    LARGE_INTEGER LastAccessTime;
-    LARGE_INTEGER LastWriteTime;
-    LARGE_INTEGER ChangeTime;
-    LARGE_INTEGER EndOfFile;
-    LARGE_INTEGER AllocationSize;
-    ULONG         FileAttributes;
-    ULONG         FileNameLength;
-    ULONG         EaSize;
-    CHAR          ShortNameLength;
-    WCHAR         ShortName[12];
-    WCHAR         FileName[0];
-} FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION;
-
 typedef struct _FILE_ID_BOTH_DIR_INFORMATION {
     ULONG NextEntryOffset;
     ULONG FileIndex;
@@ -2838,6 +2831,36 @@ ExWaitForRundownProtectionRelease (
     (_advhdr)->FileContextSupportPointer = NULL;                            \
 }
 
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlAddBaseMcbEntry (
+    IN PBASE_MCB  Mcb,
+    IN LONGLONG   Vbn,
+    IN LONGLONG   Lbn,
+    IN LONGLONG   SectorCount
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlAddLargeMcbEntry (
+    IN PLARGE_MCB  Mcb,
+    IN LONGLONG    Vbn,
+    IN LONGLONG    Lbn,
+    IN LONGLONG    SectorCount
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlAddMcbEntry (
+    IN PMCB   Mcb,
+    IN VBN    Vbn,
+    IN LBN    Lbn,
+    IN ULONG  SectorCount
+);
+
 NTKERNELAPI
 VOID
 NTAPI
@@ -2902,8 +2925,8 @@ NTAPI
 FsRtlAreNamesEqual (
     IN PCUNICODE_STRING  Name1,
     IN PCUNICODE_STRING  Name2,
-    IN BOOLEAN          IgnoreCase,
-    IN PCWCH           UpcaseTable OPTIONAL
+    IN BOOLEAN           IgnoreCase,
+    IN PCWCH             UpcaseTable OPTIONAL
 );
 
 #define FsRtlAreThereCurrentFileLocks(FL) ( \
@@ -3058,18 +3081,18 @@ NTKERNELAPI
 VOID
 NTAPI
 FsRtlDissectDbcs (
-    IN ANSI_STRING Name,
-    OUT PANSI_STRING FirstPart,
-    OUT PANSI_STRING RemainingPart
+    IN ANSI_STRING    Name,
+    OUT PANSI_STRING  FirstPart,
+    OUT PANSI_STRING  RemainingPart
 );
 
 NTKERNELAPI
 VOID
 NTAPI
 FsRtlDissectName (
-    IN UNICODE_STRING Name,
-    OUT PUNICODE_STRING FirstPart,
-    OUT PUNICODE_STRING RemainingPart
+    IN UNICODE_STRING    Name,
+    OUT PUNICODE_STRING  FirstPart,
+    OUT PUNICODE_STRING  RemainingPart
 );
 
 NTKERNELAPI
@@ -3204,6 +3227,17 @@ FsRtlGetFileSize (
     IN OUT PLARGE_INTEGER   FileSize
 );
 
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlGetNextBaseMcbEntry (
+    IN PBASE_MCB   Mcb,
+    IN ULONG       RunIndex,
+    OUT PLONGLONG  Vbn,
+    OUT PLONGLONG  Lbn,
+    OUT PLONGLONG  SectorCount
+);
+
 /*
   FsRtlGetNextFileLock:
 
@@ -3224,6 +3258,40 @@ FsRtlGetNextFileLock (
     IN BOOLEAN      Restart
 );
 
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlGetNextLargeMcbEntry (
+    IN PLARGE_MCB  Mcb,
+    IN ULONG       RunIndex,
+    OUT PLONGLONG  Vbn,
+    OUT PLONGLONG  Lbn,
+    OUT PLONGLONG  SectorCount
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlGetNextMcbEntry (
+    IN PMCB     Mcb,
+    IN ULONG    RunIndex,
+    OUT PVBN    Vbn,
+    OUT PLBN    Lbn,
+    OUT PULONG  SectorCount
+);
+
+#define FsRtlGetPerStreamContextPointer(FO) (   \
+    (PFSRTL_ADVANCED_FCB_HEADER)(FO)->FsContext \
+)
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlInitializeBaseMcb (
+    IN PBASE_MCB  Mcb,
+    IN POOL_TYPE  PoolType
+);
+
 NTKERNELAPI
 VOID
 NTAPI
@@ -3233,6 +3301,22 @@ FsRtlInitializeFileLock (
     IN PUNLOCK_ROUTINE              UnlockRoutine OPTIONAL
 );
 
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlInitializeLargeMcb (
+    IN PLARGE_MCB  Mcb,
+    IN POOL_TYPE   PoolType
+);
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlInitializeMcb (
+    IN PMCB       Mcb,
+    IN POOL_TYPE  PoolType
+);
+
 NTKERNELAPI
 VOID
 NTAPI
@@ -3247,6 +3331,59 @@ FsRtlInitializeTunnelCache (
     IN PTUNNEL Cache
 );
 
+#define FsRtlInitPerStreamContext(PSC, O, I, FC) ( \
+    (PSC)->OwnerId = (O),                          \
+    (PSC)->InstanceId = (I),                       \
+    (PSC)->FreeCallback = (FC)                     \
+)
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+FsRtlInsertPerStreamContext (
+    IN PFSRTL_ADVANCED_FCB_HEADER  PerStreamContext,
+    IN PFSRTL_PER_STREAM_CONTEXT   Ptr
+);
+
+#define FsRtlIsAnsiCharacterLegalFat(C, WILD) (                                \
+    FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], (FSRTL_FAT_LEGAL) |       \
+                                        ((WILD) ? FSRTL_WILD_CHARACTER : 0 ))  \
+)
+
+#define FsRtlIsAnsiCharacterLegalHpfs(C, WILD) (                               \
+    FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], (FSRTL_HPFS_LEGAL) |      \
+                                        ((WILD) ? FSRTL_WILD_CHARACTER : 0 ))  \
+)
+
+#define FsRtlIsAnsiCharacterLegalNtfs(C, WILD) (                               \
+    FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], (FSRTL_NTFS_LEGAL) |      \
+                                        ((WILD) ? FSRTL_WILD_CHARACTER : 0 ))  \
+)
+
+#define FsRtlIsAnsiCharacterWild(C) (                                       \
+    FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], FSRTL_WILD_CHARACTER ) \
+)
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlIsFatDbcsLegal (
+    IN ANSI_STRING  DbcsName,
+    IN BOOLEAN      WildCardsPermissible,
+    IN BOOLEAN      PathNamePermissible,
+    IN BOOLEAN      LeadingBackslashPermissible
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlIsHpfsDbcsLegal (
+    IN ANSI_STRING  DbcsName,
+    IN BOOLEAN      WildCardsPermissible,
+    IN BOOLEAN      PathNamePermissible,
+    IN BOOLEAN      LeadingBackslashPermissible
+);
+
 NTKERNELAPI
 BOOLEAN
 NTAPI
@@ -3274,16 +3411,105 @@ extern PUSHORT NlsOemLeadByteInfo;
                (NLS_OEM_LEAD_BYTE_INFO[(UCHAR)(DBCS_CHAR)] != 0)))          \
 )
 
-#define FsRtlIsAnsiCharacterWild(C) (                                       \
-    FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], FSRTL_WILD_CHARACTER ) \
-)
-
 #define FsRtlIsUnicodeCharacterWild(C) (                                    \
     (((C) >= 0x40) ?                                                        \
     FALSE :                                                                 \
     FlagOn(FsRtlLegalAnsiCharacterArray[(C)], FSRTL_WILD_CHARACTER ))       \
 )
 
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlLookupBaseMcbEntry (
+    IN PBASE_MCB   Mcb,
+    IN LONGLONG    Vbn,
+    OUT PLONGLONG  Lbn OPTIONAL,
+    OUT PLONGLONG  SectorCountFromLbn OPTIONAL,
+    OUT PLONGLONG  StartingLbn OPTIONAL,
+    OUT PLONGLONG  SectorCountFromStartingLbn OPTIONAL,
+    OUT PULONG     Index OPTIONAL
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlLookupLargeMcbEntry (
+    IN PLARGE_MCB  Mcb,
+    IN LONGLONG    Vbn,
+    OUT PLONGLONG  Lbn OPTIONAL,
+    OUT PLONGLONG  SectorCountFromLbn OPTIONAL,
+    OUT PLONGLONG  StartingLbn OPTIONAL,
+    OUT PLONGLONG  SectorCountFromStartingLbn OPTIONAL,
+    OUT PULONG     Index OPTIONAL
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlLookupLastBaseMcbEntry (
+    IN PBASE_MCB   Mcb,
+    OUT PLONGLONG  Vbn,
+    OUT PLONGLONG  Lbn
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlLookupLastLargeMcbEntry (
+    IN PLARGE_MCB  Mcb,
+    OUT PLONGLONG  Vbn,
+    OUT PLONGLONG  Lbn
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlLookupLastMcbEntry (
+    IN PMCB   Mcb,
+    OUT PVBN  Vbn,
+    OUT PLBN  Lbn
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlLookupLastBaseMcbEntryAndIndex (
+    IN PBASE_MCB      OpaqueMcb,
+    IN OUT PLONGLONG  LargeVbn,
+    IN OUT PLONGLONG  LargeLbn,
+    IN OUT PULONG     Index
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlLookupLastLargeMcbEntryAndIndex (
+    IN PLARGE_MCB  OpaqueMcb,
+    OUT PLONGLONG  LargeVbn,
+    OUT PLONGLONG  LargeLbn,
+    OUT PULONG     Index
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlLookupMcbEntry (
+    IN PMCB     Mcb,
+    IN VBN      Vbn,
+    OUT PLBN    Lbn,
+    OUT PULONG  SectorCount OPTIONAL,
+    OUT PULONG  Index
+);
+
+NTKERNELAPI
+PFSRTL_PER_STREAM_CONTEXT
+NTAPI
+FsRtlLookupPerStreamContextInternal (
+    IN PFSRTL_ADVANCED_FCB_HEADER  StreamContext,
+    IN PVOID                       OwnerId OPTIONAL,
+    IN PVOID                       InstanceId OPTIONAL
+);
+
 NTKERNELAPI
 BOOLEAN
 NTAPI
@@ -3382,6 +3608,37 @@ typedef BOOLEAN (*PCHECK_FOR_TRAVERSE_ACCESS) (
     IN PSECURITY_SUBJECT_CONTEXT    SubjectContext
 );
 
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlNotifyFilterChangeDirectory (
+    IN PNOTIFY_SYNC                 NotifySync,
+    IN PLIST_ENTRY                  NotifyList,
+    IN PVOID                        FsContext,
+    IN PSTRING                      FullDirectoryName,
+    IN BOOLEAN                      WatchTree,
+    IN BOOLEAN                      IgnoreBuffer,
+    IN ULONG                        CompletionFilter,
+    IN PIRP                         NotifyIrp,
+    IN PCHECK_FOR_TRAVERSE_ACCESS   TraverseCallback OPTIONAL,
+    IN PSECURITY_SUBJECT_CONTEXT    SubjectContext OPTIONAL,
+    IN PFILTER_REPORT_CHANGE        FilterCallback OPTIONAL);
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlNotifyFilterReportChange (
+    IN PNOTIFY_SYNC   NotifySync,
+    IN PLIST_ENTRY    NotifyList,
+    IN PSTRING        FullTargetName,
+    IN USHORT         TargetNameOffset,
+    IN PSTRING        StreamName OPTIONAL,
+    IN PSTRING        NormalizedParentName OPTIONAL,
+    IN ULONG          FilterMatch,
+    IN ULONG          Action,
+    IN PVOID          TargetContext,
+    IN PVOID          FilterContext);
+
 NTKERNELAPI
 VOID
 NTAPI
@@ -3450,6 +3707,27 @@ FsRtlNotifyVolumeEvent (
 
 #endif /* (VER_PRODUCTBUILD >= 2195) */
 
+NTKERNELAPI
+ULONG
+NTAPI
+FsRtlNumberOfRunsInBaseMcb (
+    IN PBASE_MCB Mcb
+);
+
+NTKERNELAPI
+ULONG
+NTAPI
+FsRtlNumberOfRunsInLargeMcb (
+    IN PLARGE_MCB Mcb
+);
+
+NTKERNELAPI
+ULONG
+NTAPI
+FsRtlNumberOfRunsInMcb (
+    IN PMCB Mcb
+);
+
 NTKERNELAPI
 NTSTATUS
 NTAPI
@@ -3466,6 +3744,30 @@ FsRtlOplockIsFastIoPossible (
     IN POPLOCK Oplock
 );
 
+typedef VOID
+(NTAPI *PFSRTL_STACK_OVERFLOW_ROUTINE) (
+    IN PVOID    Context,
+    IN PKEVENT  Event
+);
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlPostPagingFileStackOverflow (
+    IN PVOID                          Context,
+    IN PKEVENT                        Event,
+    IN PFSRTL_STACK_OVERFLOW_ROUTINE  StackOverflowRoutine
+);
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlPostStackOverflow (
+    IN PVOID                          Context,
+    IN PKEVENT                        Event,
+    IN PFSRTL_STACK_OVERFLOW_ROUTINE  StackOverflowRoutine
+);
+
 /*
   FsRtlPrivateLock:
 
@@ -3532,35 +3834,110 @@ FsRtlRegisterUncProvider (
     IN BOOLEAN          MailslotsSupported
 );
 
-typedef VOID
-(NTAPI *PFSRTL_STACK_OVERFLOW_ROUTINE) (
-    IN PVOID    Context,
-    IN PKEVENT  Event
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlRemoveBaseMcbEntry (
+    IN PBASE_MCB  Mcb,
+    IN LONGLONG   Vbn,
+    IN LONGLONG   SectorCount
 );
 
 NTKERNELAPI
 VOID
 NTAPI
-FsRtlPostStackOverflow (
-    IN PVOID                          Context,
-    IN PKEVENT                        Event,
-    IN PFSRTL_STACK_OVERFLOW_ROUTINE  StackOverflowRoutine
+FsRtlRemoveLargeMcbEntry (
+    IN PLARGE_MCB  Mcb,
+    IN LONGLONG    Vbn,
+    IN LONGLONG    SectorCount
 );
 
 NTKERNELAPI
 VOID
 NTAPI
-FsRtlPostPagingFileStackOverflow (
-    IN PVOID                          Context,
-    IN PKEVENT                        Event,
-    IN PFSRTL_STACK_OVERFLOW_ROUTINE  StackOverflowRoutine
+FsRtlRemoveMcbEntry (
+    IN PMCB   Mcb,
+    IN VBN    Vbn,
+    IN ULONG  SectorCount
+);
+
+NTKERNELAPI
+PFSRTL_PER_STREAM_CONTEXT
+NTAPI
+FsRtlRemovePerStreamContext (
+    IN PFSRTL_ADVANCED_FCB_HEADER  StreamContext,
+    IN PVOID                       OwnerId OPTIONAL,
+    IN PVOID                       InstanceId OPTIONAL
+);
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlResetBaseMcb (
+    IN PBASE_MCB Mcb
+);
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlResetLargeMcb (
+    IN PLARGE_MCB  Mcb,
+    IN BOOLEAN     SelfSynchronized
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlSplitBaseMcb (
+    IN PBASE_MCB  Mcb,
+    IN LONGLONG   Vbn,
+    IN LONGLONG   Amount
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlSplitLargeMcb (
+    IN PLARGE_MCB  Mcb,
+    IN LONGLONG    Vbn,
+    IN LONGLONG    Amount
+);
+
+#define FsRtlSupportsPerStreamContexts(FO) (                       \
+    (BOOLEAN)((NULL != FsRtlGetPerStreamContextPointer(FO) &&     \
+              FlagOn(FsRtlGetPerStreamContextPointer(FO)->Flags2, \
+              FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS))               \
+)
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlTruncateBaseMcb (
+    IN PBASE_MCB  Mcb,
+    IN LONGLONG   Vbn
+);
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlTruncateLargeMcb (
+    IN PLARGE_MCB  Mcb,
+    IN LONGLONG    Vbn
+);
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlTruncateMcb (
+    IN PMCB  Mcb,
+    IN VBN   Vbn
 );
 
 NTKERNELAPI
 VOID
 NTAPI
-FsRtlTeardownPerStreamContexts (
-    IN PFSRTL_ADVANCED_FCB_HEADER AdvancedHeader
+FsRtlUninitializeBaseMcb (
+    IN PBASE_MCB Mcb
 );
 
 NTKERNELAPI
@@ -3570,6 +3947,20 @@ FsRtlUninitializeFileLock (
     IN PFILE_LOCK FileLock
 );
 
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlUninitializeLargeMcb (
+    IN PLARGE_MCB Mcb
+);
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlUninitializeMcb (
+    IN PMCB Mcb
+);
+
 NTKERNELAPI
 VOID
 NTAPI
@@ -4543,9 +4934,9 @@ RtlFreeHeap (
 NTSYSAPI
 VOID
 NTAPI
-RtlFreeOemString(
-    IN OUT POEM_STRING OemString
-    );
+RtlFreeOemString (
+    IN POEM_STRING  OemString
+); 
 
 NTSYSAPI
 VOID
@@ -4633,6 +5024,31 @@ RtlNtStatusToDosError (
     IN NTSTATUS Status
 );
 
+NTSYSAPI
+ULONG
+NTAPI
+RtlxUnicodeStringToOemSize(
+    PCUNICODE_STRING UnicodeString
+    );
+
+NTSYSAPI
+ULONG
+NTAPI
+RtlxOemStringToUnicodeSize(
+    PCOEM_STRING OemString
+);
+
+#define RtlOemStringToUnicodeSize(STRING) (                 \
+    NLS_MB_OEM_CODE_PAGE_TAG ?                              \
+    RtlxOemStringToUnicodeSize(STRING) :                    \
+    ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR)  \
+)
+
+#define RtlOemStringToCountedUnicodeSize(STRING) (                    \
+    (ULONG)(RtlOemStringToUnicodeSize(STRING) - sizeof(UNICODE_NULL)) \
+)
+
+
 NTSYSAPI
 NTSTATUS
 NTAPI
@@ -4731,6 +5147,15 @@ RtlSubAuthoritySid (
     IN ULONG   SubAuthority
 );
 
+NTSYSAPI
+NTSTATUS
+NTAPI
+RtlUnicodeStringToCountedOemString (
+    IN OUT POEM_STRING  DestinationString,
+    IN PCUNICODE_STRING SourceString,
+    IN BOOLEAN          AllocateDestinationString
+);
+
 NTSYSAPI
 NTSTATUS
 NTAPI
@@ -4846,6 +5271,42 @@ RtlValidSid (
     IN PSID Sid
 );
 
+//
+// RTL time functions
+//
+
+NTSYSAPI
+BOOLEAN
+NTAPI
+RtlTimeToSecondsSince1980 (
+    PLARGE_INTEGER Time,
+    PULONG ElapsedSeconds
+);
+
+NTSYSAPI
+VOID
+NTAPI
+RtlSecondsSince1980ToTime (
+    ULONG ElapsedSeconds,
+    PLARGE_INTEGER Time
+);
+
+NTSYSAPI
+BOOLEAN
+NTAPI
+RtlTimeToSecondsSince1970 (
+    PLARGE_INTEGER Time,
+    PULONG ElapsedSeconds
+);
+
+NTSYSAPI
+VOID
+NTAPI
+RtlSecondsSince1970ToTime (
+    ULONG ElapsedSeconds,
+    PLARGE_INTEGER Time
+);
+
 NTKERNELAPI
 NTSTATUS
 NTAPI
index 91328bc..41ca709 100644 (file)
@@ -565,144 +565,6 @@ typedef struct _SE_IMPERSONATION_STATE {
 #define SERVICE_DEMAND_START           0x00000003\r
 #define SERVICE_DISABLED               0x00000004\r
 \r
-\r
-\r
-//\r
-// Architecture Defined Contexts\r
-//\r
-#if defined(_M_IX86)\r
-#define SIZE_OF_80387_REGISTERS        80\r
-#define CONTEXT_i386   0x10000\r
-#define CONTEXT_i486   0x10000\r
-#define CONTEXT_CONTROL        (CONTEXT_i386|0x00000001L)\r
-#define CONTEXT_INTEGER        (CONTEXT_i386|0x00000002L)\r
-#define CONTEXT_SEGMENTS       (CONTEXT_i386|0x00000004L)\r
-#define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L)\r
-#define CONTEXT_DEBUG_REGISTERS        (CONTEXT_i386|0x00000010L)\r
-#define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)\r
-#define CONTEXT_FULL   (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)\r
-#define MAXIMUM_SUPPORTED_EXTENSION  512\r
-\r
-#define EXCEPTION_READ_FAULT    0\r
-#define EXCEPTION_WRITE_FAULT   1\r
-#define EXCEPTION_EXECUTE_FAULT 8\r
-\r
-typedef struct _FLOATING_SAVE_AREA {\r
-    ULONG ControlWord;\r
-    ULONG StatusWord;\r
-    ULONG TagWord;\r
-    ULONG ErrorOffset;\r
-    ULONG ErrorSelector;\r
-    ULONG DataOffset;\r
-    ULONG DataSelector;\r
-    UCHAR RegisterArea[SIZE_OF_80387_REGISTERS];\r
-    ULONG Cr0NpxState;\r
-} FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA;\r
-\r
-typedef struct _CONTEXT {\r
-    ULONG ContextFlags;\r
-    ULONG Dr0;\r
-    ULONG Dr1;\r
-    ULONG Dr2;\r
-    ULONG Dr3;\r
-    ULONG Dr6;\r
-    ULONG Dr7;\r
-    FLOATING_SAVE_AREA FloatSave;\r
-    ULONG SegGs;\r
-    ULONG SegFs;\r
-    ULONG SegEs;\r
-    ULONG SegDs;\r
-    ULONG Edi;\r
-    ULONG Esi;\r
-    ULONG Ebx;\r
-    ULONG Edx;\r
-    ULONG Ecx;\r
-    ULONG Eax;\r
-    ULONG Ebp;\r
-    ULONG Eip;\r
-    ULONG SegCs;\r
-    ULONG EFlags;\r
-    ULONG Esp;\r
-    ULONG SegSs;\r
-    UCHAR ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];\r
-} CONTEXT;\r
-\r
-#elif defined(_M_AMD64)\r
-\r
-#define BitTest _bittest\r
-#define BitTest64 _bittest64\r
-#define BitTestAndComplement _bittestandcomplement\r
-#define BitTestAndComplement64 _bittestandcomplement64\r
-#define BitTestAndSet _bittestandset\r
-#define BitTestAndSet64 _bittestandset64\r
-#define BitTestAndReset _bittestandreset\r
-#define BitTestAndReset64 _bittestandreset64\r
-#define InterlockedBitTestAndSet _interlockedbittestandset\r
-#define InterlockedBitTestAndSet64 _interlockedbittestandset64\r
-#define InterlockedBitTestAndReset _interlockedbittestandreset\r
-#define InterlockedBitTestAndReset64 _interlockedbittestandreset64\r
-\r
-#elif defined(_M_ARM)\r
-\r
-//\r
-// FIXME: Move to armddk.h?\r
-//\r
-\r
-/* The following flags control the contents of the CONTEXT structure. */\r
-\r
-#define CONTEXT_ARM    0x0000040\r
-#define CONTEXT_CONTROL         (CONTEXT_ARM | 0x00000001L)\r
-#define CONTEXT_INTEGER         (CONTEXT_ARM | 0x00000002L)\r
-\r
-#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)\r
-\r
-typedef struct _CONTEXT {\r
-       /* The flags values within this flag control the contents of\r
-          a CONTEXT record.\r
-\r
-          If the context record is used as an input parameter, then\r
-          for each portion of the context record controlled by a flag\r
-          whose value is set, it is assumed that that portion of the\r
-          context record contains valid context. If the context record\r
-          is being used to modify a thread's context, then only that\r
-          portion of the threads context will be modified.\r
-\r
-          If the context record is used as an IN OUT parameter to capture\r
-          the context of a thread, then only those portions of the thread's\r
-          context corresponding to set flags will be returned.\r
-\r
-          The context record is never used as an OUT only parameter. */\r
-\r
-       ULONG ContextFlags;\r
-\r
-       /* This section is specified/returned if the ContextFlags word contains\r
-          the flag CONTEXT_INTEGER. */\r
-       ULONG R0;\r
-       ULONG R1;\r
-       ULONG R2;\r
-       ULONG R3;\r
-       ULONG R4;\r
-       ULONG R5;\r
-       ULONG R6;\r
-       ULONG R7;\r
-       ULONG R8;\r
-       ULONG R9;\r
-       ULONG R10;\r
-       ULONG R11;\r
-       ULONG R12;\r
-\r
-       ULONG Sp;\r
-       ULONG Lr;\r
-       ULONG Pc;\r
-       ULONG Psr;\r
-} CONTEXT;\r
-\r
-#else\r
-#error "Undefined processor architecture"\r
-#endif\r
-\r
-\r
-\r
 //\r
 // Exception Records\r
 //\r
index ff38ce7..9b2f1a0 100644 (file)
@@ -215,6 +215,10 @@ struct _COMPRESSED_DATA_INFO;
 #define KERNEL_LARGE_STACK_SIZE             61440
 #define KERNEL_LARGE_STACK_COMMIT           12288
 
+#define EXCEPTION_READ_FAULT    0
+#define EXCEPTION_WRITE_FAULT   1
+#define EXCEPTION_EXECUTE_FAULT 8
+
 #define DPFLTR_ERROR_LEVEL                  0
 #define DPFLTR_WARNING_LEVEL                1
 #define DPFLTR_TRACE_LEVEL                  2
@@ -5448,6 +5452,58 @@ typedef VOID
 
 #ifdef _X86_
 
+#define SIZE_OF_80387_REGISTERS        80
+#define CONTEXT_i386   0x10000
+#define CONTEXT_i486   0x10000
+#define CONTEXT_CONTROL        (CONTEXT_i386|0x00000001L)
+#define CONTEXT_INTEGER        (CONTEXT_i386|0x00000002L)
+#define CONTEXT_SEGMENTS       (CONTEXT_i386|0x00000004L)
+#define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L)
+#define CONTEXT_DEBUG_REGISTERS        (CONTEXT_i386|0x00000010L)
+#define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)
+#define CONTEXT_FULL   (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
+#define MAXIMUM_SUPPORTED_EXTENSION  512
+
+typedef struct _FLOATING_SAVE_AREA {
+    ULONG ControlWord;
+    ULONG StatusWord;
+    ULONG TagWord;
+    ULONG ErrorOffset;
+    ULONG ErrorSelector;
+    ULONG DataOffset;
+    ULONG DataSelector;
+    UCHAR RegisterArea[SIZE_OF_80387_REGISTERS];
+    ULONG Cr0NpxState;
+} FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA;
+
+typedef struct _CONTEXT {
+    ULONG ContextFlags;
+    ULONG Dr0;
+    ULONG Dr1;
+    ULONG Dr2;
+    ULONG Dr3;
+    ULONG Dr6;
+    ULONG Dr7;
+    FLOATING_SAVE_AREA FloatSave;
+    ULONG SegGs;
+    ULONG SegFs;
+    ULONG SegEs;
+    ULONG SegDs;
+    ULONG Edi;
+    ULONG Esi;
+    ULONG Ebx;
+    ULONG Edx;
+    ULONG Ecx;
+    ULONG Eax;
+    ULONG Ebp;
+    ULONG Eip;
+    ULONG SegCs;
+    ULONG EFlags;
+    ULONG Esp;
+    ULONG SegSs;
+    UCHAR ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
+} CONTEXT;
+
 //
 // Types to use to contain PFNs and their counts.
 //
@@ -8989,12 +9045,6 @@ NTAPI
 IoGetRelatedDeviceObject(
   IN PFILE_OBJECT  FileObject);
 
-NTKERNELAPI
-ULONG
-NTAPI
-IoGetRemainingStackSize(
-  VOID);
-
 NTKERNELAPI
 VOID
 NTAPI
@@ -9002,6 +9052,20 @@ IoGetStackLimits(
   OUT PULONG_PTR  LowLimit,
   OUT PULONG_PTR  HighLimit);
 
+FORCEINLINE
+ULONG_PTR
+IoGetRemainingStackSize(
+  VOID
+)
+{
+    ULONG_PTR End, Begin;
+    ULONG_PTR Result;
+
+    IoGetStackLimits(&Begin, &End);
+    Result = (ULONG_PTR)(&End) - Begin;
+    return Result;
+}
+
 NTKERNELAPI
 VOID
 NTAPI
diff --git a/reactos/include/ddk/winsplp.h b/reactos/include/ddk/winsplp.h
new file mode 100644 (file)
index 0000000..4dfdb5b
--- /dev/null
@@ -0,0 +1,428 @@
+/*
+ * Definitions for print provider, monitor, processor and spooler
+ *
+ * Copyright 2005 Detlef Riekenberg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ *
+ * "providor" is not a spelling error in this file. It's the real name.
+ *
+ */
+
+#ifndef _WINSPLP_
+#define _WINSPLP_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* DEFINES */
+
+#define PRINTER_NOTIFY_STATUS_ENDPOINT  1
+#define PRINTER_NOTIFY_STATUS_POLL      2
+#define PRINTER_NOTIFY_STATUS_INFO      4
+
+
+#define ROUTER_UNKNOWN      0
+#define ROUTER_SUCCESS      1
+#define ROUTER_STOP_ROUTING 2
+
+/*
+ * WARNING: Many Functions are declared as "BOOL", but return ROUTER_*
+ */
+
+
+/* TYPES */
+
+typedef struct _MONITOR {
+ BOOL  (WINAPI *pfnEnumPorts)(LPWSTR pName, DWORD Level, LPBYTE pPorts,
+                DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned);
+ BOOL  (WINAPI *pfnOpenPort)(LPWSTR pName, PHANDLE pHandle);
+ BOOL  (WINAPI *pfnOpenPortEx)(LPWSTR pPortName, LPWSTR pPrinterName,
+                PHANDLE pHandle, struct _MONITOR *pMonitor);
+ BOOL  (WINAPI *pfnStartDocPort)(HANDLE hPort, LPWSTR pPrinterName,
+                DWORD JobId, DWORD Level, LPBYTE pDocInfo);
+ BOOL  (WINAPI *pfnWritePort)(HANDLE hPort, LPBYTE pBuffer, DWORD cbBuf,
+                LPDWORD pcbWritten);
+ BOOL  (WINAPI *pfnReadPort)(HANDLE hPort, LPBYTE pBuffer, DWORD cbBuffer,
+                LPDWORD pcbRead);
+ BOOL  (WINAPI *pfnEndDocPort)(HANDLE hPort);
+ BOOL  (WINAPI *pfnClosePort)(HANDLE hPort);
+ BOOL  (WINAPI *pfnAddPort)(LPWSTR pName, HWND hWnd, LPWSTR pMonitorName);
+ BOOL  (WINAPI *pfnAddPortEx)(LPWSTR pName, DWORD Level, LPBYTE lpBuffer,
+                LPWSTR lpMonitorName);
+ BOOL  (WINAPI *pfnConfigurePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
+ BOOL  (WINAPI *pfnDeletePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
+ BOOL  (WINAPI *pfnGetPrinterDataFromPort)(HANDLE hPort, DWORD ControlID,
+                LPWSTR pValueName, LPWSTR lpInBuffer, DWORD cbInBuffer,
+                LPWSTR lpOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbReturned);
+ BOOL  (WINAPI *pfnSetPortTimeOuts)(HANDLE hPort, LPCOMMTIMEOUTS lpCTO,
+                DWORD reserved);
+ BOOL  (WINAPI *pfnXcvOpenPort)(LPCWSTR pszObject, ACCESS_MASK GrantedAccess, PHANDLE phXcv);
+ DWORD (WINAPI *pfnXcvDataPort)(HANDLE hXcv, LPCWSTR pszDataName,
+                PBYTE pInputData, DWORD cbInputData,
+                PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded);
+ BOOL  (WINAPI *pfnXcvClosePort)(HANDLE hXcv);
+} MONITOR, *LPMONITOR;
+
+typedef struct _MONITOR2 {
+ DWORD cbSize;
+ BOOL  (WINAPI *pfnEnumPorts)(LPWSTR pName, DWORD Level, LPBYTE pPorts,
+                DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned);
+ BOOL  (WINAPI *pfnOpenPort)(LPWSTR pName, PHANDLE pHandle);
+ BOOL  (WINAPI *pfnOpenPortEx)(LPWSTR pPortName, LPWSTR pPrinterName,
+                PHANDLE pHandle, struct _MONITOR2 *pMonitor2);
+ BOOL  (WINAPI *pfnStartDocPort)(HANDLE hPort, LPWSTR pPrinterName,
+                DWORD JobId, DWORD Level, LPBYTE pDocInfo);
+ BOOL  (WINAPI *pfnWritePort)(HANDLE hPort, LPBYTE pBuffer, DWORD cbBuf,
+                LPDWORD pcbWritten);
+ BOOL  (WINAPI *pfnReadPort)(HANDLE hPort, LPBYTE pBuffer, DWORD cbBuffer,
+                LPDWORD pcbRead);
+ BOOL  (WINAPI *pfnEndDocPort)(HANDLE hPort);
+ BOOL  (WINAPI *pfnClosePort)(HANDLE hPort);
+ BOOL  (WINAPI *pfnAddPort)(LPWSTR pName, HWND hWnd, LPWSTR pMonitorName);
+ BOOL  (WINAPI *pfnAddPortEx)(LPWSTR pName, DWORD Level, LPBYTE lpBuffer,
+                LPWSTR lpMonitorName);
+ BOOL  (WINAPI *pfnConfigurePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
+ BOOL  (WINAPI *pfnDeletePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
+ BOOL  (WINAPI *pfnGetPrinterDataFromPort)(HANDLE hPort, DWORD ControlID,
+                LPWSTR pValueName, LPWSTR lpInBuffer, DWORD cbInBuffer,
+                LPWSTR lpOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbReturned);
+ BOOL  (WINAPI *pfnSetPortTimeOuts)(HANDLE hPort, LPCOMMTIMEOUTS lpCTO,
+                DWORD reserved);
+ BOOL  (WINAPI *pfnXcvOpenPort)(HANDLE hMonitor, LPCWSTR pszObject,
+                ACCESS_MASK GrantedAccess, PHANDLE phXcv);
+ DWORD (WINAPI *pfnXcvDataPort)(HANDLE hXcv, LPCWSTR pszDataName,
+                PBYTE pInputData, DWORD cbInputData,
+                PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded);
+ BOOL  (WINAPI *pfnXcvClosePort)(HANDLE hXcv);
+ /* Additions from MONITOR to MONITOR2 */
+ VOID  (WINAPI *pfnShutdown)(HANDLE hMonitor);
+ DWORD (WINAPI *pfnSendRecvBidiDataFromPort)(HANDLE hPort, DWORD dwAccessBit,
+                LPCWSTR pAction, PBIDI_REQUEST_CONTAINER pReqData,
+                PBIDI_RESPONSE_CONTAINER *ppResData);
+} MONITOR2, *LPMONITOR2, *PMONITOR2;
+
+typedef struct _MONITOREX {
+ DWORD      dwMonitorSize;
+ MONITOR    Monitor;
+} MONITOREX, *LPMONITOREX;
+
+typedef struct _MONITORREG {
+ DWORD cbSize;
+ LONG  (WINAPI *fpCreateKey)(HANDLE hcKey, LPCWSTR pszSubKey, DWORD dwOptions,
+                REGSAM samDesired, PSECURITY_ATTRIBUTES pSecurityAttributes,
+                PHANDLE phckResult, PDWORD pdwDisposition, HANDLE hSpooler);
+ LONG  (WINAPI *fpOpenKey)(HANDLE hcKey, LPCWSTR pszSubKey, REGSAM samDesired,
+                PHANDLE phkResult, HANDLE hSpooler);
+ LONG  (WINAPI *fpCloseKey)(HANDLE hcKey, HANDLE hSpooler);
+ LONG  (WINAPI *fpDeleteKey)(HANDLE hcKey, LPCWSTR pszSubKey, HANDLE hSpooler);
+ LONG  (WINAPI *fpEnumKey)(HANDLE hcKey, DWORD dwIndex, LPWSTR pszName,
+                PDWORD pcchName, PFILETIME pftLastWriteTime, HANDLE hSpooler);
+ LONG  (WINAPI *fpQueryInfoKey)(HANDLE hcKey, PDWORD pcSubKeys, PDWORD pcbKey,
+                PDWORD pcValues, PDWORD pcbValue, PDWORD pcbData,
+                PDWORD pcbSecurityDescriptor, PFILETIME pftLastWriteTime,
+                HANDLE hSpooler);
+ LONG  (WINAPI *fpSetValue)(HANDLE hcKey, LPCWSTR pszValue, DWORD dwType,
+                const BYTE* pData, DWORD cbData, HANDLE hSpooler);
+ LONG  (WINAPI *fpDeleteValue)(HANDLE hcKey, LPCWSTR pszValue, HANDLE hSpooler);
+ LONG  (WINAPI *fpEnumValue)(HANDLE hcKey, DWORD dwIndex, LPWSTR pszValue,
+                PDWORD pcbValue, PDWORD pType, PBYTE pData, PDWORD pcbData,
+                HANDLE hSpooler);
+ LONG  (WINAPI *fpQueryValue)(HANDLE hcKey, LPCWSTR pszValue, PDWORD pType,
+                PBYTE pData, PDWORD pcbData, HANDLE hSpooler);
+} MONITORREG, *PMONITORREG;
+
+typedef struct _MONITORINIT {
+ DWORD       cbSize;
+ HANDLE      hSpooler;
+ HANDLE      hckRegistryRoot;
+ PMONITORREG pMonitorReg;
+ BOOL        bLocal;
+} MONITORINIT, *PMONITORINIT;
+
+typedef struct _MONITORUI {
+ DWORD dwMonitorUISize;
+ BOOL  (WINAPI *pfnAddPortUI)(PCWSTR pszServer, HWND hWnd,
+                PCWSTR pszPortNameIn, PWSTR *ppszPortNameOut);
+ BOOL  (WINAPI *pfnConfigurePortUI)(PCWSTR pName, HWND hWnd, PCWSTR pPortName);
+ BOOL  (WINAPI *pfnDeletePortUI)(PCWSTR pszServer, HWND hWnd, PCWSTR pszPortName);
+}MONITORUI, *PMONITORUI;
+
+typedef struct _PRINTER_NOTIFY_INIT {
+ DWORD  Size;
+ DWORD  Reserved;
+ DWORD  PollTime;
+} PRINTER_NOTIFY_INIT, *LPPRINTER_NOTIFY_INIT, *PPRINTER_NOTIFY_INIT;
+
+typedef struct _PRINTPROCESSOROPENDATA {
+ PDEVMODEW pDevMode;
+ LPWSTR    pDatatype;
+ LPWSTR    pParameters;
+ LPWSTR    pDocumentName;
+ DWORD     JobId;
+ LPWSTR    pOutputFile;
+ LPWSTR    pPrinterName;
+} PRINTPROCESSOROPENDATA, *LPPRINTPROCESSOROPENDATA, *PPRINTPROCESSOROPENDATA;
+
+
+/*
+ * WARNING: Many Functions are declared as "BOOL", but return ROUTER_*
+ */
+
+typedef struct _PRINTPROVIDOR {
+ BOOL   (WINAPI *fpOpenPrinter)(LPWSTR lpPrinterName, HANDLE *phPrinter,
+                 LPPRINTER_DEFAULTSW pDefault);
+ BOOL   (WINAPI *fpSetJob)(HANDLE hPrinter, DWORD JobID, DWORD Level,
+                 LPBYTE pJob, DWORD Command);
+ BOOL   (WINAPI *fpGetJob)(HANDLE hPrinter, DWORD JobID, DWORD Level,
+                 LPBYTE pJob, DWORD cbBuf, LPDWORD pcbNeeded);
+ BOOL   (WINAPI *fpEnumJobs)(HANDLE hPrinter, DWORD FirstJob, DWORD NoJobs,
+                 DWORD Level, LPBYTE pJob, DWORD cbBuf, LPDWORD pcbNeeded,
+                 LPDWORD pcReturned);
+ HANDLE (WINAPI *fpAddPrinter)(LPWSTR pName, DWORD Level, LPBYTE pPrinter);
+ BOOL   (WINAPI *fpDeletePrinter)(HANDLE hPrinter);
+ BOOL   (WINAPI *fpSetPrinter)(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter,
+                 DWORD Command);
+ BOOL   (WINAPI *fpGetPrinter)(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter,
+                 DWORD cbBuf, LPDWORD pcbNeeded);
+ BOOL   (WINAPI *fpEnumPrinters)(DWORD dwType, LPWSTR lpszName, DWORD dwLevel,
+                 LPBYTE lpbPrinters, DWORD cbBuf, LPDWORD lpdwNeeded,
+                 LPDWORD lpdwReturned);
+ BOOL   (WINAPI *fpAddPrinterDriver)(LPWSTR pName, DWORD Level,
+                 LPBYTE pDriverInfo);
+ BOOL   (WINAPI *fpEnumPrinterDrivers)(LPWSTR pName, LPWSTR pEnvironment,
+                 DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf,
+                 LPDWORD pcbNeeded, LPDWORD pcbReturned);
+ BOOL   (WINAPI *fpGetPrinterDriver)(HANDLE hPrinter, LPWSTR pEnvironment,
+                 DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf,
+                 LPDWORD pcbNeeded);
+ BOOL   (WINAPI *fpGetPrinterDriverDirectory)(LPWSTR pName, LPWSTR pEnvironment,
+                 DWORD Level, LPBYTE pDriverDirectory, DWORD cbBuf,
+                 LPDWORD pcbNeeded);
+ BOOL   (WINAPI *fpDeletePrinterDriver)(LPWSTR pName, LPWSTR pEnvironment,
+                 LPWSTR pDriverName);
+ BOOL   (WINAPI *fpAddPrintProcessor)(LPWSTR pName, LPWSTR pEnvironment,
+                 LPWSTR pPathName, LPWSTR pPrintProcessorName);
+ BOOL   (WINAPI *fpEnumPrintProcessors)(LPWSTR pName, LPWSTR pEnvironment,
+                 DWORD Level, LPBYTE pPrintProcessorInfo, DWORD cbBuf,
+                 LPDWORD pcbNeeded, LPDWORD pcbReturned);
+ BOOL   (WINAPI *fpGetPrintProcessorDirectory)(LPWSTR pName, LPWSTR pEnvironment,
+                 DWORD Level, LPBYTE pPrintProcessorInfo, DWORD cbBuf,
+                 LPDWORD pcbNeeded);
+ BOOL   (WINAPI *fpDeletePrintProcessor)(LPWSTR pName, LPWSTR pEnvironment,
+                 LPWSTR pPrintProcessorName);
+ BOOL   (WINAPI *fpEnumPrintProcessorDatatypes)(LPWSTR pName,
+                 LPWSTR pPrintProcessorName, DWORD Level, LPBYTE pDatatypes,
+                 DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcbReturned);
+ DWORD  (WINAPI *fpStartDocPrinter)(HANDLE hPrinter, DWORD Level, LPBYTE pDocInfo);
+ BOOL   (WINAPI *fpStartPagePrinter)(HANDLE hPrinter);
+ BOOL   (WINAPI *fpWritePrinter)(HANDLE hPrinter, LPVOID pBuf, DWORD cbBuf,
+                 LPDWORD pcWritten);
+ BOOL   (WINAPI *fpEndPagePrinter)(HANDLE hPrinter);
+ BOOL   (WINAPI *fpAbortPrinter)(HANDLE hPrinter);
+ BOOL   (WINAPI *fpReadPrinter)(HANDLE hPrinter, LPVOID pBuf, DWORD cbBuf,
+                 LPDWORD pNoBytesRead);
+ BOOL   (WINAPI *fpEndDocPrinter)(HANDLE hPrinter);
+ BOOL   (WINAPI *fpAddJob)(HANDLE hPrinter, DWORD Level, LPBYTE pData,
+                 DWORD cbBuf, LPDWORD pcbNeeded);
+ BOOL   (WINAPI *fpScheduleJob)(HANDLE hPrinter, DWORD JobID);
+ DWORD  (WINAPI *fpGetPrinterData)(HANDLE hPrinter, LPWSTR pValueName,
+                 LPDWORD pType, LPBYTE pData, DWORD nSize, LPDWORD pcbNeeded);
+ DWORD  (WINAPI *fpSetPrinterData)(HANDLE hPrinter, LPWSTR pValueName,
+                 DWORD Type, LPBYTE pData, DWORD cbData);
+ DWORD  (WINAPI *fpWaitForPrinterChange)(HANDLE hPrinter, DWORD Flags);
+ BOOL   (WINAPI *fpClosePrinter)(HANDLE phPrinter);
+ BOOL   (WINAPI *fpAddForm)(HANDLE hPrinter, DWORD Level, LPBYTE pForm);
+ BOOL   (WINAPI *fpDeleteForm)(HANDLE hPrinter, LPWSTR pFormName);
+ BOOL   (WINAPI *fpGetForm)(HANDLE hPrinter, LPWSTR pFormName, DWORD Level,
+                 LPBYTE pForm, DWORD cbBuf, LPDWORD pcbNeeded);
+ BOOL   (WINAPI *fpSetForm)(HANDLE hPrinter, LPWSTR pFormName, DWORD Level,
+                 LPBYTE pForm);
+ BOOL   (WINAPI *fpEnumForms)(HANDLE hPrinter, DWORD Level, LPBYTE pForm,
+                 DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned);
+ BOOL   (WINAPI *fpEnumMonitors)(LPWSTR pName, DWORD Level, LPBYTE pMonitors,
+                 DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned);
+ BOOL   (WINAPI *fpEnumPorts)(LPWSTR pName, DWORD Level, LPBYTE pPorts,
+                 DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned);
+ BOOL   (WINAPI *fpAddPort)(LPWSTR pName, HWND hWnd, LPWSTR pMonitorName);
+ BOOL   (WINAPI *fpConfigurePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
+ BOOL   (WINAPI *fpDeletePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
+ HANDLE (WINAPI *fpCreatePrinterIC)(HANDLE  hPrinter, LPDEVMODEW  pDevMode);
+ BOOL   (WINAPI *fpPlayGdiScriptOnPrinterIC)(HANDLE  hPrinterIC, LPBYTE pIn,
+                 DWORD cIn, LPBYTE pOut, DWORD cOut, DWORD  ul);
+ BOOL   (WINAPI *fpDeletePrinterIC)(HANDLE hPrinterIC);
+ BOOL   (WINAPI *fpAddPrinterConnection)(LPWSTR pName);
+ BOOL   (WINAPI *fpDeletePrinterConnection)(LPWSTR pName);
+ DWORD  (WINAPI *fpPrinterMessageBox)(HANDLE hPrinter, DWORD Error, HWND hWnd,
+                 LPWSTR pText, LPWSTR pCaption, DWORD dwType);
+ BOOL   (WINAPI *fpAddMonitor)(LPWSTR pName, DWORD Level, LPBYTE pMonitors);
+ BOOL   (WINAPI *fpDeleteMonitor)(LPWSTR pName, LPWSTR pEnvironment,
+                 LPWSTR pMonitorName);
+ BOOL   (WINAPI *fpResetPrinter)(HANDLE hPrinter, LPPRINTER_DEFAULTSW pDefault);
+ BOOL   (WINAPI *fpGetPrinterDriverEx)(HANDLE hPrinter, LPWSTR pEnvironment,
+                 DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf, LPDWORD pcbNeeded,
+                 DWORD dwClientMajorVersion, DWORD dwClientMinorVersion,
+                 PDWORD pdwServerMajorVersion, PDWORD pdwServerMinorVersion);
+ HANDLE (WINAPI *fpFindFirstPrinterChangeNotification)(HANDLE hPrinter,
+                 DWORD fdwFlags, DWORD fdwOptions, LPVOID pPrinterNotifyOptions);
+ BOOL   (WINAPI *fpFindClosePrinterChangeNotification)(HANDLE hChange);
+ BOOL   (WINAPI *fpAddPortEx)(HANDLE hMonitor, LPWSTR pName, DWORD Level,
+                 LPBYTE lpBuffer, LPWSTR lpMonitorName);
+ BOOL   (WINAPI *fpShutDown)(LPVOID pvReserved);
+ BOOL   (WINAPI *fpRefreshPrinterChangeNotification)(HANDLE hPrinter,
+                 DWORD Reserved, PVOID pvReserved, PVOID pPrinterNotifyInfo);
+ BOOL   (WINAPI *fpOpenPrinterEx)(LPWSTR pPrinterName, LPHANDLE phPrinter,
+                 LPPRINTER_DEFAULTSW pDefault, LPBYTE pClientInfo, DWORD Level);
+ HANDLE (WINAPI *fpAddPrinterEx)(LPWSTR pName, DWORD Level, LPBYTE pPrinter,
+                 LPBYTE pClientInfo, DWORD ClientInfoLevel);
+ BOOL   (WINAPI *fpSetPort)(LPWSTR pName, LPWSTR pPortName, DWORD dwLevel,
+                 LPBYTE pPortInfo);
+ DWORD  (WINAPI *fpEnumPrinterData)( HANDLE hPrinter, DWORD dwIndex,
+                 LPWSTR pValueName, DWORD cbValueName, LPDWORD pcbValueName,
+                 LPDWORD pType, LPBYTE pData, DWORD cbData, LPDWORD pcbData);
+ DWORD  (WINAPI *fpDeletePrinterData)(HANDLE hPrinter, LPWSTR  pValueName);
+ DWORD  (WINAPI *fpClusterSplOpen)(LPCWSTR pszServer, LPCWSTR pszResource,
+                 PHANDLE phSpooler, LPCWSTR pszName, LPCWSTR pszAddress);
+ DWORD  (WINAPI *fpClusterSplClose)(HANDLE hSpooler);
+ DWORD  (WINAPI *fpClusterSplIsAlive)(HANDLE  hSpooler);
+ DWORD  (WINAPI *fpSetPrinterDataEx)(HANDLE hPrinter, LPCWSTR pKeyName,