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
D

DanielWehrle

@DanielWehrle
About
Posts
14
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • p/invoke _stat
    D DanielWehrle

    Thanks, now it work.

    C# csharp tutorial question

  • p/invoke _stat
    D DanielWehrle

    PInvokeStackImbalance
    Message: A call to PInvoke function 'SharpFastStatWrite!SharpFastStatWrite.Writer::_stat' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

    Thanks

    C# csharp tutorial question

  • p/invoke _stat
    D DanielWehrle

    Yes but I'm not sure what the calling conventions for the _stat call are. All I know is from: http://msdn.microsoft.com/en-us/library/14h5k7ff%28vs.71%29.aspx

    C# csharp tutorial question

  • p/invoke _stat
    D DanielWehrle

    I try to do itz like: [StructLayout(LayoutKind.Sequential)] public struct STAT { public uint st_dev; public ushort st_ino; public ushort st_mode; public short st_nlink; public short st_uid; public short st_gid; public uint st_rdev; public long st_size; public long st_atime; public long st_mtime; public long st_ctime; } [DllImport("msvcrt.dll", SetLastError = true)] static extern int _stat(string file, ref STAT buf); But recive an PInvoke Imbalance Exception.

    C# csharp tutorial question

  • p/invoke _stat
    D DanielWehrle

    The pure _stat call is not my reral problem, but I have no idear how to define the struct containing the _stat result

    C# csharp tutorial question

  • p/invoke _stat
    D DanielWehrle

    No sorry it is only fclose on the linkt, I check pinvoke.net before my post and did not find anything.

    C# csharp tutorial question

  • p/invoke _stat
    D DanielWehrle

    Hi, does anyone know how to call _stat with p/invoke from C#? it is posible to use File.Get* instead, but I need the direct call to investigate something on the file system. Thanks

    C# csharp tutorial question

  • Get correct case of Filename
    D DanielWehrle

    Not for windows but for Linux. And I comunicate by NFS with a Linux system.

    C# question

  • Get correct case of Filename
    D DanielWehrle

    I communicate to a case sensitiv Linux by using a NFS Server. So some incomming calls with wrong case gives errors on Linux side.

    C# question

  • Get correct case of Filename
    D DanielWehrle

    Hi, I make somethin like: File.WriteAllBytes("C:\\test.TXT", mybytes); FileInfo fi = new FileInfo("C:\\test.txt"); Now fi.Fullname returns the lower case FileName, but I need to get the correct cased file name. Is there any way whithout doing a enumerate directory, and compare the strings? Thanks -- Daniel

    C# question

  • The specified network name is no longer available.
    D DanielWehrle

    After my application (heavy file IO on UNC address) is running a little bit it chrashes always with: SystemIO Exception: The specified network name is no longer available. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.get_Length() On this time the Share is also not reachable by explorer, sometimes the compleate system is chrashing, on reboot I have then to kill the explorer.exe. I think I use some resources too much. What is the best way to analyse this? ProcessMonitor? WinDbg? But how? Thanks, daniel

    C# question sysadmin

  • Deserialise ACLs from HKLM\SOFTWARE\Classes\AppID\{ID}\LaunchPermissions
    D DanielWehrle

    Does anyone know a way how to deserialise and edit the acl values represented here?

    C#

  • Change DCOM Security Programmatically
    D DanielWehrle

    Hi, My Web Service application make a EventLog entry with ID 10016 in case I not give the Network Service DCOM Lunch Permissions for netman. This is ok I can set the permissions by using dcomcnfg. But I do not want to do this for all installations by hand. So is there any way to set this permission programmatically. Thanks -- Daniel

    .NET (Core and Framework) sysadmin security

  • Loosing Bytes in byte[][] while using WSE3 without MTOM
    D DanielWehrle

    Hello, I wrote a little Server and run it under Win 2003 and Win 2008, [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1, EmitConformanceClaims = true)] [WebService(Namespace="http://www.pyramid.de", Description="Pyramid")] public class WormRaid : System.Web.Services.WebService { [WebMethod(MessageName="WriteBytes")] public long WriteBytes (byte[][] memData) { return (memData[0].Length + memData[1].Length); } } Now my problem is that the second byte array in a byte[][] is always received as 0 bytes, when the first byte[] length is a odd multiple of 1024 (1024, 3072 or ...). This error occurs only without MTOM, with MTOM everything works fine (see attached code). The error is probably in the server side because the same error can be produced with a GSoap Client (also without MTOM). Here my Client Code: internal static int Main (string[] args) { long fsize1; long fsize2; long byteswritten; byte[][] ba; WormRaid wr; Random rand = new Random(); try { fsize1 = 1024L;//only odd multiple of 1024 will not work fsize2 = 512L; Console.WriteLine(" (" + fsize1 + "), (" + fsize2 + ")\n"); // Create the data to send ba = new byte[2][]; ba[0] = new byte[(int)fsize1]; rand.NextBytes(ba[0]); ba[1] = new byte[(int)fsize2]; rand.NextBytes(ba[1]); //Create Stub wr = new WormRaid(); wr.Url = "http://localhost/WSE3Test/WSE3Test.asmx"; //First Test will work always Console.WriteLine("WSE3 MTOM:"); wr.RequireMtom = true; byteswritten = wr.WriteBytes(ba); if (byteswritten != fsize1 + fsize2) { Console.WriteLine("!!! ERROR LENGTH !!!\nWritten: " + byteswritten + ", expected: " + (fsize1 + fsize2)); } else { Console.WriteLine("OK\n"); } //This test will fail Console.WriteLine("WSE3 without MTOM:"); wr.RequireMtom = false; byteswritten = wr.WriteBytes(ba); if (byteswritten != fsize1 + fsize2) { Console.WriteLine("!!! ERROR LENGTH !!!\nWritten: " + byteswritten + ", expected: " + (fsize1 + fsize2));

    C# help sysadmin data-structures lounge
  • Login

  • Don't have an account? Register

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