Sources tell TMZ ... Maddalena -- who is Wes Craven's producing partner -- was dating a contractor named Derrick Toole in August 2010.
Law enforcement sources tell us Toole allegedly put an "E-blaster" on Maddalena's computer and a tracking device on her car -- which means he could read EVERY email she sent, every website she visited and GPS her location at any given moment.
Once Toole's tricks were discovered -- following an investigation -- a felony complaint was filed against Toole by the L.A. Deputy District Attorney for wiretapping, computer access and fraud.
The docs, filed this week, reveal the hacking and tracking shenanigans weren't JUST happening to Maddalena. Toole was also accused of pulling the same high-tech tricks in other homes.
A judge issued a restraining order against Toole, barring him from going within 100 yards of Maddalena and the other victims listed in the complaint.
Toole's lawyer had no comment had this time.