#line 1 "funcs.c"
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:ADDFONTRESOURCEA, lpcstr)
{
  object arg;
  int int0;
  LPCSTR lpcstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr = TheAsciz(string_to_asciz(arg,encoding));
  begin_system_call();
  int0 = AddFontResourceA(lpcstr);
  end_system_call();
  if(0 <=int0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = sint32_to_I(int0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:ADDFONTRESOURCEW, lpcwstr)
{
  object arg;
  int int0;
  LPCWSTR lpcwstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr = WIDECHAR(arg,encoding);
  begin_system_call();
  int0 = AddFontResourceW(lpcwstr);
  end_system_call();
  if(0 <=int0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = sint32_to_I(int0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:COPYENHMETAFILEA, henhmetafile lpcstr)
{
  object arg;
  HENHMETAFILE henhmetafile0;
  HENHMETAFILE henhmetafile;
  LPCSTR lpcstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr = TheAsciz(string_to_asciz(arg,encoding));
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  henhmetafile = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  henhmetafile0 = CopyEnhMetaFileA(henhmetafile,lpcstr);
  end_system_call();
  if(NULL ==henhmetafile0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(henhmetafile0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:COPYENHMETAFILEW, henhmetafile lpcwstr)
{
  object arg;
  HENHMETAFILE henhmetafile0;
  HENHMETAFILE henhmetafile;
  LPCWSTR lpcwstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr = 0; //WIDECHAR(arg,encoding);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  henhmetafile = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  henhmetafile0 = CopyEnhMetaFileW(henhmetafile,lpcwstr);
  end_system_call();
  if(NULL ==henhmetafile0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(henhmetafile0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:COPYMETAFILEA, hmetafile lpcstr)
{
  object arg;
  HMETAFILE hmetafile0;
  HMETAFILE hmetafile;
  LPCSTR lpcstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr = TheAsciz(string_to_asciz(arg,encoding));
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hmetafile = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  hmetafile0 = CopyMetaFileA(hmetafile,lpcstr);
  end_system_call();
  if(NULL ==hmetafile0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hmetafile0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:COPYMETAFILEW, hmetafile lpcwstr)
{
  object arg;
  HMETAFILE hmetafile0;
  HMETAFILE hmetafile;
  LPCWSTR lpcwstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr = WIDECHAR(arg,encoding);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hmetafile = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  hmetafile0 = CopyMetaFileW(hmetafile,lpcwstr);
  end_system_call();
  if(NULL ==hmetafile0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hmetafile0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEBITMAPINDIRECT, bitmap_p)
{
  object arg;
  HBITMAP hbitmap;
  BITMAP* bitmap_p = alloca(sizeof(BITMAP));
  object arg0;
  arg0 = popSTACK();
  processBITMAP(bitmap_p,arg0);
  processBITMAP(bitmap_p,arg0);
  begin_system_call();
  hbitmap = CreateBitmapIndirect(bitmap_p);
  end_system_call();
  if(NULL ==hbitmap){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hbitmap);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEBRUSHINDIRECT, logbrush_p)
{
  object arg;
  HBRUSH hbrush;
  LOGBRUSH* logbrush_p = alloca(sizeof(LOGBRUSH));
  object arg0;
  arg0 = popSTACK();
  processLOGBRUSH(logbrush_p,arg0);
  processLOGBRUSH(logbrush_p,arg0);
  begin_system_call();
  hbrush = CreateBrushIndirect(logbrush_p);
  end_system_call();
  if(NULL ==hbrush){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hbrush);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATECOLORSPACEA, lplogcolorspacea)
{
  object arg;
  HCOLORSPACE hcolorspace;
  LOGCOLORSPACEA* lplogcolorspacea = alloca(sizeof(LOGCOLORSPACEA));
  object arg0;
  arg0 = popSTACK();
  processLOGCOLORSPACEA(lplogcolorspacea,arg0);
  processLOGCOLORSPACEA(lplogcolorspacea,arg0);
  begin_system_call();
  hcolorspace = CreateColorSpaceA(lplogcolorspacea);
  end_system_call();
  if(NULL ==hcolorspace){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hcolorspace);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATECOLORSPACEW, lplogcolorspacew)
{
  object arg;
  HCOLORSPACE hcolorspace;
  LOGCOLORSPACEW* lplogcolorspacew = alloca(sizeof(LOGCOLORSPACEW));
  object arg0;
  arg0 = popSTACK();
  processLOGCOLORSPACEW(lplogcolorspacew,arg0);
  processLOGCOLORSPACEW(lplogcolorspacew,arg0);
  begin_system_call();
  hcolorspace = CreateColorSpaceW(lplogcolorspacew);
  end_system_call();
  if(NULL ==hcolorspace){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hcolorspace);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEDCA, lpcstr lpcstr0 lpcstr1 devmodea_p)
{
  object arg;
  HDC hdc;
  LPCSTR lpcstr;
  LPCSTR lpcstr0;
  LPCSTR lpcstr1;
  DEVMODEA* devmodea_p = alloca(sizeof(DEVMODEA));
  object arg0;
  arg0 = popSTACK();
  processDEVMODEA(devmodea_p,arg0);
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr1 = TheAsciz(string_to_asciz(arg,encoding));
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr0 = TheAsciz(string_to_asciz(arg,encoding));
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr = TheAsciz(string_to_asciz(arg,encoding));
  processDEVMODEA(devmodea_p,arg0);
  begin_system_call();
  hdc = CreateDCA(lpcstr,lpcstr0,lpcstr1,devmodea_p);
  end_system_call();
  if(NULL ==hdc){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hdc);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEDCW, lpcwstr lpcwstr0 lpcwstr1 devmodew_p)
{
  object arg;
  HDC hdc;
  LPCWSTR lpcwstr;
  LPCWSTR lpcwstr0;
  LPCWSTR lpcwstr1;
  DEVMODEW* devmodew_p = alloca(sizeof(DEVMODEW));
  object arg0;
  arg0 = popSTACK();
  processDEVMODEW(devmodew_p,arg0);
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr1 = WIDECHAR(arg,encoding);
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr0 = WIDECHAR(arg,encoding);
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr = WIDECHAR(arg,encoding);
  processDEVMODEW(devmodew_p,arg0);
  begin_system_call();
  hdc = CreateDCW(lpcwstr,lpcwstr0,lpcwstr1,devmodew_p);
  end_system_call();
  if(NULL ==hdc){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hdc);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEELLIPTICRGNINDIRECT, lpcrect)
{
  object arg;
  HRGN hrgn;
  RECT* lpcrect = alloca(sizeof(RECT));
  object arg0;
  arg0 = popSTACK();
  processRECT(lpcrect,arg0);
  begin_system_call();
  hrgn = CreateEllipticRgnIndirect(lpcrect);
  end_system_call();
  if(NULL ==hrgn){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hrgn);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEENHMETAFILEA, hdc lpcstr lpcrect lpcstr0)
{
  object arg;
  HDC hdc0;
  HDC hdc;
  LPCSTR lpcstr;
  RECT* lpcrect = alloca(sizeof(RECT));
  object arg0;
  LPCSTR lpcstr0;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr0 = TheAsciz(string_to_asciz(arg,encoding));
  arg0 = popSTACK();
  processRECT(lpcrect,arg0);
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr = TheAsciz(string_to_asciz(arg,encoding));
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  processRECT(lpcrect,arg0);
  begin_system_call();
  hdc0 = CreateEnhMetaFileA(hdc,lpcstr,lpcrect,lpcstr0);
  end_system_call();
  if(NULL ==hdc0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hdc0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEENHMETAFILEW, hdc lpcwstr lpcrect lpcwstr0)
{
  object arg;
  HDC hdc0;
  HDC hdc;
  LPCWSTR lpcwstr;
  RECT* lpcrect = alloca(sizeof(RECT));
  object arg0;
  LPCWSTR lpcwstr0;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr0 = WIDECHAR(arg,encoding);
  arg0 = popSTACK();
  processRECT(lpcrect,arg0);
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr = WIDECHAR(arg,encoding);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  processRECT(lpcrect,arg0);
  begin_system_call();
  hdc0 = CreateEnhMetaFileW(hdc,lpcwstr,lpcrect,lpcwstr0);
  end_system_call();
  if(NULL ==hdc0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hdc0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEFONTINDIRECTA, logfonta_p)
{
  object arg;
  HFONT hfont;
  LOGFONTA* logfonta_p = alloca(sizeof(LOGFONTA));
  object arg0;
  arg0 = popSTACK();
  processLOGFONTA(logfonta_p,arg0);
  begin_system_call();
  hfont = CreateFontIndirectA(logfonta_p);
  end_system_call();
  if(NULL ==hfont){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hfont);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEFONTINDIRECTW, logfontw_p)
{
  object arg;
  HFONT hfont;
  LOGFONTW* logfontw_p = alloca(sizeof(LOGFONTW));
  object arg0;
  arg0 = popSTACK();
  processLOGFONTW(logfontw_p,arg0);
  processLOGFONTW(logfontw_p,arg0);
  begin_system_call();
  hfont = CreateFontIndirectW(logfontw_p);
  end_system_call();
  if(NULL ==hfont){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hfont);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEICA, lpcstr lpcstr0 lpcstr1 devmodea_p)
{
  object arg;
  HDC hdc;
  LPCSTR lpcstr;
  LPCSTR lpcstr0;
  LPCSTR lpcstr1;
  DEVMODEA* devmodea_p = alloca(sizeof(DEVMODEA));
  object arg0;
  arg0 = popSTACK();
  processDEVMODEA(devmodea_p,arg0);
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr1 = TheAsciz(string_to_asciz(arg,encoding));
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr0 = TheAsciz(string_to_asciz(arg,encoding));
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr = TheAsciz(string_to_asciz(arg,encoding));
  processDEVMODEA(devmodea_p,arg0);
  begin_system_call();
  hdc = CreateICA(lpcstr,lpcstr0,lpcstr1,devmodea_p);
  end_system_call();
  if(NULL ==hdc){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hdc);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEICW, lpcwstr lpcwstr0 lpcwstr1 devmodew_p)
{
  object arg;
  HDC hdc;
  LPCWSTR lpcwstr;
  LPCWSTR lpcwstr0;
  LPCWSTR lpcwstr1;
  DEVMODEW* devmodew_p = alloca(sizeof(DEVMODEW));
  object arg0;
  arg0 = popSTACK();
  processDEVMODEW(devmodew_p,arg0);
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr1 = WIDECHAR(arg,encoding);
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr0 = WIDECHAR(arg,encoding);
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr = WIDECHAR(arg,encoding);
  processDEVMODEW(devmodew_p,arg0);
  begin_system_call();
  hdc = CreateICW(lpcwstr,lpcwstr0,lpcwstr1,devmodew_p);
  end_system_call();
  if(NULL ==hdc){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hdc);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEICONFROMRESOURCE, pbyte dword bool0 dword0)
{
  object arg;
  object arg0;
  HICON hicon;
  PBYTE pbyte;
  DWORD dword;
  BOOL bool0;
  DWORD dword0;
  arg = popSTACK();
  check_uint(arg);
  dword0 = I_to_uint32(arg);
  arg0 = popSTACK();
  processBOOL(bool0,arg0);
  arg = popSTACK();
  check_uint(arg);
  dword = I_to_uint32(arg);
  arg0 = popSTACK();
  processPBYTE(pbyte,arg0);
  begin_system_call();
  hicon = CreateIconFromResource(pbyte,dword,bool0,dword0);
  end_system_call();
  if(NULL ==hicon){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hicon);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEICONINDIRECT, piconinfo)
{
  object arg;
  HICON hicon;
  ICONINFO iconinfo;
  arg = popSTACK();
  processICONINFO(&iconinfo,arg);
  begin_system_call();
  hicon = CreateIconIndirect(&iconinfo);
  end_system_call();
  if(NULL ==hicon){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hicon);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEMETAFILEA, lpcstr)
{
  object arg;
  HDC hdc;
  LPCSTR lpcstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr = TheAsciz(string_to_asciz(arg,encoding));
  begin_system_call();
  hdc = CreateMetaFileA(lpcstr);
  end_system_call();
  if(NULL ==hdc){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hdc);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEMETAFILEW, lpcwstr)
{
  object arg;
  HDC hdc;
  LPCWSTR lpcwstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr = WIDECHAR(arg,encoding);
  begin_system_call();
  hdc = CreateMetaFileW(lpcwstr);
  end_system_call();
  if(NULL ==hdc){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hdc);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEPALETTE, logpalette_p)
{
  object arg;
  HPALETTE hpalette;
  LOGPALETTE* logpalette_p = alloca(sizeof(LOGPALETTE));
  object arg0;
  arg0 = popSTACK();
  processLOGPALETTE(logpalette_p,arg0);
  processLOGPALETTE(logpalette_p,arg0);
  begin_system_call();
  hpalette = CreatePalette(logpalette_p);
  end_system_call();
  if(NULL ==hpalette){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hpalette);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEPENINDIRECT, logpen_p)
{
  object arg;
  HPEN hpen;
  LOGPEN* logpen_p = alloca(sizeof(LOGPEN));
  object arg0;
  arg0 = popSTACK();
  processLOGPEN(logpen_p,arg0);
  processLOGPEN(logpen_p,arg0);
  begin_system_call();
  hpen = CreatePenIndirect(logpen_p);
  end_system_call();
  if(NULL ==hpen){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hpen);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATERECTRGNINDIRECT, lpcrect)
{
  object arg;
  HRGN hrgn;
  RECT* lpcrect = alloca(sizeof(RECT));
  object arg0;
  arg0 = popSTACK();
  processRECT(lpcrect,arg0);
  processRECT(lpcrect,arg0);
  begin_system_call();
  hrgn = CreateRectRgnIndirect(lpcrect);
  end_system_call();
  if(NULL ==hrgn){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hrgn);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:CREATEWINDOWINDIRECTA, cs)
{
  object arg;
  HWND hwnd;
  CREATESTRUCT* p = alloca(sizeof(CREATESTRUCT));
  object arg0;
//asm("int3");
  arg0 = popSTACK();
  processCREATESTRUCTA(p,arg0);
  begin_system_call();
  hwnd = CreateWindowEx(p->dwExStyle, p->lpszClass, p->lpszName, p->style,
    p->x, p->y, p->cx, p->cy, p->hwndParent, p->hMenu, p->hInstance,
    p->lpCreateParams);
  end_system_call();
  if(NULL ==hwnd){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hwnd);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:FILLRECT, hdc lpcrect hbrush)
{
  object arg;
  BOOL bool0;
  HDC hdc;
  RECT* lpcrect = alloca(sizeof(RECT));
  object arg0;
  HBRUSH hbrush;
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hbrush = TheFpointer(arg)->fp_pointer;
  arg0 = popSTACK();
  processRECT(lpcrect,arg0);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  processRECT(lpcrect,arg0);
  begin_system_call();
  bool0 = FillRect(hdc,lpcrect,hbrush);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN(GDI:GETDC, dc)
{
  object arg = popSTACK();
  DWORD e = 0;
  HWND h = (nullp(arg))?0:(TheFpointer(arg)->fp_pointer);
  begin_system_call();
  h = GetDC(h);
  end_system_call();
  if(NULL == h){
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(h);
    mv_count=2;
  }
  return;
}
// Nothing in the docs indicates that this function can return a error code,
// so to be consistant, I will return T and the result.
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:GETDEVICECAPS, hdc int0)
{
  object arg;
  int int1;
  HDC hdc;
  int int0;
  arg = popSTACK();
  check_sint(arg);
  int0 = I_to_sint32(arg);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  int1 = GetDeviceCaps(hdc,int0);
  end_system_call();
  if(0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = sint32_to_I(int1);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:GETSYSTEMMETRICS, int0)
{
  object arg;
  int int1;
  int int0;
  arg = popSTACK();
  int0 = I_to_sint32(arg);
  begin_system_call();
  int1 = GetSystemMetrics(int0);
  end_system_call();
  value1 = sint32_to_I(int1);
  mv_count=1;
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:LOADCURSORA, hinstance lpcstr)
{
  object arg;
  HCURSOR hcursor;
  HINSTANCE hinstance;
  void* lpcstr;
  arg = popSTACK();

  if(stringp(arg))
  {
     lpcstr = TheAsciz(string_to_asciz(arg,encoding));
  }
  else if(fpointerp(arg))
  {
     lpcstr = TheFpointer(arg)->fp_pointer;
  }
  else argumentum_inritum(arg);
  arg = popSTACK();
  if(nullp(arg))
  {
     hinstance = NULL;
  }
  else if(fpointerp(arg))
  {
     hinstance = TheFpointer(arg)->fp_pointer;
  }
  else argumentum_inritum(arg);
  begin_system_call();
  hcursor = LoadCursorA(hinstance,lpcstr);
  end_system_call();
  if(NULL ==hcursor){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hcursor);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:LOADCURSORW, hinstance lpcwstr)
{
  object arg;
  HCURSOR hcursor;
  HINSTANCE hinstance;
  LPCWSTR lpcwstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr = WIDECHAR(arg,encoding);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hinstance = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  hcursor = LoadCursorW(hinstance,lpcwstr);
  end_system_call();
  if(NULL ==hcursor){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hcursor);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:PLAYENHMETAFILE, hdc henhmetafile lpcrect)
{
  object arg;
  BOOL bool0;
  HDC hdc;
  HENHMETAFILE henhmetafile;
  RECT* lpcrect = alloca(sizeof(RECT));
  object arg0;
  arg0 = popSTACK();
  processRECT(lpcrect,arg0);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  henhmetafile = TheFpointer(arg)->fp_pointer;
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  processRECT(lpcrect,arg0);
  begin_system_call();
  bool0 = PlayEnhMetaFile(hdc,henhmetafile,lpcrect);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:RECTINREGION, hrgn lpcrect)
{
  object arg;
  BOOL bool0;
  HRGN hrgn;
  RECT* lpcrect = alloca(sizeof(RECT));
  object arg0;
  arg0 = popSTACK();
  processRECT(lpcrect,arg0);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hrgn = TheFpointer(arg)->fp_pointer;
  processRECT(lpcrect,arg0);
  begin_system_call();
  bool0 = RectInRegion(hrgn,lpcrect);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:RECTVISIBLE, hdc lpcrect)
{
  object arg;
  BOOL bool0;
  HDC hdc;
  RECT* lpcrect = alloca(sizeof(RECT));
  object arg0;
  arg0 = popSTACK();
  processRECT(lpcrect,arg0);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  processRECT(lpcrect,arg0);
  begin_system_call();
  bool0 = RectVisible(hdc,lpcrect);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:REGISTERCLASSA, wndclassa_p)
{
  object arg;
  ATOM atom;
  WNDCLASSA* wndclassa_p = alloca(sizeof(WNDCLASSA));
  object arg0;
  arg0 = popSTACK();
//asm("int3");
  processWNDCLASSA(wndclassa_p,arg0);
  begin_system_call();
  atom = RegisterClassA(wndclassa_p);
  end_system_call();
  if(0 ==atom){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(atom);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:REGISTERCLASSW, wndclassw_p)
{
  object arg;
  ATOM atom;
  WNDCLASSW* wndclassw_p = alloca(sizeof(WNDCLASSW));
  object arg0;
  arg0 = popSTACK();
  processWNDCLASSW(wndclassw_p,arg0);
  begin_system_call();
  atom = RegisterClassW(wndclassw_p);
  end_system_call();
  if(0 ==atom){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(atom);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:REMOVEFONTRESOURCEA, lpcstr)
{
  object arg;
  BOOL bool0;
  LPCSTR lpcstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcstr = TheAsciz(string_to_asciz(arg,encoding));
  begin_system_call();
  bool0 = RemoveFontResourceA(lpcstr);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:REMOVEFONTRESOURCEW, lpcwstr)
{
  object arg;
  BOOL bool0;
  LPCWSTR lpcwstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpcwstr = WIDECHAR(arg,encoding);
  begin_system_call();
  bool0 = RemoveFontResourceW(lpcwstr);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:RESETDCA, hdc devmodea_p)
{
  object arg;
  HDC hdc0;
  HDC hdc;
  DEVMODEA* devmodea_p = alloca(sizeof(DEVMODEA));
  object arg0;
  arg0 = popSTACK();
  processDEVMODEA(devmodea_p,arg0);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  processDEVMODEA(devmodea_p,arg0);
  begin_system_call();
  hdc0 = ResetDCA(hdc,devmodea_p);
  end_system_call();
  if(NULL ==hdc0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hdc0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:RESETDCW, hdc devmodew_p)
{
  object arg;
  HDC hdc0;
  HDC hdc;
  DEVMODEW* devmodew_p = alloca(sizeof(DEVMODEW));
  object arg0;
  arg0 = popSTACK();
  processDEVMODEW(devmodew_p,arg0);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  processDEVMODEW(devmodew_p,arg0);
  begin_system_call();
  hdc0 = ResetDCW(hdc,devmodew_p);
  end_system_call();
  if(NULL ==hdc0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hdc0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:SELECTPALETTE, hdc hpalette bool0)
{
  object arg;
  HPALETTE hpalette0;
  HDC hdc;
  HPALETTE hpalette;
  BOOL bool0;
  arg = popSTACK();
  bool0 = nullp(arg);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hpalette = TheFpointer(arg)->fp_pointer;
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  hpalette0 = SelectPalette(hdc,hpalette,bool0);
  end_system_call();
  if(NULL ==hpalette0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = allocate_fpointer(hpalette0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:SETCOLORADJUSTMENT, hdc coloradjustment_p)
{
  object arg;
  BOOL bool0;
  HDC hdc;
  COLORADJUSTMENT* coloradjustment_p = alloca(sizeof(COLORADJUSTMENT));
  object arg0;
  arg0 = popSTACK();
  processCOLORADJUSTMENT(coloradjustment_p,arg0);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  processCOLORADJUSTMENT(coloradjustment_p,arg0);
  begin_system_call();
  bool0 = SetColorAdjustment(hdc,coloradjustment_p);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:SETDEVICEGAMMARAMP, hdc pvoid)
{
  object arg;
  BOOL bool0;
  HDC hdc;
  void* pvoid;
  arg = popSTACK();
  if(!simple_bit_vector_p(Atype_8Bit,arg))argumentum_inritum(arg);
  pvoid = &(TheSbvector(arg)->data);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  bool0 = SetDeviceGammaRamp(hdc,pvoid);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:SETICMPROFILEA, hdc lpstr)
{
  object arg;
  BOOL bool0;
  HDC hdc;
  LPSTR lpstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpstr = TheAsciz(string_to_asciz(arg,encoding));
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  bool0 = SetICMProfileA(hdc,lpstr);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:SETICMPROFILEW, hdc lpwstr)
{
  object arg;
  BOOL bool0;
  HDC hdc;
  LPWSTR lpwstr;
  arg = popSTACK();
  if(!stringp(arg))argumentum_inritum(arg);
  lpwstr = WIDECHAR(arg,encoding);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  bool0 = SetICMProfileW(hdc,lpwstr);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:SETPIXEL, hdc int0 int1 colorref)
{
  object arg;
  COLORREF colorref0;
  HDC hdc;
  int int0;
  int int1;
  COLORREF colorref;
  arg = popSTACK();
  colorref = processCOLORREF(arg);
  arg = popSTACK();
  check_sint(arg);
  int1 = I_to_sint32(arg);
  arg = popSTACK();
  check_sint(arg);
  int0 = I_to_sint32(arg);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  colorref0 = SetPixel(hdc,int0,int1,colorref);
  end_system_call();
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:SETPIXELV, hdc int0 int1 colorref)
{
  object arg;
  BOOL bool0;
  HDC hdc;
  int int0;
  int int1;
  COLORREF colorref;
  arg = popSTACK();
  colorref = processCOLORREF(arg);
  arg = popSTACK();
  check_sint(arg);
  int1 = I_to_sint32(arg);
  arg = popSTACK();
  check_sint(arg);
  int0 = I_to_sint32(arg);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  bool0 = SetPixelV(hdc,int0,int1,colorref);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:SETTEXTCOLOR, hdc colorref)
{
  object arg;
  COLORREF colorref0;
  HDC hdc;
  COLORREF colorref;
  arg = popSTACK();
  colorref = processCOLORREF(arg);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  begin_system_call();
  colorref0 = SetTextColor(hdc,colorref);
  end_system_call();
  if(CLR_INVALID == colorref0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    value2 = fixnum(colorref0);
    mv_count=2;
  }
  return;
}
// untested - was never called
// uninspected - compiles but code was not checked
DEFUN( GDI:SETWORLDTRANSFORM, hdc xform_p)
{
  object arg;
  BOOL bool0;
  HDC hdc;
  XFORM* xform_p = alloca(sizeof(XFORM));
  object arg0;
  arg0 = popSTACK();
  processXFORM(xform_p,arg0);
  arg = popSTACK();
  if(!fpointerp(arg))argumentum_inritum(arg);
  hdc = TheFpointer(arg)->fp_pointer;
  processXFORM(xform_p,arg0);
  begin_system_call();
  bool0 = SetWorldTransform(hdc,xform_p);
  end_system_call();
  if(!bool0){
    DWORD e;
    begin_system_call();
    e = GetLastError();
    end_system_call();
    value1 = NIL;
    value2 = uint32_to_I(e);
    mv_count=2;
  }
  else
  {
    value1 = T;
    mv_count=1;
  }
  return;
}
