diff --git a/ChangeLog.n b/ChangeLog.n
index 089b12ffb113917d1e417de37728663a131c556c..354ee13d0994dbe22ea174e330ee0a190e2f3175 100644
--- a/ChangeLog.n
+++ b/ChangeLog.n
@@ -4,6 +4,12 @@ don't forget to change the version in utils/packages.lisp if you do anything
 user visible.
 
 *******************************************************************************
+2009-06-29  Andreas Fuchs  <afuchs@franz.com>
+
+	* aclpc/acl-frames.lisp: Fix types and ff call arguments in
+	  ask-user-for-directory to make popping up a directory selector work in
+	  Windows. (spr35657)
+	
 2009-06-29  Andreas Fuchs  <afuchs@franz.com>
 
 	* tk-silica/xm-gadgets.lisp: Translate :character width specifications into
diff --git a/aclpc/acl-frames.lisp b/aclpc/acl-frames.lisp
index 3cf6adb09b6c1dbe307e7c6585d9dff1984f1541..15281f148084ee48fbee6a8318609560adaec8d8 100644
--- a/aclpc/acl-frames.lisp
+++ b/aclpc/acl-frames.lisp
@@ -2062,7 +2062,9 @@ in a second Lisp process.  This frame cannot be reused."
 
 (defparameter *max-file-selection-buffer-size* (* 16 *max-path*))
 
-(ff:def-foreign-call IMallocFree ((pv win:pvoid))
+(ff:def-foreign-call IMallocFree
+    ((this :nat)
+     (pv win:pvoid))
   :returning :void
   :convention :stdcall
   :method-index 5
@@ -2079,7 +2081,8 @@ in a second Lisp process.  This frame cannot be reused."
   :strings-convert nil)
 
 (ff:def-foreign-call IShellFolderParseDisplayName
-    ((hwnd win:hwnd)
+    ((this :nat)
+     (hwnd win:hwnd)
      (pbc win:lpstr)
      (pwszDisplayName win:lpstr)
      (pchEaten win:ulong_ptr)
@@ -2092,14 +2095,13 @@ in a second Lisp process.  This frame cannot be reused."
   :returning win:hresult
   :strings-convert nil)
 
-
 (ff:def-foreign-call (MultiByteToWideChar "MultiByteToWideChar")
     ((code-page :unsigned-int)
-     (flags win:dword)     ; character-type options
-     (string win:lpcstr)   ; address of string to map
-     (nr-bytes :int)       ; number of bytes in string
-     (buffer win:lpwstr)   ; LPWSTR, address of wide-character buffer
-     (buffer-size :int)    ; size of buffer (in wide characters)
+     (flags win:dword)      ; character-type options
+     (string win:lpcstr)    ; address of string to map
+     (nr-bytes :int)        ; number of bytes in string
+     (buffer win:lpwstr)    ; LPWSTR, address of wide-character buffer
+     (buffer-size :int)     ; size of buffer (in wide characters)
      )
   :returning :int
   :convention :stdcall
@@ -2240,12 +2242,12 @@ in a second Lisp process.  This frame cannot be reused."
                          -1 ole-path *max-path*)
     ;; Let IShellFolder::ParseDisplayName turn the directory
     ;; into an ITEMIDLIST.
-    (let ((pidl (allocate-pointer :nat))
-          (cheaten (allocate-pointer :nat))
+    (let ((pidl (allocate-pointer 'win:lpcitemidlist))
+          (cheaten (allocate-pointer :unsigned-long))
           (attributes (allocate-pointer :unsigned-long)))
       (unless (= (IShellFolderParseDisplayName
 		  (pointer-value :nat desktop-folder)
-		  0 ole-path cheaten pidl
+		  0 0 ole-path cheaten pidl
 		  attributes)
                  win:NOERROR)
         (error "Error in ask-user-for-directory: ParseDisplayName failed."))