This project has moved. For the latest updates, please go here.

The data area passed to a system call is too small. (Exception from HRESULT: 0x8007007A).

Topics: Errors
Dec 14, 2012 at 7:01 PM

I used TaskScheduler.dll (1.0) to create and register a task. It registers the task and runs on my machine. but when i deployed the executable to a diff machine it threw and exception -The data area passed to a system call is too small. (Exception from HRESULT: 0x8007007A).

 

My code is similar to this sample code


using
(TaskService ts = new TaskService()) { // Create a new task definition and assign properties TaskDefinition td = ts.NewTask(); td.RegistrationInfo.Description = "Does something"; td.Principal.LogonType = TaskLogonType.InteractiveToken; // Add a trigger that will fire the task at this time every other day DailyTrigger dt = (DailyTrigger)td.Triggers.Add(new DailyTrigger { DaysInterval = 2 }); dt.Repetition.Duration = TimeSpan.FromHours(4); dt.Repetition.Interval = TimeSpan.FromHours(1); // Add a trigger that will fire every week on Friday td.Triggers.Add(new WeeklyTrigger { StartBoundary = DateTime.Today + TimeSpan.FromHours(2), DaysOfWeek = DaysOfTheWeek.Friday }); // Add an action that will launch Notepad whenever the trigger fires td.Actions.Add(new ExecAction("notepad.exe", "c:\\test.log", null)); // Register the task in the root folder const string taskName = "Test"; ts.RootFolder.RegisterTaskDefinition(taskName, td);

}

 

 

Coordinator
Dec 14, 2012 at 11:38 PM

Please provide the full stack behind the exception and let me know which OS verions the successful and unsuccessful code were run on. Also, please clarify what version of the library you are using. I don't know what TaskScheduler.dll (1.0) is. This library is currently at version 1.9.2 and should be named Microsoft.Win32.TaskScheduler.dll.

Dec 15, 2012 at 8:39 AM

Hi here is the stack trace,

Currently am using verision 1.8.3.15820 of the Microsoft.Win32.TaskScheduler.dll the OS is windows XP

 at System.Runtime.InteropServices.ComTypes.IPersistFile.Save(String pszFileName, Boolean fRemember)

   at Microsoft.Win32.TaskScheduler.TaskDefinition.V1Save(String newName)

   at Microsoft.Win32.TaskScheduler.TaskFolder.RegisterTaskDefinition(String Path, TaskDefinition definition, TaskCreation createType, String UserId, String password, TaskLogonType LogonType, String sddl)

   at Microsoft.Win32.TaskScheduler.TaskFolder.RegisterTaskDefinition(String Path, TaskDefinition definition)

Also i noticed that when i manuall tried to create a taks on that machine with my user credentials i got a error saying  An Error has occured while attempting to set

task account information The specific error is 0x8007007a: The data area passed to a system call is too small.

Thanks for your help.

 

 

Coordinator
Dec 17, 2012 at 10:46 PM

I have just run the exact code posted above on Windows 7, but forcing compatibility with the V1 native library (XP, Win2K) and did not get the error. What OS are you on and what exactly are you adding to the TaskDefinition?