Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. AccessViolation error when use DsBrowseContainer in Vista (Active Directory Container)

AccessViolation error when use DsBrowseContainer in Vista (Active Directory Container)

Scheduled Pinned Locked Moved Windows API
csharphelptutorialdotnetvisual-studio
1 Posts 1 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ronakkumar Patel
    wrote on last edited by
    #1

    Hi guys, I went through and played with the Example given in .net 2.0 It is working perfectly fine in 32 bit Os that is XP... and i am getting the error AccessViolation in Vista...Please help me how to solve it....My Vista is aslo 32 bit.. Unhandled Exception : System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at NetSDKSamples.LibWrap.DsBrowseForContainerW(DSBrowseInfo & info) at NetSDKSamples.App.Main() I have also tried running the exe as an Administrator..still the same result. I have also tried runnint it from CMD promprt where cmd is also run as administrator...still same result.. I am running out of ideas now... please help...me.. Path of Sample on My machine... C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\LateBreaking\PlatformInvoke\WinAPIs\ActiveDir Code: //----------------------------------------------------------------------- // This file is part of the Microsoft .NET Framework SDK Code Samples. // // Copyright (C) Microsoft Corporation. All rights reserved. // //This source code is intended only as a supplement to Microsoft //Development Tools and/or on-line documentation. See these other //materials for detailed information regarding Microsoft code samples. // //THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY //KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE //IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A //PARTICULAR PURPOSE. //----------------------------------------------------------------------- // ActiveDir.cs using System; using System.Text; using System.Runtime.InteropServices; using System.Threading; /* typedef struct { DWORD cbStruct; HWND hwndOwner; LPCWSTR pszCaption; LPCWSTR pszTitle; LPCWSTR pszRoot; LPWStr pszPath; ULONG cchPath; DWORD dwFlags; BFFCALLBACK pfnCallback; LPARAM lParam; DWORD dwReturnFormat; LPCWSTR pUserName; LPCWSTR pPassword; LPWStr pszObjectClass; ULONG cchObjectClass; } DSBROWSEINFOW, *PDSBROWSEINFOW; */ // all strings in structure will be marshaled as LPWStr [ StructLayout( LayoutKind.Sequential, CharSet=CharSet.Unicode )] public struct DSBrowseInfo { public int structSize; private IntPtr dlgOwner; public string dlgCaption; public string treeViewTitle; public string rootPath; // in/out string must be declared as String in struct/class, // not as StringBuilder public string path; public int pathSize; public int flags; private Int

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups